Setting a custom actor variable for a clone

Non-platform specific questions.

Setting a custom actor variable for a clone

Postby lverona » Wed Mar 27, 2013 1:14 pm

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?
lverona
 
Posts: 221
Joined: Tue Apr 24, 2012 11:54 am
Score: 1 Give a positive score

Re: Setting a custom actor variable for a clone

Postby skydereign » Wed Mar 27, 2013 7:34 pm

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Setting a custom actor variable for a clone

Postby lverona » Wed Mar 27, 2013 8:03 pm

Super! Thanks =)
lverona
 
Posts: 221
Joined: Tue Apr 24, 2012 11:54 am
Score: 1 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron