Ok, so I implemented the script and there is animation, but it is not what I expected LOL.Animations, without it every unit would have exactly same animation steps, and it will look very fake.
Edit: I modified the drawingRoutine to a 4 and it looks a lot better...
I need some help with what the different lines in the script do...
What exactly is being desynced?
offsetmod temp 11 0 8; #desync animation of different units
Where is anim_frame coming from?This is parameter to this script, there is predefined list of names that store specific script data, like:
add temp anim_frame;
What is wavegen_saw doing?Exe its self is documentation, when you set verbose logging user option then it will dump all script metadata to log.
wavegen_saw temp 8 8 7;
Explain this...
mul sprite_offset 8;
add sprite_offset 8;
add sprite_offset temp;
I cannot find any documentation on what these functions do, I only found a documentation thread with examples.
I copied the scripted verbatim and changed the drawingRoutine after seeing Yankes reply.As far I know there is no "bottom", it try animate whole whole unit and because "parrot" and your unit have different layout of sprites in spritesheet you get this result.
It looks better, but can it be changed to only allow the bottom to be animated?
- type: FLOATER_ARMOR0
drawingRoutine: 1
scripts:
selectUnitSprite: |
var int temp;
var int walking;
unit.isWalking walking;
if and eq walking 0 eq blit_part BODYPART_TORSO;
unit.getId temp;
offsetmod temp 11 0 8; #desync animation of different units
add temp anim_frame;
wavegen_saw temp 5 5 5;
mul sprite_offset 5; # `drawingRoutine: 1` have blocks of 5 frames per direction, we convert `0,1,2,...` to `0,5,10,...` offsets
add sprite_offset temp;
add sprite_index 8; #moving animations frames starts after 8 standing one
add sprite_index sprite_offset;
else;
add sprite_index sprite_offset;
end;
return sprite_index;
Example of FLOATER animation.