Jump to content
Sign in to follow this  
fawlty

Trigger on act question

Recommended Posts

Making up some compositions and need this for a upcoming mission but can see more uses for it

The question,  is there a easier way to achieve this than

 

c1 setCaptive false; c2 setCaptive false; c3 setCaptive false; c4 setCaptive false; c5 setCaptive false; c6 setCaptive false; c7 setCaptive false;

 

C being individual civilians.

I'm trying to group the c1,c2 etc.

Share this post


Link to post
Share on other sites
for "_i" from 1 to 7 do { (missionNamespace getVariable ["c" + str _i, objNull]) setCaptive false };

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks KK, that certainly worked but from my very limited script knowledge the original makes more sense to me.

 

The key words here are 'limited knowledge'

 

Thanks again

Share this post


Link to post
Share on other sites

@fawlty,
It's something like this,

Quote

for "_i" from 1 to 7 do {	// count from c_ entities in your array (good thing you named them numerically)

 (missionNamespace getVariable ["c" + str _i, objNull])	// look for objects named "c+_i" in missionNameSpace

 setCaptive false }; //do this to each "c+_i"

 

 

Quote

the original makes more sense to me.

Perhaps at this stage but if you had to add more script the original method would get complicated very quickly.

Have fun!

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×