Jump to content
Sign in to follow this  
BelgarionNL

MP compatible: Illuminate Helipads for incoming heli's, HOW???

Recommended Posts

1: like the titel says i want the helipads illuminated when a player returns to base at night! domination/ insurgency and then go out out when the helicopter's are grounded!

2: searchlight that goes on around dark and just keeps turning 360 degrees! preferably with no AI because i want to also use it for INSURGENCY!

searched the forums but nothing popped!!!

i am sure the know how is floating around on this forum ^^

Belgarion

Edited by BelgarionNL

Share this post


Link to post
Share on other sites

1: same as 2 but use a GL to enter it and turn lights on/off at condition.

2: one way would be to set an AI in it, make him target or dowatch a empty H somewhere up in the sky (thats your angle), then when ready setPos him out of lights and delete him, then use setDir in a loop on the lights to have them rotate.

edit: maybe a gamelogic can do the same (its invisible)

edit: did not work with AI doTarget or doWatch.

Edited by Demonized

Share this post


Link to post
Share on other sites

Well if the helipad is always in one position you could simply spawn a flare, or IR strobe to it so you can find it at night.

If the helipad is deleted and respawned through a script, then you should find the script and add an if statement so that it will spawn a flare, or IR strobe on the helipad if it's to early or if it's to late

Example:

if (time < 6 || time > 19) then { put spawn code here };

Share this post


Link to post
Share on other sites

If you are still looking for ideas, Ei8ght's Camp Fortress template has lighted helipads. Maybe you can take a look at those.

Camp Fortress by Ei8ght

Edited by panther42

Share this post


Link to post
Share on other sites

sweet thx

---------- Post added at 11:42 PM ---------- Previous post was at 11:40 PM ----------

do you guys have any idea how i can spawn this heli at a +3 height??

this is the part that spawns a helicopter to the helipad

	if (_i == 8) then {
	_type = HELI2TYPE;
	_pos  = getPosATL helipad2;
	_dir  = getDir helipad2; 
	if (_pos distance startLocation > 100) exitWith {}; //avoid racing condition, where helipad is still at spawnPos

What ever i try it always spawns on the ground.....

Share this post


Link to post
Share on other sites

I don't see anything in that code that spawns anything!

If you want the helicopter flying... then you have to spawn it flying using "FLY"

_ride = createVehicle [_veh, _pos, [], 0, "FLY"];

createVehicle array

Share this post


Link to post
Share on other sites

this part sets the location:helipad2, its direction(same as helipad)

but now i need to add a extra line that spawns a helicopter 4 meter above ground where i made the helipad with pallets and containers!

Share this post


Link to post
Share on other sites
sweet thx

---------- Post added at 11:42 PM ---------- Previous post was at 11:40 PM ----------

do you guys have any idea how i can spawn this heli at a +3 height??

this is the part that spawns a helicopter to the helipad

	if (_i == 8) then {
	_type = HELI2TYPE;
	_pos  = getPosATL helipad2;
	_dir  = getDir helipad2; 
	if (_pos distance startLocation > 100) exitWith {}; //avoid racing condition, where helipad is still at spawnPos

What ever i try it always spawns on the ground.....

BelgarionNL, I believe what you are looking for is something like this: this setPosASL [position this select 0, position this select 1, 15.9] I took this off of a Domination Carrier based mission I have. This is used for setting objects on the main flight deck of the carrier. You might give it a try with what you are working on with some editing.

Share this post


Link to post
Share on other sites

Try something like this....

_height is the height you want the chopper at.

_pos = getpos helipad2;
_spawnpos = [_pos select 0,_pos select 1,[b][i]_height[/i][/b]];
_ride = createVehicle ["UH60M_EP1", _spawnpos, [], 0, "NONE"];

Share this post


Link to post
Share on other sites

i tried a shit load of combinations! this code is from insurgency.

this won't work! because the vehicle you entered is chosen by a parameter!! you can have 10 different helicopters!

i just need something piece of code that works with this script

Edited by BelgarionNL

Share this post


Link to post
Share on other sites

It was simply to show you how to do it. I didn't intend it to work without some substitution on your part.

You know.... the "give a man a fish" thing!

Have you tried replacing "UH60M_EP1" with HELI2TYPE?

Share this post


Link to post
Share on other sites

perhaps it was not smart to only give a small part of the script:

//ÐœÐ¾Ñ Ð“Ð¾Ð»Ð³Ð¾Ñ„Ð°...
westVehicleChecker = {
   private ["_vcl","_pos","_range","_driver","_plrs","_str"];

   if (!alive MHQ && startLocation == MHQ) exitWith {
	_vcl = createVehicle [MHQTYPE, spawnPos, [], 0, "None"]; 
	_vcl setVehicleInit format["this setVehicleVarName ""%1""; %1 = this;", "MHQ"];
	processInitCommands;
	HQ setDir (getDir vehicleServicePoint + 90);
	_pos = vehicleServicePoint modelToWorld [10,0,0];
	_pos set [2,0];
	HQ setPosATL _pos;
};	

if (startLocation != HQ) exitWith {};

_pos = startLocation modelToWorld [-1,12,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (helipad modelToWorld [0,0,0]) > 50) then {
	helipad setPosATL _pos;
	helipad setDir (getDir startLocation - 90);			
};

	_pos = startLocation modelToWorld [3,-15,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (helipad2 modelToWorld [0,0,0]) > 50) then {
	helipad2 setPosATL _pos;
	helipad2 setDir (getDir startLocation - 90);
};

	_pos = startLocation modelToWorld [7,-5.5,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (armorpad modelToWorld [0,0,0]) > 50) then {
	armorpad setPosATL _pos;
	armorpad setDir (getDir startLocation - 0);
};

	_pos = startLocation modelToWorld [13,-9,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (vehicleServicePoint modelToWorld [0,0,0]) > 50) then {
	vehicleServicePoint setPosATL _pos;
	vehicleServicePoint setDir (getDir startLocation - 180);
	vehicleServicePoint setCaptive true;
};
	_pos = HQ modelToWorld [1.5,0,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (HQ modelToWorld [0,0,0]) > 50) then {
	bunker setPosATL _pos;
	bunker setDir (getDir HQ );
	bunker setCaptive true;
};	

	_pos = vehicleServicePoint modelToWorld [-8,0,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (repairarea modelToWorld [0,0,0]) > 50) then {
	repairarea setPosATL _pos;
	repairarea setDir (getDir vehicleServicePoint);
};

	_pos = startLocation modelToWorld [-2,-8,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (baseflag modelToWorld [0,0,0]) > 50) then {
	baseflag setPosATL _pos;
	baseflag setDir (getDir startLocation);
};

	_pos = startLocation modelToWorld [1,-7.5,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (HQ modelToWorld [0,0,0]) > 50) then {
	fieldHospital setPosATL _pos;
	fieldHospital setDir (getDir startLocation - 90);
	fieldHospital setCaptive true;
};
	_pos = startLocation modelToWorld [3,21,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (wall1 modelToWorld [0,0,0]) > 50) then {
	wall1 setPosATL _pos;
	wall1 setDir (getDir startLocation - 0);
	wall1 setCaptive true;	
};
	_pos = startLocation modelToWorld [11,14,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (wall2 modelToWorld [0,0,0]) > 50) then {
	wall2 setPosATL _pos;
	wall2 setDir (getDir startLocation - 90);
	wall2 setCaptive true;	
};		
	_pos = startLocation modelToWorld [11,-15,-4];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (wall3 modelToWorld [0,0,0]) > 50) then {
	wall3 setPosATL _pos;
	wall3 setDir (getDir startLocation - 90);
	wall3 setCaptive true;
};	
	_pos = startLocation modelToWorld [-5,-15,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (wall4 modelToWorld [0,0,0]) > 50) then {
	wall4 setPosATL _pos;
	wall4 setDir (getDir startLocation - 90);
	wall4 setCaptive true;
};		
	_pos = startLocation modelToWorld [3,-22,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (wall5 modelToWorld [0,0,0]) > 50) then {
	wall5 setPosATL _pos;
	wall5 setDir (getDir startLocation - 0);
	wall5 setCaptive true;
};		
	_pos = startLocation modelToWorld [-9,21,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (wall6 modelToWorld [0,0,0]) > 50) then {
	wall6 setPosATL _pos;
	wall6 setDir (getDir startLocation - 0);
	wall6 setCaptive true;
};	
	_pos = startLocation modelToWorld [-12,12,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (wall7 modelToWorld [0,0,0]) > 50) then {
	wall7 setPosATL _pos;
	wall7 setDir (getDir startLocation - 90);
	wall7 setCaptive true;
};	
	_pos = startLocation modelToWorld [-12,17.5,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (wall8 modelToWorld [0,0,0]) > 50) then {
	wall8 setPosATL _pos;
	wall8 setDir (getDir startLocation - 90);
	wall8 setCaptive true;
};	
	_pos = startLocation modelToWorld [-12,8,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (wall9 modelToWorld [0,0,0]) > 50) then {
	wall9 setPosATL _pos;
	wall9 setDir (getDir startLocation - 90);
	wall9 setCaptive true;
};	
	_pos = startLocation modelToWorld [-10,7,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (wall10 modelToWorld [0,0,0]) > 50) then {
	wall10 setPosATL _pos;
	wall10 setDir (getDir startLocation - 0);
	wall10 setCaptive true;
};	
	_pos = startLocation modelToWorld [-8,-17,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (wall11 modelToWorld [0,0,0]) > 50) then {
	wall11 setPosATL _pos;
	wall11 setDir (getDir startLocation - 0);
	wall11 setCaptive true;
};
	_pos = startLocation modelToWorld [14,6.75,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (wall12 modelToWorld [0,0,0]) > 50) then {
	wall12 setPosATL _pos;
	wall12 setDir (getDir startLocation - 0);
	wall12 setCaptive true;
};
	_pos = startLocation modelToWorld [-2.5,-4.5,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (lookout1 modelToWorld [0,0,0]) > 50) then {
	lookout1 setPosATL _pos;
	lookout1 setDir (getDir startLocation - 270);
	lookout1 setCaptive true;
};
	_pos = startLocation modelToWorld [0,12,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor1_0 modelToWorld [0,0,0]) > 50) then {
	floor1_0 setPosATL _pos;
	floor1_0 setDir (getDir startLocation - 0);
	floor1_0 setCaptive true;
};
	_pos = floor1_0 modelToWorld [1.5,0,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor1_0 modelToWorld [1.5,0,0]) > 50) then {
	floor2_0 setPosATL _pos;
	floor2_0 setDir (getDir floor1_0 - 0);
	floor2_0 setCaptive true;
};
	_pos = startLocation modelToWorld [-1.5,12,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor3_0 modelToWorld [0,0,0]) > 50) then {
	floor3_0 setPosATL _pos;
	floor3_0 setDir (getDir startLocation - 0);
	floor3_0 setCaptive true;
};
	_pos = startLocation modelToWorld [3,12,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor4_0 modelToWorld [0,0,0]) > 50) then {
	floor4_0 setPosATL _pos;
	floor4_0 setDir (getDir startLocation - 0);
	floor4_0 setCaptive true;
};	
	_pos = startLocation modelToWorld [-3,12,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor5_0 modelToWorld [0,0,0]) > 50) then {
	floor5_0 setPosATL _pos;
	floor5_0 setDir (getDir startLocation - 0);
	floor5_0 setCaptive true;
};	
	_pos = startLocation modelToWorld [4.5,12,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor6_0 modelToWorld [0,0,0]) > 50) then {
	floor6_0 setPosATL _pos;
	floor6_0 setDir (getDir startLocation - 0);
	floor6_0 setCaptive true;
};	
	_pos = startLocation modelToWorld [-4.5,12,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor7_0 modelToWorld [0,0,0]) > 50) then {
	floor7_0 setPosATL _pos;
	floor7_0 setDir (getDir startLocation - 0);
	floor7_0 setCaptive true;
};		
	_pos = startLocation modelToWorld [6,12,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor8_0 modelToWorld [0,0,0]) > 50) then {
	floor8_0 setPosATL _pos;
	floor8_0 setDir (getDir startLocation - 0);
	floor8_0 setCaptive true;
};	
	_pos = startLocation modelToWorld [-6,12,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor9_0 modelToWorld [0,0,0]) > 50) then {
	floor9_0 setPosATL _pos;
	floor9_0 setDir (getDir startLocation - 0);
	floor9_0 setCaptive true;
};	
		_pos = startLocation modelToWorld [7.5,12,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor10_0 modelToWorld [0,0,0]) > 50) then {
	floor10_0 setPosATL _pos;
	floor10_0 setDir (getDir startLocation - 0);
	floor10_0 setCaptive true;
};	
		_pos = startLocation modelToWorld [-7.5,12,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor11_0 modelToWorld [0,0,0]) > 50) then {
	floor11_0 setPosATL _pos;
	floor11_0 setDir (getDir startLocation - 0);
	floor11_0 setCaptive true;
};	
	_pos = startLocation modelToWorld [0,13.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor1_1 modelToWorld [0,0,0]) > 50) then {
	floor1_1 setPosATL _pos;
	floor1_1 setDir (getDir startLocation - 0);
	floor1_1 setCaptive true;
};
	_pos = startLocation modelToWorld [1.5,13.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor2_1 modelToWorld [0,0,0]) > 50) then {
	floor2_1 setPosATL _pos;
	floor2_1 setDir (getDir startLocation - 0);
	floor2_1 setCaptive true;
};
	_pos = startLocation modelToWorld [-1.5,13.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor3_1 modelToWorld [0,0,0]) > 50) then {
	floor3_1 setPosATL _pos;
	floor3_1 setDir (getDir startLocation - 0);
	floor3_1 setCaptive true;
};
	_pos = startLocation modelToWorld [3,13.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor4_1 modelToWorld [0,0,0]) > 50) then {
	floor4_1 setPosATL _pos;
	floor4_1 setDir (getDir startLocation - 0);
	floor4_1 setCaptive true;
};	
	_pos = startLocation modelToWorld [-3,13.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor5_1 modelToWorld [0,0,0]) > 50) then {
	floor5_1 setPosATL _pos;
	floor5_1 setDir (getDir startLocation - 0);
	floor5_1 setCaptive true;
};	
	_pos = startLocation modelToWorld [4.5,13.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor6_1 modelToWorld [0,0,0]) > 50) then {
	floor6_1 setPosATL _pos;
	floor6_1 setDir (getDir startLocation - 0);
	floor6_1 setCaptive true;
};	
	_pos = startLocation modelToWorld [-4.5,13.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor7_1 modelToWorld [0,0,0]) > 50) then {
	floor7_1 setPosATL _pos;
	floor7_1 setDir (getDir startLocation - 0);
	floor7_1 setCaptive true;
};		
	_pos = startLocation modelToWorld [6,13.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor8_1 modelToWorld [0,0,0]) > 50) then {
	floor8_1 setPosATL _pos;
	floor8_1 setDir (getDir startLocation - 0);
	floor8_1 setCaptive true;
};	
	_pos = startLocation modelToWorld [-6,13.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor9_1 modelToWorld [0,0,0]) > 50) then {
	floor9_1 setPosATL _pos;
	floor9_1 setDir (getDir startLocation - 0);
	floor9_1 setCaptive true;
};	
	_pos = startLocation modelToWorld [7.5,13.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor10_1 modelToWorld [0,0,0]) > 50) then {
	floor10_1 setPosATL _pos;
	floor10_1 setDir (getDir startLocation - 0);
	floor10_1 setCaptive true;
};	
	_pos = startLocation modelToWorld [-7.5,13.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor11_1 modelToWorld [0,0,0]) > 50) then {
	floor11_1 setPosATL _pos;
	floor11_1 setDir (getDir startLocation - 0);
	floor11_1 setCaptive true;
};	
	_pos = startLocation modelToWorld [0,10.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor1_2 modelToWorld [0,0,0]) > 50) then {
	floor1_2 setPosATL _pos;
	floor1_2 setDir (getDir startLocation - 0);
	floor1_2 setCaptive true;
};
	_pos = startLocation modelToWorld [1.5,10.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor2_2 modelToWorld [0,0,0]) > 50) then {
	floor2_2 setPosATL _pos;
	floor2_2 setDir (getDir startLocation - 0);
	floor2_2 setCaptive true;
};
	_pos = startLocation modelToWorld [-1.5,10.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor3_1 modelToWorld [0,0,0]) > 50) then {
	floor3_2 setPosATL _pos;
	floor3_2 setDir (getDir startLocation - 0);
	floor3_2 setCaptive true;
};
	_pos = startLocation modelToWorld [3,10.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor4_2 modelToWorld [0,0,0]) > 50) then {
	floor4_2 setPosATL _pos;
	floor4_2 setDir (getDir startLocation - 0);
	floor4_2 setCaptive true;
};	
	_pos = startLocation modelToWorld [-3,10.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor5_2 modelToWorld [0,0,0]) > 50) then {
	floor5_2 setPosATL _pos;
	floor5_2 setDir (getDir startLocation - 0);
	floor5_2 setCaptive true;
};	
	_pos = startLocation modelToWorld [4.5,10.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor6_2 modelToWorld [0,0,0]) > 50) then {
	floor6_2 setPosATL _pos;
	floor6_2 setDir (getDir startLocation - 0);
	floor6_2 setCaptive true;
};	
	_pos = startLocation modelToWorld [-4.5,10.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor7_2 modelToWorld [0,0,0]) > 50) then {
	floor7_2 setPosATL _pos;
	floor7_2 setDir (getDir startLocation - 0);
	floor7_2 setCaptive true;
};		
	_pos = startLocation modelToWorld [6,10.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor8_2 modelToWorld [0,0,0]) > 50) then {
	floor8_2 setPosATL _pos;
	floor8_2 setDir (getDir startLocation - 0);
	floor8_2 setCaptive true;
};	
	_pos = startLocation modelToWorld [-6,10.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor9_2 modelToWorld [0,0,0]) > 50) then {
	floor9_2 setPosATL _pos;
	floor9_2 setDir (getDir startLocation - 0);
	floor9_2 setCaptive true;
};	
	_pos = startLocation modelToWorld [7.5,10.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor10_2 modelToWorld [0,0,0]) > 50) then {
	floor10_2 setPosATL _pos;
	floor10_2 setDir (getDir startLocation - 0);
	floor10_2 setCaptive true;
};	
	_pos = startLocation modelToWorld [-7.5,10.5,0];
_pos set [2,3.3];
if (getMarkerPos "USFLAG" distance (floor11_2 modelToWorld [0,0,0]) > 50) then {
	floor11_2 setPosATL _pos;
	floor11_2 setDir (getDir startLocation - 0);
	floor11_2 setCaptive true;
};		

for "_i" from 0 to (count westVehicleStrings - 1) do {
	_str = westVehicleStrings select _i;
	// isNil _str check if the vehicle is undefined
	// note that, _str does NOT get wrapped in quotes because _str contains the vehicle name
	// and we are checking for the presence of the vehicle, I assume _str whill always be a valid string
	if (isNil _str) then {
		_i call resetWestVehicle;
	} else {
		_vcl = call compile _str;
		// _vcl should not be NIL here .... due to ( isNil _str) protecting us
		// but it could be anything, so ... check its an object
		if (typeName _vcl=="OBJECT") then {
			if ( isNull _vcl) then {
				_i call resetWestVehicle;
			} else {
				call checkVehiclesNearbyCampObjs;
				if (!alive _vcl) then { 
					_i call resetWestVehicle;
				} else {
					scopeName "main";
					_range = 500;
					if (typeOf _vcl == ATVTYPE) then { 
						_range = 500; 
					};
					if (typeOf _vcl == HELITYPE && heliRC == 1) exitWith { breakTo "main"; };
					_plrs = nearestPlayers(getPosATL _vcl,SPAWNRANGE,false,"array");
					if (alive _vcl && !arrCanSee(_plrs,_vcl,45,_range) && _vcl distance startLocation > 100) then {
						_driver = driver _vcl;
						_gunner = gunner _vcl;
						if (!isNull _driver || !isNull _gunner) then { 
							if (alive _driver || alive _gunner) exitWith { 
								breakTo "main"; 
							}; 
						};
						{ moveOut _x; } forEach (crew _vcl);
						_i call resetWestVehicle;
					};	
				};
			};
		};
	};
	sleep 0.01;
};
}; 	

// returns one specific vehicle or re-creates it at the start position
resetWestVehicle = {
private ["_vcl","_str","_objs","_type","_bool","_pos","_dir","_id","_i","_vclKilledTime","_vclTimeDiff"];
_i = _this;
_str = westVehicleStrings select _i;

if (_i > 8 || _i == -1) exitWith { }; //only return listed vehicles, but not MHQ
	_id  = _i % 4;
	_pos = baseflag modelToWorld [-8,-6+_id*3.5];
	_dir = getDir baseflag - 90;
	_type 	  = if (_id % 2 == 1) then { CAR1TYPE } else { CAR2TYPE };
if (_i >= 4) then {
	_id = _id + 1;
	_type = ATVTYPE;
	_pos  = baseflag modelToWorld [-8,5+_id*3.5];
};
if (_i == 6) then {
	_type = HEAVY1TYPE;
	_pos  = getPosATL armorpad;
	_dir  = getDir armorpad; 
	if (_pos distance startLocation > 100) exitWith {}; //avoid racing condition, where helipad is still at spawnPos
};	
if (_i == 7) then {

	_type = HELITYPE;
	_pos  = getPosATL helipad;
	_dir  = getDir helipad; 
	if (_pos distance startLocation > 100) exitWith {}; //avoid racing condition, where helipad is still at spawnPos
};	


if (_i == 8) then {
	_type = HELI2TYPE;
	_pos  = getPosATL helipad2;
	_dir  = getDir helipad2; 
	if (_pos distance startLocation > 100) exitWith {}; //avoid racing condition, where helipad is still at spawnPos
};
_pos set [2,0];

_bool = isNil _str;
_vcl = call compile _str;
if !_bool then { _bool = isNull _vcl || !alive _vcl; };
if _bool then {
	// calculate if vehicle respawn time has elapsed
	_vclKilledTime = missionNameSpace getVariable format["%1_killedTime",_str];
	if (isNil "_vclKilledTime") then { _vclKilledTime = 0; };
	_vclTimeDiff = (time - _vclKilledTime);
	if (_vclTimeDiff <= westVehicleRespawn && _vclKilledTime != 0) exitWith { /* respawn delay has not elapsed */ };
	_objs = nearestObjects[_pos,["LandVehicle","Air","CraterLong"],20];
	if (count _objs > 0) then { { if (!(_x isKindOf "AllVehicles") || !alive _x) then { deleteVehicle _x; }; } forEach _objs; };
	_vcl = createVehicle [_type, spawnPos, [], 0, "None"];
	_vcl setVehicleInit format["this setVehicleVarName ""%1""; %1 = this;", _str];
	_vcl setDir _dir;
	_vcl setPosATL _pos;
	if (_i < 4 || _i == 7) then { _vcl call setVclAmmoCargo; };
	processInitCommands;
	[player,_vcl,"loc",rSPAWN,_vcl,{ _this call addActionLock; }] call RE;

	// attach killed EH to define time when vehicle was killed, in order to check for respawn delay
	_vcl addEventHandler ["killed", { missionNamespace setVariable [format["%1_killedTime",(_this select 0)], time]; }];
} else {
	_vcl call vehicleService;
	_vcl engineOn false;
	_vcl setDir _dir;
	_vcl setPosATL _pos;
};
};

setWeaponCargo = {
private ["_vcl","_wep","_num","_cargo","_arr1","_arr2","_count","_id"];
_vcl   = _this select 0;
_wep   = _this select 1;

_num   = 0;
_cargo = getWeaponCargo _vcl;
_arr1  = _cargo select 0;
_id    = _arr1 find _wep;
if (_id == -1) exitWith {};
_arr1 set[_id, str _wep];
_arr2  = (_cargo select 1);
_arr2 set[_id, 0];
_cargo = [_arr1,_arr2];
_count = count _arr2;
call compile format['
	_vcl setVehicleInit "
	clearWeaponCargo this;
	for ""_i"" from 0 to (%2 - 1) do {
		_wep = (%1 select 0) select _i;
		_num = (%1 select 1) select _i;
		this addWeaponCargo [_wep,_num];
	};
	";
	processInitCommands;
', _cargo, _count];
};

vehicleService = {
_this call setVclAmmoCargo;
processInitCommands;
};

setVclAmmoCargo = {
_this setVehicleInit '
this setVehicleAmmo 1;
this setFuel 1;
this setDamage 0;
clearWeaponCargo this;
clearMagazineCargo this;
{ this addMagazineCargo [_x select 0, _x select 1]; } forEach humvMagazines;
if (player in crew this) then { titleText["Vehicle serviced", "PLAIN DOWN"]; };
';
};

addActionLock = {
private "_actionIndex";
_actionIndex = _this addAction ["Lock","common\client\actions\noScript.sqf",'
	_this select 0 lock true; 
	_this select 0 removeAction (_this select 2);
	_this select 0 call addActionUnlock; 
',1,false,true,"","isAdmin"];
};

addActionUnlock = {
private "_actionIndex";
_actionIndex = _this addAction ["Unlock","common\client\actions\noScript.sqf",'
	_this select 0 lock false; 
	_this select 0 removeAction (_this select 2);
	_this select 0  call addActionLock; 
',1,false,true,"","isAdmin"];
};

checkVehiclesNearbyCampObjs	= {
_isemptycar = _vcl!=heli && !(player in _vcl);
_campObjArray = ["M1130_HQ_unfolded_Base_EP1","MASH_EP1","US_WarfareBVehicleServicePoint_EP1","Land_fortified_nest_small_EP1"];
_isemptyheli = _vcl==heli && !(player in _vcl);

/*	if (_isemptycar && _vcl distance (fieldHospital modelToWorld [0,0,0]) < 2) then {
_vcl setPos [(getPos _vcl select 0) + 3,
(getPos _vcl select 1) + 3,
(getPos _vcl select 2)]};

if (_isemptycar && _vcl distance (vehicleServicePoint modelToWorld [0,0,0]) < 1) then {
_vcl setPos [(getPos _vcl select 0) + 2,
(getPos _vcl select 1) + 2,
(getPos _vcl select 2)]};

if (_isemptycar && _vcl distance (helipad modelToWorld [0,0,0]) < 7) then {
_vcl setPos [(getPos helipad select 0) - 10,
(getPos helipad select 1) + 1,
(getPos helipad select 2)]};

if (_isemptycar && _vcl distance (helipad2 modelToWorld [0,0,0]) < 0) then {
_vcl setPos [(getPos helipad2 select 0) + 0,
(getPos helipad2 select 1) + 0,
(getPos helipad2 select 2)]};

if (_isemptycar && _vcl distance (armorpad modelToWorld [0,0,0]) < 0) then {
_vcl setPos [(getPos armorpad select 0) + 0,
(getPos armorpad select 1) + 0,
(getPos armorpad select 2)]};

if (_isemptycar && _vcl distance (HQ modelToWorld [0,0,0]) < 6) then {
_vcl setPos [(getPos _vcl select 0) + 0.5,
(getPos _vcl select 1) - 6,
(getPos _vcl select 2)]};
*/	
if (HQ distance (helipad modelToWorld [0,0,0]) < 10) then {
	HQ setDir (getDir vehicleServicePoint + 90);
	_pos = vehicleServicePoint modelToWorld [10,0,0];
	_pos set [2,0];
	HQ setPosATL _pos;
	};
};   

the floor entries are at a height of 3.3 and are over the position of "HELIPAD" and its helicopter that spawns on it ,HELITYPE!

now I've tried setting the height of the helipad: (here:)

_pos = startLocation modelToWorld [-1,12,0];
_pos set [2,[color="Red"]3.5[/color]];
if (getMarkerPos "USFLAG" distance (helipad modelToWorld [0,0,0]) > 50) then {
	helipad setPosATL _pos;
	helipad setDir (getDir startLocation - 90);			
};

where the helitype spawns to! and I tried setting the helitype height (here:)

if (_i == 7) then {

	_type = HELITYPE;
	_pos  = getPosATL helipad;
	_dir  = getDir helipad; 
	if (_pos distance startLocation > 100) exitWith {}; //avoid racing condition, where helipad is still at spawnPos

Share this post


Link to post
Share on other sites

When you run the mission...do you see the helipad at the height you want? Stupid question maybe!

From looking through the code posted.... this is the line that spawns the chopper...

 _vcl = createVehicle [_type, [b]spawnPos[/b], [], 0, "None"];

Therefore the z element of spawnPos needs to be 3.5m

I don't know where spawnPos is given it's value. That is what needs to be changed.

If you hard code it to 3.5 before the vehicle is spawned... it's going to affect all vehicles.

Edited by twirly
Clarity

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  

×