1) When an animation is over (=it has reached its end frame), how can I restart that animation from start frame?
Background: Before a NaliFruit is picked up, it runs through the animations "root", "grow" until "Waver" - so far so good. But if it is picked up, all next respawned NaliFruits don't run any animation, they are fully grown at the moment of spawn. If I don't load MonsterHunt, it works as expected: a new spawned NaliFruit runs through all animations.
2) How can I determinate the "normal" time between the start and end frame of an animated Mesh?
Background: It would be a nice feature to change the grow rate depending on environment. For example it could grow faster in water and slower in lava. For this feature to implement I have to know the time between start and end frame. But this point is really optional.
For your convenience some lines of the stock NaliFruit.uc code:
Spoiler
Code: Select all
class NaliFruit extends Health;
...
#exec MESH SEQUENCE MESH=NaliFruitMesh SEQ=Root STARTFRAME=1 NUMFRAMES=1
#exec MESH SEQUENCE MESH=NaliFruitMesh SEQ=Grow STARTFRAME=1 NUMFRAMES=26
#exec MESH SEQUENCE MESH=NaliFruitMesh SEQ=Waver STARTFRAME=27 NUMFRAMES=2
...
auto state Pickup {
function Timer() {
HealingAmount += 1;
SetTimer(0.5,True);
}
...
Begin:
PlayAnim('Root');
FinishAnim();
HealingAmount = 0;
Sleep(FRand()*3);
SetTimer(8.5,False);
PlayAnim('Grow',0.036);
FinishAnim();
SetTimer(0.0,False);
LoopAnim('Waver',0.1);
}