by DST » Mon Jun 16, 2008 12:20 pm
In Draw Actor>
textNumber=player1.hp;
Now lets make it a complete variable counter, like this:
1. take your text actor and clone it as many times as you need for whatever you want a meter of.
2. In its draw actor, put this:
switch(cloneindex){
case 0:
textNumber=player1.hp;
break;
case 1:
textNumber=any variable you wish;
break;
case 2:
same thing
break;
}
now you make as many meters as you want, and access them all from one single script.
As for freezing, its easier with player1 than it is with enemies.
Player1>collision>afterfreeze
directional_velocity=0;
EventDisable("Event Actor", EVENTKEYDOWN);
CreateTimer("Event Actor", "freezetimer", ms); //where ms is the length of the timer, in ms.
Then on player1>freezetimer
EventEnable("Event Actor", EVENTKEYDOWN);
For an enemy, you'll have to disable whatever make the enemy do stuff.
If its on a path, you have to ChangePath("Event Actor", "none", BOTH_AXIS);
if its running on timers, you have to use DestroyTimer("timername");
if it has velocity, direction_velocity=0;
Also, if its a sidescrolling game with gravity, you'll have to disable gravity temporarily too.
usually, in my draw actor, i have yvelocity+=gravity;
Then i set gravity to 1, and i can set it to 0 any time i need.