Two things about cloneindex

Non-platform specific questions.

Two things about cloneindex

Postby schnellboot » Tue Jan 04, 2011 6:11 pm

There must be something easier then this right?
Code: Select all
if(cloneindex==0)
{
    chosen=1;
}
if(cloneindex==1)
{
    chosen=2;
}
if(cloneindex==2)
{
    chosen=3;
}
if(cloneindex==3)
{
    chosen=4;
}
if(cloneindex==4)
{
    chosen=5;
}
if(cloneindex==5)
{
    chosen=6;
}
if(cloneindex==6)
{
    chosen=7;
}
if(cloneindex==7)
{
    chosen=8;
}
if(cloneindex==8)
{
    chosen=9;
}
if(cloneindex==9)
{
    chosen=10;
}
if(cloneindex==10)
{
    chosen=11;
}
if(cloneindex==11)
{
    chosen=12;
}


And also how do I acces the cloneindex from another actor?
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: Two things about cloneindex

Postby skydereign » Tue Jan 04, 2011 6:57 pm

Code: Select all
chosen=cloneindex+1;


Accessing the cloneindex of another actor you can use this.
Code: Select all
chosen = actorName.cloneindex+1;


But that only works with the lowest cloneindex actor. You can sometimes use the creator/parent/collide actor references.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Two things about cloneindex

Postby schnellboot » Tue Jan 04, 2011 9:16 pm

thanks!
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest