Really random character animations

  • #1, by gregor-muellerTuesday, 12. October 2021, 16:45 2 years ago
    Hi,
    I have a character sitting in a rocking chair and set up a little animation where he is rocking back and forth under the random animations. Normally this works fine, the animation is played in the set random interval. But as long as another character speaks the animation does not get played. 
    Do random animations not get played when other characters are speaking? If so, how can I circumvent that? (With as little Lua as po

    Newbie

    20 Posts


  • #2, by afrlmeWednesday, 13. October 2021, 02:39 2 years ago
    Other characters speaking or doing things shouldn't affect it. The only things that should affect the character are: telling it to move to another position, manually playing an animation belonging to it,  or triggering a display text action part linked to the npc.

    By default the random animation time is fairly large. If I remember correctly is something like 20-30 seconds, but I could be wrong about that time. It is actually possible to change the default min/max time via the properties section for the selected outfit or via scripting.

    Imperator

    7278 Posts

  • #3, by gregor-muellerWednesday, 13. October 2021, 13:40 2 years ago
    Thank you for your answer. It led to me checking out a few more things but ultimately I am not getting anywhere. I set the timing of the random animation to a very short interval so when there is a short break in the dialog it gets triggered and plays. But whenever another character is speaking it just won't go. I tried everything I could think of: even inserted the character into another scene and looked what happened there - nothing. It is at the moment the character the player controls but I checked if this makes any difference and it did not. It is playing sound when the animation is playing but I checked if it works without the sound - nothing. Rebuilt the scene making sure it's a Scene and not a Menu - nothing. Took everything else out of the scene, all other animations etc. - nothing. I feel like I am going crazy here.
    I even tried with an action that would trigger the animation after a random pause. But apart from it being not a beautiful solution it also messed up the speaking animation because it would sometimes trigger within the speaking animation...
    I am playing around a lot with the visibility of the characters, in the speaking animation as well as in the random animation. Does that make any difference? (And yes, I made sure the visibility is not just zero when the random animation gets triggered).
    Is there any way to check when random animations should get triggered (I know, there is probably no way to check something that doesn't happen).

    Newbie

    20 Posts

  • #4, by afrlmeWednesday, 13. October 2021, 15:31 2 years ago
    It's possible to listen out for when animations start/end as there's event listeners for that, but they require scripting to use.

    It doesn't make sense for the random animations belonging to an npc to be prevented from playing just because the current character starts speaking - technically when a display text is triggered it's actually triggering a cutscene event, but random animations should still be played in the background to my knowledge. It could be a bug with the current build. I'll ask Simon about it.

    Imperator

    7278 Posts

  • #5, by gregor-muellerWednesday, 13. October 2021, 20:15 2 years ago
    That would be good because I really am going mad soon smile
    I really can only imagine a bug at this point. Or something really basic that I am not seeing.

    Newbie

    20 Posts

  • #6, by gregor-muellerFriday, 29. October 2021, 18:29 2 years ago
    This is still bugging me so I set up a completely new game with just one scene with two characters, one having a random animation that would trigger very often and another character speaking for a long time and then pausing for a long time. Whenever the second character speaks the first ones random animation would fail to trigger. So I am now fairly positive that this has to be some kind of bug. Is anyone able to recreate this bug?

    Newbie

    20 Posts

  • #7, by SimonSTuesday, 02. November 2021, 23:45 2 years ago
    It's actually behaviour that is written in the engine. If there's a text playing there are no random animations triggered. To me it would make sense that way, because you probably want your characters to listen. If you use background texts this won't happen.

    Thread Captain

    1580 Posts

  • #8, by esmeraldaWednesday, 03. November 2021, 09:24 2 years ago
    It's actually behaviour that is written in the engine. If there's a text playing there are no random animations triggered. To me it would make sense that way, because you probably want your characters to listen. If you use background texts this won't happen.
    I would prefer the npcs would carry on with their random animations. Is there no way this chould be changed?

    It is easy to stop them doing random animations (by changing the alignment or the outfit) but it is not practical to change the texts of the player character to background texts to have the npcs perform the random animations. 
    (Imagine a typical pc that is commenting on every hotspot in a scene. Displaying that as background text would mean it is not skippable. )

    Key Killer

    508 Posts

  • #9, by afrlmeWednesday, 03. November 2021, 11:52 2 years ago
    I was going to suggest maybe adding an option so that the player can enable/disable random animations for characters as needed.

    Technically you can skip background texts using the script I wrote & shared ages ago, but I agree that it would not be a very practical solution in terms of everything else you would need to do to make the action blocks iterate correctly, & to prevent the player from being able to interact with other things or walk around while the text is shown, or to be able to skip the texts by left clicking or pressing a specific keyboard key, etc. etc.

    Imperator

    7278 Posts

  • #10, by gregor-muellerSaturday, 06. November 2021, 07:15 2 years ago
    I think to have the option would really help. In general I agree with Simon but I have more than one NPC character on the screen most times and in this case it doesn't make much sense that everyone on the scene stops doing what he's doing because the player talks with one of them...
    But for now I'll look into the background text workaround.

    Newbie

    20 Posts

  • #11, by esmeraldaSaturday, 06. November 2021, 14:51 2 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

    508 Posts