panet name of event actor(clone)

Non-platform specific questions.

panet name of event actor(clone)

Postby Agusstosus15 » Sat Oct 22, 2011 10:05 am

is there a way to get a parent name of clone event actor?
Agusstosus15
 
Posts: 59
Joined: Sun Oct 09, 2011 7:59 pm
Score: 0 Give a positive score

Re: panet name of event actor(clone)

Postby skydereign » Sat Oct 22, 2011 10:08 am

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

Re: panet name of event actor(clone)

Postby Agusstosus15 » Sat Oct 22, 2011 1:47 pm

so when i write
mystring[0]= getclone(parent.clonename)

mystring will get the name of parent of event actor?
Agusstosus15
 
Posts: 59
Joined: Sun Oct 09, 2011 7:59 pm
Score: 0 Give a positive score

Re: panet name of event actor(clone)

Postby lcl » Sat Oct 22, 2011 2:11 pm

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? :)
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: panet name of event actor(clone)

Postby Agusstosus15 » Sat Oct 22, 2011 2:46 pm

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
Agusstosus15
 
Posts: 59
Joined: Sun Oct 09, 2011 7:59 pm
Score: 0 Give a positive score

Re: panet name of event actor(clone)

Postby lcl » Sat Oct 22, 2011 6:21 pm

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
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: panet name of event actor(clone)

Postby Agusstosus15 » Sat Oct 22, 2011 9:46 pm

all clear, thanks :)
Agusstosus15
 
Posts: 59
Joined: Sun Oct 09, 2011 7:59 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest