game optimization - change animation speed with lua?

  • #1, by constantinFriday, 26. January 2018, 14:42 2 years ago
    i read about game optimiziation. i have three animations, all the same, but running at different speed. i would love to have only one and change speed with lua. how can i do this?

    Forum Fan

    167 Posts


  • #2, by afrlmeFriday, 26. January 2018, 14:56 2 years ago
    Technically the field is listed as not scriptable because the new value does not get stored inside of the save files. What you could do is create a value in the editor somewhere & then you could edit the first frame of the animation you want to control the delay values of & create some actions for it...

    if value "animation_speed" is '1'
     execute a script >

    Animations["example"].AnimationPause = 100
    1

    end if
    if value "animation_speed" is '2'
     execute a script >

    Animations["example"].AnimationPause = 200
    1

    end if
    if value "animation_speed" is '3'
     execute a script >

    Animations["example"].AnimationPause = 300
    1

    end if

    Values do get stored in save files, which means each time the animation starts or loops back to frame 1, that it will check the speed it should be playing at.

    P.S: I use a similar method (minus the values) for a faster walk speed when someone double clicks instead of single clicks.

    Imperator

    6767 Posts

  • #3, by constantinFriday, 26. January 2018, 16:15 2 years ago
    thanks! works perfectly.

    Forum Fan

    167 Posts

Write post