Jump to content
Sign in to follow this  
SWEFIDDE

hi there i have HOw to join a group by trigger

Recommended Posts

hi there i have a script ho dont work for me! can somebody plz tell me whats wrong whit it? thx

ithe trigger follow the captives so they can walk around the city.

i set it for 10 mtrs round and call the trigger civ1 in the name field

then set the waypoints so the captives randomly walk around the city

in the leader of the captives i add this to the init field

Code Sample

civgrp = group this; removeAllWeapons this; this setCaptive true; [this] execVM "officers.sqf"

in the officers.sqf script

Code Sample

_civleader = _this select 0;

sleep 2;

_wPos = Position _civleader;

wp11 = 0;

sleep 2;

while {wp11 == 0} do

{

if !(alive _civleader) then {[_civleader] join grpnull; _civleader = leader civgrp};

sleep 1;

_wPos = Position _civleader;

civ1 setpos _wpos;

sleep 1;

};

Share this post


Link to post
Share on other sites

Theoretically your code should work, but even though a group leader may be dead, it normally takes quite a while until he's removed from the game, and not considered a group leader anymore. That's probably why your new leader assignment doesn't work.

Once you determine that the current leader is dead you should probably do a waitUntil the unit is actually gone, to circumvent this problem.

e.g.  waitUntil {isNull _civleader} or waitUntil {leader civgrp!=_civleader}

Share this post


Link to post
Share on other sites

dam shit i dont uderstand? i got this script from a guy so i have not made it and i dont understand how script works but if you can wrote it down and i just put it in to the game. thats would be ver nice

but thx anyway!

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  

×