PLEASE reply if you see any errors in the syntax!
Also if pssible, convert it to .sqf [which i cannot]Here is my method :
In this method, when you click "Join Me" on Action Menu, any Blufor units in the specified area around you will join you...
First Create Scripts :
checkingscript.sqs
changevariable.sqs
Create a
trigger in the editor, name it "
checker" [without ""]
Name : checker
Axis A and B : YOUR DESIRED AREA
Activation : BLUFOR , PRESENT
Condition : this
On Act : [nameofyourplayer] exec "checkingscript.sqs"
Note : You have to change "Blufor" in relation to your side.Use player in the [] if its an SP Mission...
=================================
checkingscript.sqs
_yourunits= count units group player
? _leaderman != player : exit
;exits if _leaderman is not the current player on the machine...
_leaderman=_this select 0;
#loop
? not (alive player) : exit
@startchecking
? {count untis group _x==0} : goto "morecheck"
? {count units group _x <= 2} : {[_x] join _leaderman} foreach checker
;any Blufor in the area will join player...
;you may need to add "foreach checker" behind "_x <= 2}"
~0.5
#morecheck
? count units group player == _yourunits : hint "No one joined your group.";goto "loop"
hint format ["No of units in your team : %1",count units group player]
~0.5
startchecking = false
goto "loop"
===============================
In your unit's[player's] init :
yourplayername addaction ["Join Me","changevariable.sqs"]
=====================================
changevariable.sqs
checker setpos getpos player
;moves trigger to player's position
~0.5
startchecking=true
;makes the script start the checking
exit
Feel free to report bugs...the script is not tested on my PC yet,just written for guy in BI Forums
http://forums.bistudio.com/showthread.php?p=1424848#post1424848