Files
DayZ-Epoch/SQF/dayz_server/compile/zombie_Wildgenerate.sqf
ebayShopper 14a6252911 Fix DZE_BuildHeightLimit behavior
Corrections for #1988
@BigEgg17 abs(_objHDiff) only tells you how much you have raised the
ghost from where it was when you started building. To test the actual
height above ground or sea level you need to use _position select 2.

Say DZE_BuildHeightLimit was 60m and DZE_buildMaxMoveDistance was 20m.
If the player started building at 55m and then raised the object 20m,
they would be allowed to build at 75m with your check.

Also getPosATL should not be used here. For example, I am swimming on
the surface of the water on Napf and getPosATL returns a height of 29m.

@oiad you missed zombie_wildGenerate.sqf in #1987
2017-11-14 13:09:15 -05:00

50 lines
1.4 KiB
Plaintext

private ["_position","_doLoiter","_unitTypes","_array","_agent","_type","_radius","_method","_rndx","_rndy","_counter","_amount","_wildsdone"];
_unitTypes = _this select 0;
_amount = _this select 1;
//_doLoiter = true;
_wildsdone = true;
_counter = 0;
while {_counter < _amount} do {
//_loot = "";
//_array = [];
_agent = objNull;
_type = _unitTypes call BIS_fnc_selectRandom;
//Create the Group and populate it
//diag_log ("Spawned: " + _type);
//_radius = 0;
_method = "CAN_COLLIDE";
_position = [getMarkerPos "center",1,6500,1] call fn_selectRandomLocation;
if ([_position] call DZE_SafeZonePosCheck) exitWith {};
//Create Zed
_agent = createAgent [_type, _position, [], 1, _method];
//Set Random Direction
_agent setDir floor(random 360);
//Loiter State
_agent setVariable ["doLoiter",true]; //Might not be used.
//Zed stance
if (random 1 > 0.7) then {
_agent setUnitPos "Middle";
};
//Set home location to loiter around
_position = getPosATL _agent;
_agent setVariable ["homePos",_position,true];
//Store _agentobject
_agent setVariable["agentObject",_agent,true];
//add to counter
_counter = _counter + 1;
//Start behavior
//_id = [_agent] execFSM "\z\AddOns\dayz_code\system\zombie_wildagent.fsm";
//_agent setVariable [ "fsmid", _id ];
//Disable all zed systems
_agent enableSimulation false;
//diag_log format ["CREATE WILD: Active: %1, Waiting: %2",_counter,(_amount - _counter)]
};
_wildsdone