Page 1 of 1

Globally effect an Actor-variable?

PostPosted: Sat Aug 18, 2007 7:12 pm
by d-soldier
I've setup a variable to reset collision-regions which spawn enemies (again) if the player dies and starts back at the last checkpoint, and since each one has the "reset" variable (actor variable) I was wondering if there was a way to globally reset every actor with this variable, rather then having to manually set each one's back to 0 when the player dies...? Did that make sense?

PostPosted: Sat Aug 18, 2007 9:14 pm
by metal_pt
Well, you can always create a function that do exacly that.

In global code:
Code: Select all
void resetvars()
{
    var1=0;
    var2=0;
    var3=0;
    varx=0;
    vary=0;
}


Than you have just to call it when you need it:

Code: Select all
resetvars();

PostPosted: Sat Aug 18, 2007 9:29 pm
by d-soldier
Would that work for an actor-variable that is used by multiple actors?

PostPosted: Sat Aug 18, 2007 10:09 pm
by metal_pt
Well... I really dunno. Never tested it.