Animationen für verschiedene Outfits

  • #10, by OgniTuesday, 24. September 2013, 16:21 8 years ago
    I have no experience with LUA but am willing to learn (after all that's why I'm doing this little project of mine). I would like for Alex to maybe comment on this too, just so I know if this is something they plan to adress in a future update.

    Newbie

    11 Posts


  • #11, by afrlmeTuesday, 24. September 2013, 17:26 8 years ago
    Ok I've pondered on what you are wanting to do a wee bit & here is my simple global solution...

    -- let's create a global function which automatically locates current character & their outfit & then plays the assigned animation
    function playCharAnim(anim)
    tblCharAnim = {} -- let's create an empty table
    tblCharAnim["_temporary_"] = "" -- let's set the table as temporary table
    tblCharAnim["anim"] = getObject("Game.GameCurrentCharacter.CharacterCurrentOutfit.OutfitCharacterAnimations[" .. anim .. "]") -- stores the animation into a variable which we can use for the startAnimation function
    -- * break * --
    startAnimation(tblCharAnim["anim"]) -- will play the assigned animation
    end
    1
    2
    3
    4
    5
    6
    7
    8
    9


    this is simple to use:
    1. copy the script above into the script editor & set as a definition script.
    2. you should name all similar animations for each outfit the same: example: anim_take
    3. it's a good idea to join names together with _underscore as opposed to leaving spaces.
    4. to execute the script you need to use the "execute a script" action part & inside of this add:

    playCharAnim("animation_name")
    1
    2


    -- example...

    playCharAnim("pick_up_item_bottom_right")
    1
    2
    3
    4


    the animation name must be wrapped in either "speech/quotation marks" or in 'apostrophes' & the names are case sensitive.

    hope this helps?

    P.S: the dev & beta builds are a lot more bug free & stable than 3.7.1...
    the beta builds have been rewritten practically from the ground up (almost) - few kinks that they need to iron out first mind but I've not had any issues with animations etc in the dev builds, thus far.

    Imperator

    6928 Posts

  • #12, by OgniWednesday, 25. September 2013, 06:17 8 years ago
    Thanks a lot. I'm at work right now but I hope I will find the time to test this tonight, latest on the weekend.

    Once again I want to express my gratitude for helping me out here, thank you very much!!

    Newbie

    11 Posts

  • #13, by afrlmeWednesday, 25. September 2013, 11:50 8 years ago
    no problem I forgot to add that: if you don't want to use called by other actions for this, that you could execute the function via the last frame of each animation (as required) - I'm not 100% sure if actions created inside of individual animation frames are executed immediately or not so you may need to add an additional (blank) frame to the end of the animations in which to execute the function.

    I'll test it out later on the day.

    Imperator

    6928 Posts

  • #14, by AlexSaturday, 05. October 2013, 18:08 8 years ago
    If you call another action it will be executed in parallel. In your case you added a pause actionpart but no one knows if this will be accurate. To make sure it always works you have to check if the animation is finished and then proceed. e.g. this could be done this way (pseudo code):

    set condition 'animation finished' to false
    call action 'benutzen start'
    if 'animation finished' == false then
    pause 1 msec (makes sure action is paused for now and main loop is continued)
    goto action part #3 (if statement)
    end if
    play sound
    change condition ...
    call action 'benutzen stop'

    in the action 'benutzen start' you must set 'animation finished' to true at the end.

    Great Poster

    378 Posts

Write post