Jump to content
Sign in to follow this  
barbolani

Spawn Planes / Choppers dynamically on Airports

Recommended Posts

Dear all,

I'm working on spawning templates for almost anything interesting in Altis. Similar to what I've made in Arma 3 Antistasi.

This time, I want to do something different. In Antistasi I had a database with predefined positions on each base and the airport.

I'm trying to automate this.

In bases are more or less ok, I just findemptyposition, vehicle spawn in some messy way but it's ok.

But that's not good in airports, as you cannot see a bunch of choppers and planes spawned with nosense at all.

The solution in cities is simple: use roads as reference, nearroads, roadsconnectedto angles and ta dah, parked vehicles.

But runways AFAIK are not roads, isn't it?

Any ideas?

Share this post


Link to post
Share on other sites

Guys, I'm living the typical "scripter - glory - - I'm the fucking wonder - moment", just with this magnificient piece of code:

_buildings = nearestObjects [_posicion, ["Land_LandMark_F"], _size / 2];

_pos1 = getPos (_buildings select 0);

_pos2 = getPos (_buildings select 1);

_ang = [_pos1, _pos2] call BIS_fnc_DirTo;

_pos = _pos1;

for "_i" from 1 to 5 do

{

_tipoveh = planesAAF call BIS_fnc_selectRandom;

_veh = createVehicle [_tipoveh, _pos, [],0, "NONE"];

_veh setDir (_ang + 90);

sleep 1;

_pos = [_pos, 20,_ang] call BIS_fnc_relPos;

};

bye!

Share this post


Link to post
Share on other sites

I'm trying this when I get home :) Having a completely ghost town International Airport, never feels right, and with the next mission that I have planned for my campaign, it would seem just plain wrong. I've tried the other Dynamic Airport script which uses some USAF planes too, however that doesn't last very long before the whole game CTD's. Having a big, live, active airport that the player flies into when they return to Altis would be primo. All I've done so far is just hidden planes in the editor and then show them (with their landat waypoint and a few others) when a trigger is hit, or else spawn them via a script to get them to come in to land.

I take it you're just putting that into a script and executing it, then adding waypoints after that?

Share this post


Link to post
Share on other sites

yes, from a marker with some size (_size variable) I pick a random plane from an array witg AAF plane types (planesAAF)

It's intended to use UPSmon on the airport, and planes are intended to be "decorative" plus if you destroy one, the AAF side looses them.

I don't recommend to use them with waypoints, cause the AI will mess up trying to get to the runway. If that's your plan, better create just one in a starting position in the runway, wait x seconds to ensure it takes off and then create another..

Share this post


Link to post
Share on other sites

Yeah I have found that basically if you start an aircraft on the ground and give it a waypoint, it seems to taxi by itself and take off, to get to that waypoint - even if the waypoint is right beside it. Doesn't seem to be a way of manually taxiing planes though e.g. getting them to stay put on the ground and move to a certain spot. To get the planes to stop in a certain place (e.g. to take on civillian passengers for example :D) I just use a setfuel 0 command, and then setfuel 1 command once passengers are aboard.

I guess having a script running that say, sleeps for 60 - 120 then spawns a new one in would work, especially if you give the plane waypoints that fly it around the island for a few minutes before landing again. Maybe have this inside a massive 'while player in thisList do' type trigger around the airport itself so it only happens when the player is nearby and notices it, might also help.

Share this post


Link to post
Share on other sites

Why don't you grab the taxiOff and taxiIn coordinates from the config? It's a weird array to work with [posi1x,pos1y,pos2x,pos2y etc] but it's saving cpu cycles instead of scanning for objects. :)

Cheers

Share this post


Link to post
Share on other sites
Why don't you grab the taxiOff and taxiIn coordinates from the config? It's a weird array to work with [posi1x,pos1y,pos2x,pos2y etc] but it's saving cpu cycles instead of scanning for objects. :)

Cheers

I think the main reason I don't use those coords is because I've never known about it's existance!!!!! :)

Please, can you givme a clue? I find nothing searching "taxiOff"

Share this post


Link to post
Share on other sites
I think the main reason I don't use those coords is because I've never known about it's existance!!!!! :)

Please, can you givme a clue? I find nothing searching "taxiOff"

_getarray = getarray (configfile >> "CfgWorlds" >> worldName >> "ilsTaxiIn");
_posarray = [];

for "_i" from 0 to (count _getarray - 1) step 2 do {

_posarray set [count _posarray,[_getarray select _i, (_getarray select _i + 1)]];

};

_posarray

This would return an array with all 2d positions from the TaxiIn config of the altis main terminal.

Secondary airfields are to be found here:

configfile >> "CfgWorlds" >> "Altis" >> "SecondaryAirports" >> "Airstrip_1" >> "ilsTaxiOff"

Cheers!

Share this post


Link to post
Share on other sites

uhm, not for the decorative purposes I meant but yes for spawning planes in the right place. Thanks man. I assume ilsTaxiIn is the spawnpoint, direction to ilsTaxiOff and go, isn't it?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×