Globally effect an Actor-variable?

You must understand the Game Editor concepts, before post here.

Globally effect an Actor-variable?

Postby d-soldier » Sat Aug 18, 2007 7:12 pm

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?
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby metal_pt » Sat Aug 18, 2007 9:14 pm

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();
]v[eta[_ - Using GE since June, 15 2007
Currently using v1.3.8 Registered
metal_pt
 
Posts: 117
Joined: Sat Jun 16, 2007 12:57 pm
Location: Sintra, Portugal
Score: 2 Give a positive score

Postby d-soldier » Sat Aug 18, 2007 9:29 pm

Would that work for an actor-variable that is used by multiple actors?
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby metal_pt » Sat Aug 18, 2007 10:09 pm

Well... I really dunno. Never tested it.
]v[eta[_ - Using GE since June, 15 2007
Currently using v1.3.8 Registered
metal_pt
 
Posts: 117
Joined: Sat Jun 16, 2007 12:57 pm
Location: Sintra, Portugal
Score: 2 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest