Really random character animations

  • #10, by esmeraldaSaturday, 06. November 2021, 14:51 3 years ago
    As an alternative you could create your own random animation.

    Create your random animations as "character animations"
    Create a "called by other action" action:
    set a random value A between 2 sec and 5 sec (or whatever your time intervall shall be)
    pause for A sec
    set a random value B between 1 and 4 (or as many different random animation you have)
    if B = 1
     play animation 1 (and wait)
    else if B = 2
     play animation 2 (and wait)
    ...
    end if
    jump to actionpart #1

    And call this action at the beginning of the scene or whenever you want.

    (instead of setting the animation to wait you could call the action again in the last frame of your "random" animations and get rid of the jump to actionpart action)

    Key Killer

    535 Posts


  • #11, by gregor-muellerSaturday, 06. November 2021, 16:59 3 years ago
    Thanks Esmeralda, sounds good. I'll give that a go. Though I vaguely remember trying something like that a while ago and ran into problems with the speaking animations. I'm sure I will be able to work it out (with conditions that suppress the random animation while talking) eventually but at the moment I thought there had to be a simpler solution I did not see...

    Newbie

    20 Posts

  • #12, by afrlmeSunday, 07. November 2021, 02:36 3 years ago
    You could technically do that inside of the idle animation frames too. Maybe use a value that decrements x times (could be a random value to make it more dynamic) then when value hits 0 you have it play a random character animation & reset the value back to however many loops you want it to before calling another random character animation -  you could also wrap it inside of an if condition query that you can use to tell it when it's allowed to play random animations.

    Imperator

    7286 Posts

  • #13, by gregor-muellerWednesday, 10. November 2021, 13:32 3 years ago
    Wow, I feel INCREDIBLY stupid right now. I spent weeks on this, always returning to it when I had a moment. And all it took are five lines in the editor - even with a random pause between the animations. It turned out by doing what afrlme suggested and putting it in the idle animation I didn't even need the if-condition to check if the character is talking...
    Thanks so much afrlme and esmeralda!
    I'll probably set up some other random character animations like this as well to give my scenes a bit more "life".

    Newbie

    20 Posts

  • #14, by afrlmeWednesday, 10. November 2021, 22:51 3 years ago
    The if condition query was for npc that you might want to interact with, so they don't do random character animations while you are talking to them - again smartly using if queries you could technically still play random animations & have the action block with the dialog wait until the random animation has finished playing. There's lots of things you can do to make your game feel more dynamic & alive.

    Anyway, if you get stumped with anything else, feel free to ask on here or on our Discord server @ https://discord.gg/g5zFejW.

    Imperator

    7286 Posts