get the variables in more than one actor

Non-platform specific questions.

get the variables in more than one actor

Postby boxmanbr » Sun Apr 19, 2009 3:10 pm

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
Caixa (#8901) on Discord.
boxmanbr
 
Posts: 20
Joined: Sat Apr 12, 2008 12:14 am
Score: 0 Give a positive score

Re: get the variables in more than one actor

Postby Kalladdolf » Sun Apr 19, 2009 3:31 pm

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];
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: get the variables in more than one actor

Postby jimmynewguy » Sun Apr 19, 2009 3:35 pm

EDIT: |
srry---V
forget this
Last edited by jimmynewguy on Sun Apr 19, 2009 3:44 pm, edited 1 time in total.
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: get the variables in more than one actor

Postby boxmanbr » Sun Apr 19, 2009 3:51 pm

but me uses a thing that clone the humans, named human_cloner, me click on the human_cloner to create a human :o
Caixa (#8901) on Discord.
boxmanbr
 
Posts: 20
Joined: Sat Apr 12, 2008 12:14 am
Score: 0 Give a positive score

Re: get the variables in more than one actor

Postby Kalladdolf » Sun Apr 19, 2009 3:56 pm

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.
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: get the variables in more than one actor

Postby skydereign » Mon Apr 20, 2009 6:43 am

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


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron