Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Play animation-based Actions as animations
- - By Marky [de] Date 2016-01-09 12:28
This is just a workaround that I use in a local project. I have a structure with several entrances, which require the mesh to play several animations. I wanted to define all these in the ActMap, so I created a few functions for playing actions and calling their calls as defined in the ActMap in an animation slot. If other people need this, too, then it would probably be better to extend SetAction with a parameter for the animation slot (if you want to use a non-default slot).

I hereby license the file Script_Animations.c under the CC-BY license
Attachment: Script_Animations.c (3k)
Parent - - By Clonk-Karl [us] Date 2016-01-11 05:06

> If other people need this, too, then it would probably be better to extend SetAction with a parameter for the animation slot (if you want to use a non-default slot).


The animation slot for ActMap animations (slot 0) has some handling at the moment, in particular it's not possible to modify that slot with the script functions PlayAnimation or StopAnimation. If we do what you suggest we might want to rethink that logic.
Reply
Parent - - By Marky [de] Date 2016-01-17 07:40
Are there good reasons not to do it? Without analyzing anything I would think that there could be problems if you play an animation in slot 0 and then start an action in slot 0, because what would be the result then?
Parent - By Clonk-Karl [us] Date 2016-01-18 04:08

> Are there good reasons not to do it?


No strong technical reasons. I just didn't want to answer the kind of questions you raised; also: what happens when using StopAnimation on slot 0 when the animation was started by the ActMap and not by PlayAnimation? Savegame serialization might also need to be changed, I think that slot 0 is currently not saved with all the other animations but instead it is recovered from the ActMap on savegame load.
Reply
Up Topic Development / Developer's Corner / Play animation-based Actions as animations

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill