Jump to content
Sign in to follow this  
Paddy086

AI Land and load C-130J

Recommended Posts

Hello i need some help with a c 130j i need it to land on a runway and pick up the units and leave the runway is there any way of doing this please

Share this post


Link to post
Share on other sites

You'll need to use landAt combined with synched waypoints and triggers to make the C-130 actually stop.

Share this post


Link to post
Share on other sites

can you explane a bit more about how to do this please

Share this post


Link to post
Share on other sites

Read this:

http://forums.bistudio.com/showthread.php?t=87317&highlight=aircraft+taxi

and this:

http://forums.bistudio.com/showthread.php?t=95882&highlight=aircraft+taxi

and this:

http://forums.bistudio.com/showthread.php?t=99739&highlight=aircraft+taxi

As you can see people have problems with the C130 and in general getting AI crewed aircraft to stop. Some of these problems may have been fixed but the above should get you started.

I will have a go if I get time. Sounds like an interesting project!

What Arma version do you have? 2 / OA / both etc? and what airfield did you want to use?

Edited by PELHAM

Share this post


Link to post
Share on other sites

Hay Pelham

I have arma 1/2and OA but im working on maps in OA the current mission im working on is Zarabad the airfield is left of the the city

thanks for your input

Share this post


Link to post
Share on other sites

OK here is what I did. It's all been done before - if you search C130, C130 ramp, etc you will find posts. Kylania and Norrin have some good cargo and eject scripts. You will also find some HALO scripts to use with the static C130.

All done in the Editor but easy to script as well. I will do a scripted version of this if you need it.

Zargabad

1. Place your C130 on the map, North West-ish of the airfield - heading 180 degrees, name it h1, FLYING.

2. F2, Group, add a BLUFOR, US Army, Infantry, Rifle Squad near the hangars. Make sure they are well back from the taxiway or the C130 will stop and not proceed. Set one of the privates as PLAYER.

In the squad leaders init:

stick1 = group this;

C130 Positions: up to 26 crew and passengers.

See attachTo for cargo and vehicles.

3. WP-0

Add a MOVE waypoint for h1 between the C130 and the airfield with:

h1 landAt 0;

in the init. Set speed LIMITED - it's a small map.

see:http://community.bistudio.com/wiki/landAt

4.WP-1 add a C130 h1 MOVE waypoint away from Zargabad

(4a.WP-1 add a C130 h1 CYCLE somewhere else - will return you to the airfield)

The C130 will circle and approach from the south, land, taxi around and take off all on it's own with just that landAt command. To stop it to load troops add:

5. Trigger 1 - 20m x 5m across the taxi,waynear troops.

Anybody, Once

Cond:

h1 in thislist;

OnAct:

h1 setFuel 0; h1 animate ["door_1",1]; {_x assignAsCargo h1} foreach units stick1; (units stick1) orderGetIn true;

6. Trigger 2 (overlap with Trigger 1)

Anybody, Once, Countdown, timeoutMin=60, timeoutMid=60, timeoutMax=60.

Cond:

h1 in thislist;

OnAct:

h1 animate ["door_1",0]; sleep 5; h1 setFuel 1;

Notes: door_1 is the LHS side door. 60 seconds = delay before C130 starts taxi for take off - adjustable. h1 in thislist; the trigger can only be activated by this unit.

7. Synchronise Trigger 2 with WP-1

Will stop the WP becoming active until the trigger activates.

NOTE: Make sure there are no players, units, vehicles etc near the runway or taxiway. The C130 pilot will stop to avoid them, even if they are close to the wingtips. It is pre-programmed to pause near the hangers for a few seconds with landAt.

Edited by PELHAM

Share this post


Link to post
Share on other sites

Hay Pelham you rock. i have been messing around just getting the c130 just to land on the airfield i tryed using landat 0; but it never worked i think it is because i dident use a capital A in the text i did find this that dose work h1 land "LAND"; but both ways seam to work and do the same thing. Thank you for all your help. can i just ask is there a way of opening the back door so a car can drive in or is that going over board.

Share this post


Link to post
Share on other sites

Well to open the ramp is easy - you just can't use it. BIS don't do walk in vehicles. You can walk in the static C130 but it's stuck in a flying animation so can't be used on the ground. Also if you sit inside the C130 with the ramp open - it looks closed, unless you are right next to the door.

Ramp is in 2 halves so 2 animations:

to open ramp

h1 animate ["ramp_top",1];
h1 animate ["ramp_bottom",1];

to close ramp

h1 animate ["ramp_top",0];
h1 animate ["ramp_bottom",0];

C130 Animations

0 means closed, 1 is open for all - as above.

door_1

door_2_1

door_2_2

ramp_top

ramp_bottom

Cargo? Norrins script is the best!

look here:

http://www.armaholic.com/page.php?id=5893

http://forums.bistudio.com/showthread.php?p=1447841#post1447841

http://forums.bistudio.com/showthread.php?t=73630&highlight

The core of vehicle cargo is the attachTo command - read here:

http://community.bistudio.com/wiki/attachTo

All scripting here:

http://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA2

---------- Post added at 12:36 ---------- Previous post was at 11:22 ----------

Why not add a parachute drop to that mission?

Create a trigger activated by Blufor.

On Act:

nul = stick1 execVm "groupeject.sqf";

(Your group must be called stick1 - or edit that to name of your group.

put this in the squad/team leaders init, change groupname to whatever you want.)

groupname = group this;

save this to groupeject.sqf in the mission folder

{
 unassignvehicle _x;
 _x action ["EJECT", vehicle _x];
 sleep 1;
} foreach units _this;

When the C130 flies over the trigger they will parachute 1 AI per second.

Example of a script loop - it must have a sleep in it or the game will crash.

Edited by PELHAM

Share this post


Link to post
Share on other sites

Check out the downloads at Armaholic.com - scripts for almost everything there! They have great C130 ramp and cargo stuff - better than anything i could do.

Share this post


Link to post
Share on other sites

NP will do

One thing if i wanted the trigger to only work once touch down would this be correct

"Land" counttype thislist > 0

as i get it to fly over the airfield first and do not want to trigger it :)

Cheers

Share this post


Link to post
Share on other sites
NP will do

One thing if i wanted the trigger to only work once touch down would this be correct

"Land" counttype thislist > 0

as i get it to fly over the airfield first and do not want to trigger it :)

Cheers

No the "Land" referred to in that command is the class - ie Land vehicles.

Not a landing aircraft.

http://community.bistudio.com/wiki/countType

Scripting_Commands_ArmA2

CfgVehicles

You might get this to work:

Will check the height above terrain of the C130 every 3 seconds.

_heightchkr = {
   while {alive yourC130unit} do {
       sleep 3;
       _height = getPosATL yourC130unit;
   };
};
call _heightchkr;

Condition of your trigger:

yourC130unit in thislist && _height > 10;

Will trigger if C130 is there and value of _height is less than 10m

Untested so not 100% sure this would work.

Another method would be to have a unit in cargo when the C130 passes over the airfield the 1st time then remove him for the landing when the landing instruction is issued.

Your trigger condition might be:

C130 in thislist && !(unit in thislist);

Edited by PELHAM

Share this post


Link to post
Share on other sites

And for that useless comment you had to dig out an 6 month old thread?

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×