How to play animation on next movement

  • #1, by darren-beckettTuesday, 16. June 2015, 14:22 5 years ago
    Hi,
    My character walks to a bench, they sit down, the outfit is then changed to the 'Sitting Outfit'.
    How can i now make sure to play the standing up animation before the character starts to walk away?

    Basically, I need to play an animation before the next Interface Walk Action is called.

    Great Poster

    351 Posts


  • #2, by afrlmeTuesday, 16. June 2015, 16:15 5 years ago
    Use an NPC version for the bench part & hide your playable character or send it to another scene. This way the character won't walk. Inside the left click mouse properties or via Lua script you could check if character is sitting / npc or something with an if query then if it is you could determine what it should do, such as: store the destination, play the standing up animation, then swap the npc character for the playable character.

    Imperator

    6842 Posts

  • #3, by darren-beckettWednesday, 17. June 2015, 14:29 5 years ago
    I cannot get this to work.
    I'm using a coin interface and therefore do not have a left click for the Walk command, i have the Walk command set as my standard command.

    Great Poster

    351 Posts

  • #4, by afrlmeWednesday, 17. June 2015, 15:16 5 years ago
    I meant in the mouse properties tab under the game tab.

    Long story short. Swap out the main character for an NPC character when sitting down. Then swap back to the playable character when they can walk again. There are multiple methods you could use to do this, so I'll leave that up to you to work out how you go about it.

    Imperator

    6842 Posts

  • #5, by darren-beckettThursday, 18. June 2015, 17:45 5 years ago
    I managed to do this in the Games/Mouse Properties/Left Click event:
    1) Store Cursor Position (curPos = getCursorPos)
    2) Save object
    3) If condition 'SittingDown' Play StandUpAnimation (and wait)
    4) Set command 'Walk'
    5) If object below cursor exists 'Execute command on saved object'
    else Execute char.CharacterDestination = curPos

    Great Poster

    351 Posts

  • #6, by afrlmeThursday, 18. June 2015, 18:02 5 years ago
    Nice one! Glad you got it sorted out. wink

    Imperator

    6842 Posts

Write post