B@nditbe 0 Posted April 11, 2004 Hi all, i have a anoying problem, in my mission i use a simple chopper extraction script. But my problem is that the chopper will only pick up one team after its landed and then takes off. I have 3 teams of each 4 men, and i want the chopper picks em up all 3. For example this line is in the trigger when the chopper landed and waits until the team boards the chopper before takin off : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">chopper1 flyinheight 1.5; chopper1 land "get in"; [team,chopper1] exec "extraction.sqs"; Is there a way i can adapt this line so the chopper waits until team2 and team3 has boarded to ? Thx in advance Share this post Link to post Share on other sites
RED 0 Posted April 11, 2004 Could you post the script you are using here please? It could easily be modified to work with more than one team. RED Share this post Link to post Share on other sites
B@nditbe 0 Posted April 11, 2004 Ofcourse, its a script by Daddl. I would have asked himself if he wasnt on holiday now Extraction and insertion script or read the scripts here : Exctraction script <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;script checks if all members of _group are inside _chopper ; ;script by Joltan aka Daddldiddl - August 2002 ;Check my website for OFPR coop missions: www.gogodot.net/ofp.html ;This script was written for my 'Island Cleanup' map. ; ; ;If you use or modify this script for your own missions, please put a ;reference in your readme or the script header! ;---------------------------------------------------------------- ;Global Variable used: unitsin (string) - set to "true" later ;---------------------------------------------------------------- unitsin="false" ;---------------------------------------------------------------- ;define group & vehicle ;---------------------------------------------------------------- _group=_this select 0 _chopper=_this select 1 ;---------------------------------------------------------------- ;main loop checking for team members inside and outside vehicle ;---------------------------------------------------------------- #loop ;wait a bit ~5 ;create arrays team members and units in chopper _ugroup=+(units _group) _ngroup=count _ugroup ;count live team members outside _n=0 _unitsout=0 #looplivecount _unit=_ugroup select _n _n=_n+1 ?((vehicle _unit!=_chopper) and alive _unit):_unitsout=_unitsout+1 ?(_n<_ngroup):goto "looplivecount" ;All live team members in chopper? ?(_unitsout==0):goto "end" goto "loop" ;---------------------------------------------------------------- ;end script ;---------------------------------------------------------------- #end ;here I would unlock the next waypoint be toggling a trigger _chopper flyinheight 50 unitsin="true" exit Insertion script <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;script checks if all members of _group are outside _chopper ;_group is any group of units and _chopper any kind of vehicle ;it also checks if leader is already outside vehicle. After a certain time ;the script starts moving units outside the vehicle in case they didn't leave ;by themself. This way units won't get stuck in vehicles! ;You can define distance and angle relative to the vehicle, where the units ;should run to after getting out. ; ;script by Joltan aka Daddldiddl - August 2002 ;Check my website for OFPR coop missions: www.gogodot.net/ofp.html ;This script was written for my 'Find The Chopper' mission. ; ;If you use or modify this script for your own missions, please put a ;reference in your readme or the script header! ;---------------------------------------------------------------- ;define group/vehicle/time in seconds until units get moved out ;---------------------------------------------------------------- unitsout="false" _group=_this select 0 _chopper=_this select 1 _timetogetout=10 ;---------------------------------------------------------------- ;main loop checking for team members inside and outside vehicle ;---------------------------------------------------------------- _leaderout=0 #loop ;wait a second ~1 ;leader out? Already time to kick the lazy bastards out by force? ?((vehicle leader _group)!=_chopper):_leaderout=_leaderout+1 ?(_leaderout==_timetogetout):goto "forceexit" ;create arrays team members and units in chopper _unitsinvehicle=crew _chopper _vehiclecrew=(crew _chopper)-(units _group) _teamincargo=_unitsinvehicle-_vehiclecrew _nteamincargo=count _teamincargo ;Any team members left in chopper? ?(_nteamincargo==0):goto "end" goto "loop" ;---------------------------------------------------------------- ;Force units to leave _timetogetout seconds after leader ;---------------------------------------------------------------- #forceexit _odist=20 _oarc=-90 _vehiclecrew=(crew _chopper)-(units _group) #loop2 _unitsinvehicle=crew _chopper _teamincargo=_unitsinvehicle-_vehiclecrew _nteamincargo=count _teamincargo ?(_nteamincargo==0):goto "end" ;eject unit from chopper _unit=_teamincargo select 0 _unit action ["eject",_chopper] ~2 ;get position and direction of vehicle _vpos=getpos _chopper _vdir=getdir _chopper _edir=_vdir+_oarc ;calculate waypoint for unit _xcenter=_vpos select 0 _ycenter=_vpos select 1 _deltax=_odist * (sin(_edir)) _deltay=_odist * (cos(_edir)) _newy=_ycenter + _deltay _newx=_xcenter + _deltax _unit domove [_newx,_newy,0] goto "loop2"; ;---------------------------------------------------------------- ;end script ;---------------------------------------------------------------- #end ;here I would unlock the next waypoint be toggling a trigger _chopper flyinheight 50 unitsout="true" exit Greetz B@nditbe Share this post Link to post Share on other sites
T J 0 Posted April 12, 2004 You can use the IN command to wait until a certain unit or group is onboard. for instance, <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _ALLUNITS = (units group1) +(units group2) +(units group3) +(units group4) ;Now to wait till they are all aboard chopper #wait ~2 ? !("_x IN <CHOPPERNAME>" foreach groups):goto "wait" ;proceed or set condition to true here EXTRACT = TRUE That should work, and if you call it at the right time, then the game wont be waiting for dead units. TJ Share this post Link to post Share on other sites
toadlife 3 Posted April 13, 2004 Move the first line into the loop and dead units shouldn't pose a problem. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;Now to wait till they are all aboard chopper #wait _ALLUNITS = (units group1) +(units group2) +(units group3) +(units group4) ~2 ? !("_x IN <CHOPPERNAME>" foreach _ALLUNITS):goto "wait" ;proceed or set condition to true here EXTRACT = TRUE Share this post Link to post Share on other sites
B@nditbe 0 Posted April 13, 2004 Thx allot guys, so far it all works ! Damn fine scripters here Share this post Link to post Share on other sites