Loading AI units into UH1H gunner position

orcthrasher

Well-Known Member
I've got some AI units loading into a chopper to do patrols, and to ferry players around.

The problem is, I'm spawning 3 troops, and I want one in each door gunner position. I can't get the second one to go as the gunner, however. He always loads in the back.

I'm assigning all 3 troops as commander and gunner; and I've tried assigning one as gunner and one as commander. One always loads into commander, and the other one just won't take the door gunner slot.

Only way i've found is to fill the chopper with AI, and then one ends up in there.

But that doesn't work, because I have to set the combat to YELLOW for them to shoot, and if there are any troops in the chopper, the fucking thing will land and let them out to fight.

thoughts?
 
every position in mission editing with AI is a command.
You have to tell which unit enters which position.

Each vehicle is assigned a postition in arma, so 1,2,3,4 etc..

Also set way points and keep it as "hold/open fire, engage at will".

for example in the unit name you could call your unit "gunner1"
for the vehicle call it "myheli"
in the init line.. "gunner1 action ["getInTurret", myheli, [1]"

which tells the ai to get in gunner postion 1.

1 being the postition and change it to which ever seat.
You can get the positions of the seats from the cfgvehicles from the pbo of the vehicle.
I forget which is which seat right now.

You could also use getingunner, getinpilot and many other specfic commands.

Hope that helps.
 
every position in mission editing with AI is a command.
You have to tell which unit enters which position.

Each vehicle is assigned a postition in arma, so 1,2,3,4 etc..

Also set way points and keep it as "hold/open fire, engage at will".

for example in the unit name you could call your unit "gunner1"
for the vehicle call it "myheli"
in the init line.. "gunner1 action ["getInTurret", myheli, [1]"

which tells the ai to get in gunner postion 1.

1 being the postition and change it to which ever seat.
You can get the positions of the seats from the cfgvehicles from the pbo of the vehicle.
I forget which is which seat right now.

You could also use getingunner, getinpilot and many other specfic commands.

Hope that helps.


This is tremendous!

I didn't even see the whole list of actions! I saw somewhere that the MoveIn(position) commands didn't work in MP, and they didn't seem to work for me.

Here's another question - I need H pads to land, but I don't want to edit my mission file. I put this in my code, because the mission.sqm file seemed to just be doing this.

Code:
//Create the helipads
  H_Cherno= createVehicle ["HeliHRescue", [6829.689, 2786.207, 0], [], 0, "CAN_COLLIDE"];
  H_Electro = createVehicle ["HeliHRescue", [10370.874, 2349.9211, 0], [], 0, "CAN_COLLIDE"];
  H_NEAF= createVehicle ["HeliHRescue", [12540.562, 12559.409, 0], [], 0, "CAN_COLLIDE"];
  H_NWAF= createVehicle ["HeliHRescue", [4968.4971, 9500.4346, 0], [], 0, "CAN_COLLIDE"];
  
  _aigroup addVehicle H_Cherno;
  _aigroup addVehicle H_Electro;
  _aigroup addVehicle H_NEAF;
  _aigroup addVehicle H_NWAF;
  
  //Store the pad locations, just for ease of programming
  _PosCherno = getpos H_Cherno;  //Cherno landing
  _PosElectro = getpos H_Electro;  //Cherno landing
  _PosNEAF = getpos H_NEAF;  //Cherno landing
  _PosNWAF = getpos H_NWAF;  //Cherno landing

I think it's working, because the pads are certainly there - but the chopper is just hovering. Does it really need to go into the mission file? it's just running a createvehicle script (I coped this from my sqm).
 
You can you moveincargo aswell yes.

IN your editor there will be "helipad invisible".
I put these in the mission file and set a waypoint for the AI to unload at this point.
Basically it should land, let cargo empty, then leave on another waypoint and so on.

I would look more at mission editing with the waypoints, it will be much easier to work with if you are new to it all.

It would be a simple as making a waypoint 1 to >> transport unload at helipad >> waypoint 3 fly off, and repeat/cycle or delete the vehicle.
 
Do you know of any method to add pads to the map without the editor? I made a mission file to get the code for the pads, but I'd really rather not bake them into the mission.

The server is my friends, and i've got roaming soldiers, bandits, civilians... all fighting players, and eachother, and killing (and being killed by) zeds. Thus far i've been able to do it entirely through scripts. So when I want to update my content, I send him my \scripts\ directory, and that's it.

He places vehicles and buildings on the map, new towns, new content like that. It'd be a pain to try and coordinate that with a single mission file.

It seems that since I can add the "HeliHRescue" pads through scripts the same way my mission file does, then I should be able to land on it. Do they have to be the invisible pads?

The raw code from my mission.sqf from the editor is
Code:
if (true) then
  _this = createVehicle ["HeliHRescue", [4968.4971, 9500.4346, 6.1035156e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_13 = _this;
  _this setVehicleVarName "H_NWAF";
  H_NWAF = _this;
  _this setPos [4968.4971, 9500.4346, 6.1035156e-005];
};

which I just condensed to:
Code:
 H_NWAF= createVehicle ["HeliHRescue", [4968.4971, 9500.4346, 0], [], 0, "CAN_COLLIDE"];


It all seems to work just fine - i can see the pad, and the chopper flys to it - it just doesn't land .
 
Back
Top