Jump to content
Sign in to follow this  
Coladebote

Task works in editor but not on server

Recommended Posts

Hello guys, I generate two ZU-23 antiaircraft with their corresponding unit, exporting in SQF from the editor. I assign each antiaircraft a name: POSITION_1_ZU23_1 and POSITION_1_ZU23_2. The task is to shoot down the gunners and destroy the anti-aircraft guns.

 

The task trigger fires with this condition: !Alive POSITION_1_ZU23_1 && !Alive POSITION_1_ZU23_2; The explosives are placed in the editor and when the detonator is activated, the anti-aircraft guns are destroyed, the task is skipped and is considered complete. However, when doing the same test on the server, the task does not work.

 

This is the script that generates the two anti-aircraft guns:

 

// POSITION I
/////////////////////////////////////////////////////////////////////////////////////////// 
if (!isServer) exitWith {};
///////////////////////////////////////////////////////////////////////////////////////////
// Init
params [["_layerWhiteList",[],[[]]],["_layerBlacklist",[],[[]]],["_posCenter",[0,0,0],[[]]],["_dir",0,[0]],["_idBlacklist",[],[[]]]];
private _allWhitelisted = _layerWhiteList isEqualTo [];
private _layerRoot = (_allWhitelisted || {true in _layerWhiteList}) && {!(true in _layerBlackList)};
///////////////////////////////////////////////////////////////////////////////////////////
// Markers
private _markers = [];
private _markerIDs = [];
///////////////////////////////////////////////////////////////////////////////////////////
// Groups
private _groups = [];
private _groupIDs = [];

private _item3 = grpNull;
if (_layerRoot) then {
	_item3 = createGroup east;
	_this = _item3;
	_groups pushback _this;
	_groupIDs pushback 3;
};

private _item6 = grpNull;
if (_layerRoot) then {
	_item6 = createGroup east;
	_this = _item6;
	_groups pushback _this;
	_groupIDs pushback 6;
};
///////////////////////////////////////////////////////////////////////////////////////////
// Objects
private _objects = [];
private _objectIDs = [];

private _item5 = objNull;
if (_layerRoot) then {
	_item5 = _item3 createUnit ["CUP_O_RU_Soldier",[4262.69,5349.49,0],[],0,"CAN_COLLIDE"];
	_item3 selectLeader _item5;
	_this = _item5;
	_objects pushback _this;
	_objectIDs pushback 5;
	_this setPosWorld [4261.99,5348.82,38.7591];
	_this setVectorDirAndUp [[0.990326,0.136113,-0.026983],[0.0199999,0.0524126,0.998425]];
	POSITION_1_ZU23_1G = _this;
	_this setVehicleVarName "POSITION_1_ZU23_1G";
	_this setname "Mikhail Chapayev";;
	_this setface "WhiteHead_15";;
	_this setspeaker "Male02RUS";;
	_this setpitch 0.97;;
	if !(0 == ([0, 1] select (_this getUnitTrait 'engineer')) || {0 == -1}) then {_this setVariable ['s', 0, true]};
	_this setVariable ["ace_advanced_fatigue_performanceFactor", 1, true];
	_this setVariable ['ACE_isEOD', false, true];
	if (0 >= 0.1) then {_this setVariable ["ace_medical_damageThreshold", 0, true]};
	if (0 != -1 && {0 != (parseNumber (_this getUnitTrait 'medic'))}) then {_this setVariable ["ace_medical_medicClass", 0, true]};
};
private _item4 = objNull;
if (_layerRoot) then {
	_item4 = createVehicle ["CUP_O_ZU23_RU",[4262.69,5349.49,0],[],0,"CAN_COLLIDE"];
	_this = _item4;
	_objects pushback _this;
	_objectIDs pushback 4;
	_this setPosWorld [4262.73,5349.59,40.108];
	_this setVectorDirAndUp [[0.990326,0.136113,-0.026983],[0.0199999,0.0524126,0.998425]];
	POSITION_1_ZU23_1 = _this;
	_this setVehicleVarName "POSITION_1_ZU23_1";
	[_this,"[[[[],[]],[[],[]],[[],[]],[[],[]]],false]"] call bis_fnc_initAmmoBox;;
	[_this, 10] call ace_cargo_fnc_setSize;;
};
private _item8 = objNull;
if (_layerRoot) then {
	_item8 = _item6 createUnit ["CUP_O_RU_Soldier",[4227.35,5344.99,0],[],0,"CAN_COLLIDE"];
	_item6 selectLeader _item8;
	_this = _item8;
	_objects pushback _this;
	_objectIDs pushback 8;
	_this setPosWorld [4227.66,5345.95,37.7605];
	_this setVectorDirAndUp [[-0.811023,-0.584627,0.0212677],[0.0100004,0.0224943,0.999697]];
	POSITION_1_ZU23_2G = _this;
	_this setVehicleVarName "POSITION_1_ZU23_2G";
	_this setname "Kuzma Shcherbakov";;
	_this setface "LivonianHead_8";;
	_this setspeaker "male02rus";;
	_this setpitch 1.01698;;
	if !(0 == ([0, 1] select (_this getUnitTrait 'engineer')) || {0 == -1}) then {_this setVariable ['s', 0, true]};
	_this setVariable ["ace_advanced_fatigue_performanceFactor", 1, true];
	_this setVariable ['ACE_isEOD', false, true];
	if (0 >= 0.1) then {_this setVariable ["ace_medical_damageThreshold", 0, true]};
	if (0 != -1 && {0 != (parseNumber (_this getUnitTrait 'medic'))}) then {_this setVariable ["ace_medical_medicClass", 0, true]};
};
private _item7 = objNull;
if (_layerRoot) then {
	_item7 = createVehicle ["CUP_O_ZU23_RU",[4227.35,5344.99,0],[],0,"CAN_COLLIDE"];
	_this = _item7;
	_objects pushback _this;
	_objectIDs pushback 7;
	_this setPosWorld [4227.37,5345.03,39.1868];
	_this setVectorDirAndUp [[-0.811023,-0.584627,0.0212677],[0.0100004,0.0224943,0.999697]];
	POSITION_1_ZU23_2 = _this;
	_this setVehicleVarName "POSITION_1_ZU23_2";
	[_this,"[[[[],[]],[[],[]],[[],[]],[[],[]]],false]"] call bis_fnc_initAmmoBox;;
	[_this, 10] call ace_cargo_fnc_setSize;;
};
///////////////////////////////////////////////////////////////////////////////////////////
// Triggers
private _triggers = [];
private _triggerIDs = [];
///////////////////////////////////////////////////////////////////////////////////////////
// Group attributes (applied only once group units exist)
_this = _item3;
if !(units _this isEqualTo []) then {
	[_this,0] setWaypointPosition [position leader _this,0];
	[_this, "Alpha 1-1"] call CBA_fnc_setCallsign;
};
_this = _item6;
if !(units _this isEqualTo []) then {
	[_this,0] setWaypointPosition [position leader _this,0];
	[_this, "Alpha 1-2"] call CBA_fnc_setCallsign;
};
///////////////////////////////////////////////////////////////////////////////////////////
// Waypoints
private _waypoints = [];
private _waypointIDs = [];
///////////////////////////////////////////////////////////////////////////////////////////
// Logics
private _logics = [];
private _logicIDs = [];
///////////////////////////////////////////////////////////////////////////////////////////
// Layers
///////////////////////////////////////////////////////////////////////////////////////////
// Crews
if (!isNull _item5 && !isNull _item4) then {_item5 moveInTurret [_item4,[0]];};
if (!isNull _item8 && !isNull _item7) then {_item8 moveInTurret [_item7,[0]];};
///////////////////////////////////////////////////////////////////////////////////////////
// Vehicle cargo
///////////////////////////////////////////////////////////////////////////////////////////
// Connections
///////////////////////////////////////////////////////////////////////////////////////////
// Inits (executed only once all entities exist; isNil used to ensure non-scheduled environment)
isNil {
};
///////////////////////////////////////////////////////////////////////////////////////////
// Module activations (only once everything is spawned and connected)
///////////////////////////////////////////////////////////////////////////////////////////
[[_objects,_groups,_triggers,_waypoints,_logics,_markers],[_objectIDs,_groupIDs,_triggerIDs,_waypointIDs,_logicIDs,_markerIDs]]

 

The code will probably need to be modified. Can someone help me?

 

Thanks.

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  

×