Page 1 of 1

get the variables in more than one actor

PostPosted: Sun Apr 19, 2009 3:10 pm
by boxmanbr
me put in a text with 00000, and with the "draw actor" in the text with a script with textNumber = human.level, but it only get the level from only 1 human, me wants that it get all human level variable, ex: textNumber = human.0.level + human.1.level + human.2.level... :o

Re: get the variables in more than one actor

PostPosted: Sun Apr 19, 2009 3:31 pm
by Kalladdolf
Global Code:
Code: Select all
int c[5];  //In this example there are five clones.

Draw Actor on one of the clones:
Code: Select all
if(cloneindex >= 0 && cloneindex <= 5)
{c[cloneindex+1] = health;}

Draw Actor on Text with 00000:
Code: Select all
textNumber = c[1]+c[2]+c[3]+c[4]+c[5];

Re: get the variables in more than one actor

PostPosted: Sun Apr 19, 2009 3:35 pm
by jimmynewguy
EDIT: |
srry---V
forget this

Re: get the variables in more than one actor

PostPosted: Sun Apr 19, 2009 3:51 pm
by boxmanbr
but me uses a thing that clone the humans, named human_cloner, me click on the human_cloner to create a human :o

Re: get the variables in more than one actor

PostPosted: Sun Apr 19, 2009 3:56 pm
by Kalladdolf
Then the array should be as big as you think there will be humans. Unfortunately you can't make an array without limit.
But this code should actually also work in this case.

Re: get the variables in more than one actor

PostPosted: Mon Apr 20, 2009 6:43 am
by skydereign
You can make an array that has no limit, but you need to use a wrapper system... If you are not ready to learn complex scripting, just make it a big number.