Jump to content
Sign in to follow this  
Thats_Life 2.0

Setdamage to groups?

Recommended Posts

Hai,

Really can't find the solution. Very frustating, maby a very stupid question and need some sleep, but... :butbut:

I have a group in the editor. I named the teamleader squad1.

I want to set the damage to 1.0, but then only the teamleader dies.

I tried diffent things with group function in script and editor, but can't get it to work.

Anyone knows something...

Share this post


Link to post
Share on other sites
{_x setDamage 1} forEach squad1;

Share this post


Link to post
Share on other sites

Maybe there is some google translate issues going on here but, here goes.

I understand you have a group wich you want to setDammage 1 to all members of group.

You have a teamleader named squad1, and not the group.

In that case you need to use:

{_x setDammage 1} foreach units group squad1;

Wiki info on foreach: foreach

Edited by Demonized

Share this post


Link to post
Share on other sites

Demonized is right; I read it as the group is called squad1. Since you named the leader of the group squad1, his solution is the correct one. :)

Share this post


Link to post
Share on other sites

Hello i know its oftopic but just a quick question

Im currently trying to understand scripting what does the _x stand for?

{_x setDamage 1} forEach squad1;

_ Underscore means local varible??

Cheers for any help :)

Share this post


Link to post
Share on other sites

_x is a special variable, which is used, for example, in that foreach loop. The loop goes through each member of the given array and automatically assigns the current member to variable _x.

Yes, underscore means it's a local variable.

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  

×