Page 1 of 1

Setting a custom actor variable for a clone

PostPosted: Wed Mar 27, 2013 1:14 pm
by lverona
When I create an actor, I can set its actor variables in Create Actor code.

Two questions here.

1. If I want to set those variables AFTER the fact it was created, how do I access a particular clone's actor variables without knowing its cloneindex?
2. If I delete all clones of an actor, does the cloneindex get reset, so that when I create clones anew, the cloneindexes will start from 0 again?

Re: Setting a custom actor variable for a clone

PostPosted: Wed Mar 27, 2013 7:34 pm
by skydereign
lverona wrote:1. If I want to set those variables AFTER the fact it was created, how do I access a particular clone's actor variables without knowing its cloneindex?

Depends on when this is. If it is still in the event that created it, it's easy. Just use actorName.var, as after the CreateActor, the default struct points to the newest clone. Otherwise, you'll need some way of recalling which clone you mean. For instance you could use a timer, if it is always a certain time after the actor is created.
lverona wrote:2. If I delete all clones of an actor, does the cloneindex get reset, so that when I create clones anew, the cloneindexes will start from 0 again?

Yes. CreateActor creates the highest indexed clone, so it takes the current highest, and increases that by one. If all clones were deleted, it would therefore create clone zero.

Re: Setting a custom actor variable for a clone

PostPosted: Wed Mar 27, 2013 8:03 pm
by lverona
Super! Thanks =)