Page 1 of 1

panet name of event actor(clone)

PostPosted: Sat Oct 22, 2011 10:05 am
by Agusstosus15
is there a way to get a parent name of clone event actor?

Re: panet name of event actor(clone)

PostPosted: Sat Oct 22, 2011 10:08 am
by skydereign
Use the especial actor parent. So, in the case of the clonename of the parent, all you need is parent.clonename. You can use parent to change variables as well.
Code: Select all
getclone(parent.clonename);

Re: panet name of event actor(clone)

PostPosted: Sat Oct 22, 2011 1:47 pm
by Agusstosus15
so when i write
mystring[0]= getclone(parent.clonename)

mystring will get the name of parent of event actor?

Re: panet name of event actor(clone)

PostPosted: Sat Oct 22, 2011 2:11 pm
by lcl
Agusstosus15 wrote:so when i write
mystring[0]= getclone(parent.clonename)

mystring will get the name of parent of event actor?

Well, here you can't use getclone() because it returns pointer to actor.
And you can't set strings with equation, you have to use strcpy() or something similar, like sprintf()

For setting mystring[0] to contain the current actors parent actors clonename, do this:
Code: Select all
strcpy(mystring[0], parent.clonename);

strcpy is shortening of string copy.
As you see, here we copy the parents clonename to mystring[0].

Did that help you? :)

Re: panet name of event actor(clone)

PostPosted: Sat Oct 22, 2011 2:46 pm
by Agusstosus15
it help me when I will be sure that is the name of parent of Event Actor
I mean when I clicked on clone and write code above i returns me a name of parent of actor I clicked

Re: panet name of event actor(clone)

PostPosted: Sat Oct 22, 2011 6:21 pm
by lcl
Yeah that's exactly what it does. :D

But if you want, you can change it to:
Code: Select all
strcpy(mystring[0], parent.name);

This is in the case there is no clones of the parent actor.

The first code returned the clonename which is name.cloneindex, like for example: myActor.0 while this code returns only the name, like: myActor

I wish I didn't make you confused.. :D

Re: panet name of event actor(clone)

PostPosted: Sat Oct 22, 2011 9:46 pm
by Agusstosus15
all clear, thanks :)