actor arrays, for instance actor.0 actor.1 actor.2 etc.
Posted: Fri Mar 23, 2007 1:16 am
I would like to cycle through actors creating or destroying them based upon an array of 25 actors. I created an array of 25 actors using the array function. I then created a button that when I press it I want to destroy a certain number of them based on their preset values.
For instance when I click on a button labled 'lever 1' A script is called that does the following:
int i;
for(i=0;i<25;i++)
{
if(actornamegoeshere.i.alive == 1)
DestroyActor("actornamegoeshere.i");
}
However only the first actor is ever destroyed. It seems the .i method doesn't work. Any ideas on how to cycle through an array of actors?
Much Thanks.
MrScience101
For instance when I click on a button labled 'lever 1' A script is called that does the following:
int i;
for(i=0;i<25;i++)
{
if(actornamegoeshere.i.alive == 1)
DestroyActor("actornamegoeshere.i");
}
However only the first actor is ever destroyed. It seems the .i method doesn't work. Any ideas on how to cycle through an array of actors?
Much Thanks.
MrScience101