Scripts / Basic help with animation functions?

Author
Message
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 25th Jan 2017 19:27
For some reason I don't seem to get the logic behind the animation functions in GG. There are SetAnimationFrames, PlayAnimation, StopAnimation, etc. and no matter what I try, they do absolutely nothing unless I do this:

And it only works once per entity.

Is there any tutorial available for the animation commands?
Gtox
3D Media Maker
10
Years of Service
User Offline
Joined: 5th Jun 2014
Location: South Africa
Posted: 25th Jan 2017 19:37
You could use LoopAnimation(e). g_Entity[e]['animating'] == 0 is a flag that prevents the animation from starting over and over again - you could use any variable for that.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th Jan 2017 19:48
Here is a snippet from the "carl" script in my LEM demo:


Obviously there is a lot more of it but you should get the idea.
Been there, done that, got all the T-Shirts!
PM
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 25th Jan 2017 20:59
Ok, got it now: One needs to create a statement that calls Stop-Set-Play functions, and the break or end the statement to make the animation run. Kind of counter-intuitive, since all the other functions stop when the caller statement breaks or ends...

Login to post a reply

Server time is: 2024-12-23 03:27:17
Your offset time is: 2024-12-23 03:27:17