Jump to content
Sign in to follow this  
Dragster

Addaction question

Recommended Posts

I know how to add an action to object or unit.

this addaction ["call in cas", "cas.sqf"];

what i wonder is it possible add the addaction to a leader of a group? and if that leader die the next leader of the group take over the addaction option.

Share this post


Link to post
Share on other sites

Something along the line of;

Set Trigger to Repeatedly

Condition: !alive leader groupname

Activation: leader groupname addaction [etc.]

Not sure if that is the best way to do it but it was the first thing that came to my mind. You might need a small delay between the condition and the activation though.

Edited by Jakerod

Share this post


Link to post
Share on other sites

fully possible in many different ways, just keep track of the leader and then add it to the new leader upon death.

while {({alive _x} count units groupname) != 0} do {
_leader = leader groupname;
_id = _leader addAction ["call in cas", "cas.sqf"];

waitUntil {sleep 1; !alive _leader};
_leader removeAction _id;
waitUntil {alive (leader groupName)};
};

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  

×