Home   Help Search Login Register  

Author Topic: Script templates Load/Unload etc.  (Read 2842 times)

0 Members and 1 Guest are viewing this topic.

Offline eegore

  • Members
  • *
Script templates Load/Unload etc.
« on: 01 May 2010, 03:36:10 »

 I'm not sure if this is the correct place to ask but I can't find the old recruitment info.

  I was wondering if anyone had scripts for ARMA for loading/unloading groups from helos and vehicles.

  I've tried to make my own but I always screw them up somehow, for instance my groups wont always board a helo, or they get in a truck ride to a town then never get out. 

  My idea is to create scripts that trigger within a certain distance of an object (game logic, unit etc.)  I figure I could just have a spot where I insert the group or units name and then call the script on the init line of the helo or truck or whatever. 

  Im not too creative with this stuff so any suggestions about how to call extraction scripts etc. would be helpful.


  Thanks

Offline 00toks

  • Members
  • *
Re: Script templates Load/Unload etc.
« Reply #1 on: 02 May 2010, 00:15:33 »
I have the same problem with my helicopter script, noone is helping me  :no:

Offline eegore

  • Members
  • *
Re: Script templates Load/Unload etc.
« Reply #2 on: 04 May 2010, 01:06:49 »

  Yeah I was hoping someone already used a script to load/unload units that I could just use.  I'd put in my own unit names etc. in place of what they use.  I looked in the depot but theres nothing group/helo specific.


Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Script templates Load/Unload etc.
« Reply #3 on: 04 May 2010, 14:58:38 »
As I mentioned in 00toks thread...
Try using the AddWaypoint command  from the comref combined with the SynchronizeWaypoint command at each desired location.

Offline eegore

  • Members
  • *
Re: Script templates Load/Unload etc.
« Reply #4 on: 07 May 2010, 20:59:38 »

  What I have is nowhere near as complex.  I place a group on the map "grp3" and have them stand around.
 
  When I fly near them I have a trigger with the following:

Con:  (p1 distance grp3) < 30
Activ:  [] execVM "heloLoad.sqf"

  The script reads:

{_X assignAsCargo p1} forEach units grp3;
(units grp3) orderGetIn true;

  This makes them load in the helo most times.

  Then to unload them I have a distance trig by the landing zone. 

Con:  (leader grp3) distance LZ1 < 10
Activ: (units grp3) orderGetIn false

  Sometimes they get out, sometimes not.  I then have a second trig on a 10 second timer that tells the group to getpos to a game logic. 

  It seems like theres a more efficient way to do this by calling scripts, and I don't know where the waypoint synchronization would be since I have no waypoints. 



Offline eegore

  • Members
  • *
Re: Script templates Load/Unload etc.
« Reply #5 on: 12 Jun 2010, 15:35:35 »

  So I still have trouble getting groups to reliably exit a chopper and get into a truck.

  The ordergetin false  command seems to be the problem but Im not sure.  Im activating it through triggers and a script but both methods result in the men staying in the chopper a lot of the time.  So I have to land, shoot them in their seats then continue the mission.

  I have no waypoints as the pilot so I don't have wp's to synchronize for the groups I pick up as uggested before. 

  I can't find a mission that uses a disembark script I can alter, does anyone have any suggestions? 

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Script templates Load/Unload etc.
« Reply #6 on: 12 Jun 2010, 16:35:29 »
You don't really need any script for that..

Instead of (units grp3) orderGetIn false try
Code: [Select]
{_x action ["eject",(vehicle _x)]} forEach (units grp3)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline eegore

  • Members
  • *
Re: Script templates Load/Unload etc.
« Reply #7 on: 15 Jun 2010, 11:07:44 »

  Thanks for the reply. 

  The reason I haven't used this command is that the group will all jump out at the same time, often times to their death if I dont fly in really low to the lz.  Ive been using a repeating distance trig on multiple LZ's to order men out of the chopper so if I use a distance trig of 20m from the helopad the group jumps out 20m above the ground. 

  I put a timer on it so I hav enough time to land but in my Nam missions I have to sit there getting shot at waiting for the timer to expire instead of my men disembarking when I touch down. 

  If I use the ordergetin false they at least stay in the chopper until it touches the ground.  I just cant figure out why the command is hit and miss.  Sometimes they get out, sometimes not and I can't figure out why. 

 


Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Script templates Load/Unload etc.
« Reply #8 on: 15 Jun 2010, 14:20:31 »
I myself on the other hand have never ever been able to get orderGetIn to work at all (the way I have assumed it should work) :P

One thing you could try is to use "getout" instead of "eject" :dunno:, and you can loop it through the occupants with something like
Code: [Select]
for [{_i=0},{_i<(count (units _grp))},{_i=_i+1}] do {
    _unit = _units select _i;
    _unit action ["eject",(vehicle _unit)];
    sleep (0.5+(random 2));
};


One thing that might be affecting the orderGetIn you're using is that you have to unassign the cargo or otherwise they might not get out or wanna get back in once out :dunno:
Code: [Select]
{_x assignAsCargo p1} forEach units grp3;
{unassignVehicle _x} forEach units grp3;
(units grp3) orderGetIn true;
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline eegore

  • Members
  • *
Re: Script templates Load/Unload etc.
« Reply #9 on: 16 Jun 2010, 06:26:52 »
  I'll try some of what you suggested.  

  I use the orderGetIn like this:

{_x assignasCargo helo1} foreach units grp1; (units grp1) ordergetin true;

  I put that in a trig or a script.  They seem to load up most the time.  

  Any ideas on how to make a radio trigger that ejects all cargo in my chopper?  That would help when things get jammed up.
« Last Edit: 16 Jun 2010, 13:32:14 by eegore »