I'm not sure if it matters but the timer below was originally created with a delay of 250 ms and is being reassigned a new delay value programatically in the following code.
Collision Event Code:
- Code: Select all
if (statsUnit_1[1]<1) // Capping the maximum delay at 1 second
CreateTimer("Waypoint", "Delay Waypoint", statsUnit_1[1]*300);
else
CreateTimer("Waypoint", "Delay Waypoint", 1000);
Timer Code:
- Code: Select all
PlaySound2("data/Event_Accomplished.wav", 0.04, 1, 0);
ChangeAnimation("Waypoint", "Waypoint_Expand", FORWARD);
Speech.animpos+=1;
ChangeTransparency("Btn_Speech_Next", 0);
Animation Finish Event Code:
- Code: Select all
ChangeTransparency("Event Actor", 1);
ChangeAnimation("Event Actor", "Waypoint", FORWARD);
DestroyTimer("Delay Waypoint");