Jump to content
Sign in to follow this  
blasturbator

ACE Insurgency 1.50 Takistan Dedicated server issue

Recommended Posts

So i'm trying to get ace insurgency 1.50 takistan by pogoman, fireball and kol9yn working, but the server will only show up when ran as a dedicated server. Everything works fine on dedicated except the gear crates which spawn with the MHQ.

On closer examination it seems the gear box is placed in the mission and named "stuffbox" which is then filled by another script. I assume it moves to the location the mhq is deployed at once the mission loads, so i am now looking for that script instead as that seems to be what isn't working.

Found it (marked with a comment saying Here it is):

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 [3,20,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 [0,-10,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (vehicleServicePoint modelToWorld [0,0,0]) > 50) then {
	vehicleServicePoint setPosATL _pos;
	vehicleServicePoint setDir (getDir startLocation - 90);
	vehicleServicePoint 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 [-3,-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 [8,0,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (HQ modelToWorld [0,0,0]) > 50) then {
	fieldHospital setPosATL _pos;
	fieldHospital setDir (getDir startLocation);
	fieldHospital setCaptive true;
};

_pos = vehicleServicePoint modelToWorld [0,4,0];
_pos set [2,0];
if (getMarkerPos "USFLAG" distance (stuffbox modelToWorld [0,0,0]) > 50) then {
	stuffbox setPosATL _pos;                                                                                //////////////////Here it is/////////////////////
	stuffbox setDir (getDir vehicleServicePoint - 180);
};

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 = 400;
					if (typeOf _vcl == ATVTYPE) then { 
						_range = 100; 
					};
					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;
};
}; 	

And this is the only script that calls that function (included in the initserver.sqf):

private ["_PGroup","_WCTime","_BCTime"];

_PGroup     		= group pilotController;
_WCTime     		= time;
_BCTime    			= time;

while { true } do { 
call westVehicleChecker;
if (heliRC == 1) then {
	call pilotAI;	
};
call quickCleanup;	
call longCleanup;	
if (livesLeft == 0 && time > 30) then {
	if (nearestPlayers(CENTERPOS,AORADIUS,true,"count") == 0) then { endMission "LOSER"; };
};
sleep 1;
}; 

Edited by Blasturbator

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  

×