Deprecated/Slow Commands

Stop using them!
This commit is contained in:
icomrade
2014-05-27 15:03:53 -04:00
parent 88ded0f3c0
commit 774441ef45
39 changed files with 94 additions and 77 deletions

View File

@@ -27,7 +27,7 @@ if (typename _this == typename objnull) then {
//--- PLAYER ------------------------------------------------
_brightness = 0.99;
_pos = position player;
_pos = [player] call FNC_GetPos;
_parray = [
/* 00 */ ["\Ca\Data\ParticleEffects\Universal\Universal", 16, 12, 13, 0],
/* 01 */ "",
@@ -192,9 +192,10 @@ if (typename _this == typename objnull) then {
};
} else {
//--- AI ------------------------------------------------
while {(position _unit select 2) > 100} do {
while {(([_unit] call FNC_GetPos) select 2) > 100} do {
_destination = expecteddestination _unit select 0;
if (_destination distance [position _unit select 0,position _unit select 1,0] > 10) then {
_unitPosition = [_unit] call FNC_GetPos;
if ((_destination distance [(_unitPosition select 0),(_unitPosition select 1),0]) > 10) then {
_vel = velocity _unit;
_dirTo = [_unit,_destination] call bis_fnc_dirto;
if (player distance _unit > 500) then {
@@ -223,7 +224,8 @@ if (typename _this == typename []) then {
//--- Free fall
if (count _this == 2) exitwith {
_alt = _this select 1;
_unit setpos [position _unit select 0,position _unit select 1,_alt];
_paraPosition = [_unit] call FNC_GetPos;
_unit setpos [(_paraPosition select 0),(_paraPosition select 1),_alt];
_unit setvariable ["bis_fnc_halo_now",true];
_unit spawn bis_fnc_halo;
};
@@ -231,9 +233,10 @@ if (typename _this == typename []) then {
_para = objnull;
_vel = [];
_para = "ParachuteWest" createVehicle position _unit;
_paraPosition1 = [_unit] call FNC_GetPos;
_para = createVehicle ["ParachuteWest", _paraPosition1, [], 0, "CAN_COLLIDE"];
//_para = "BIS_Steerable_Parachute" createVehicle position _unit;
_para setpos position _unit;
_para setpos _paraPosition1;
_para setdir direction _unit;
_vel = velocity _unit;
_unit moveindriver _para;
@@ -339,7 +342,7 @@ if (typename _this == typename []) then {
//--- End
//waituntil {vehicle player == player};
player setvariable ["bis_fnc_halo_terminate",nil];
waituntil {(position vehicle player select 2) < 2 || !isnil {player getvariable "bis_fnc_halo_terminate"}};
waituntil {(([(vehicle player)] call FNC_GetPos) select 2) < 2 || !isnil {player getvariable "bis_fnc_halo_terminate"}};
(finddisplay 46) displayremoveeventhandler ["keydown",bis_fnc_halo_para_keydown_eh];
(finddisplay 46) displayremoveeventhandler ["mousemoving",bis_fnc_halo_para_mousemoving_eh];
(finddisplay 46) displayremoveeventhandler ["mouseholding",bis_fnc_halo_para_mouseholding_eh];

View File

@@ -23,7 +23,7 @@ _lights = ["a_fuelstation_sign.p3d","lampa_ind_zebr.p3d","lampa_ind.p3d","lampa_
};
};
};
} foreach nearestObjects [getPos _target, [], _rng];
} foreach nearestObjects [([_target] call FNC_getPos), [], _rng];
};
@@ -86,10 +86,10 @@ _lCol = _this select 0;
_lbrt = _this select 1;
_lamb = _this select 2;
_doLit = _this select 4 select 0;
_twrPos = getPos _twr;
_twrPos = ([_twr] call FNC_getPos);
_rad=2.65;
_oset=14;
_nrTLs= position _twr nearObjects ["#lightpoint",20];
_nrTLs= _twrPos nearObjects ["#lightpoint",20];
if(count _nrTLs > 3)then{
//axeDiagLog = format["FN:TL FOUND LP:%1",count _nrTLs];

View File

@@ -39,7 +39,7 @@ if (_canPickLight and !dayz_hasLight and !_isPZombie) then {
if (DZE_HeliLift) then {
_hasAttached = _vehicle getVariable["hasAttached",false];
if(_inVehicle and (_vehicle isKindOf "Air") and ((getPos _vehicle select 2) < 30) and (speed _vehicle < 5) and (typeName _hasAttached == "OBJECT")) then {
if(_inVehicle and (_vehicle isKindOf "Air") and ((([_vehicle] call FNC_getPos) select 2) < 30) and (speed _vehicle < 5) and (typeName _hasAttached == "OBJECT")) then {
if (s_player_heli_detach < 0) then {
dayz_myLiftVehicle = _vehicle;
s_player_heli_detach = dayz_myLiftVehicle addAction ["Detach Vehicle","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,false,true,"",""];
@@ -51,7 +51,7 @@ if (DZE_HeliLift) then {
};
if(DZE_HaloJump) then {
if(_inVehicle and (_vehicle isKindOf "Air") and ((getPos _vehicle select 2) > 400)) then {
if(_inVehicle and (_vehicle isKindOf "Air") and ((([_vehicle] call FNC_getPos) select 2) > 400)) then {
if (s_halo_action < 0) then {
DZE_myHaloVehicle = _vehicle;
s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,false,true,"",""];
@@ -285,8 +285,8 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
_liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15];
{
if(!_found) then {
_posL = getPos _x;
_posC = getPos _cursorTarget;
_posL = [_x] call FNC_getPos;
_posC = [_cursorTarget] call FNC_getPos;
_height = (_posL select 2) - (_posC select 2);
_hasAttached = _x getVariable["hasAttached",false];
if(_height < 15 and _height > 5 and (typeName _hasAttached != "OBJECT")) then {

View File

@@ -101,11 +101,11 @@ if(!isNil "_objHouse")then{
//publicVariable "axeDiagLog";
_objLightPoint = nearestObject [_x, "#lightpoint"];
_pos = getPos _x;
_pos = [_x] call FNC_getPos;
_dir = getDir _x;
if(_plyr distance _x < _lpRange)then{//If within create radius
[_lmpCol,_brtns,_lmpCol,getPos _x,_dir,[0,0,-1]] call axe_newLightPoint;
[_lmpCol,_brtns,_lmpCol,_pos,_dir,[0,0,-1]] call axe_newLightPoint;
//_x setVariable ["axeHLight", 1, false];
};
@@ -124,7 +124,7 @@ if(!isNil "_objHouse")then{
if(count _litHouses > 0 )then{
{
_objLightPoint = nearestObject [_x, "#lightpoint"];
_pos = getPos _x;
_pos = [_x] call FNC_getPos;
if((abs ([_pos, _objLightPoint] call BIS_fnc_distance2D))<_hsLPDist)then{//In House
if(_plyr distance _x < _lpRange)then{//If within range and outside band
@@ -147,7 +147,7 @@ if(!isNil "_objHouse")then{
}else{
if(_plyr distance _x < _lpRange)then{//If within create radius recreate lightpoint (after logging)
_brtns = [_plyr,_x] call axe_lightBrightness;
[_lmpCol,_brtns,_lmpCol,getPos _x,_dir,[0,0,-2.6]] call axe_newLightPoint;
[_lmpCol,_brtns,_lmpCol,_pos,_dir,[0,0,-2.6]] call axe_newLightPoint;
//axeDiagLog = format["HL:Recreating light %1 for %2 ",_x,name player];
//publicVariable "axeDiagLog";
};

View File

@@ -30,7 +30,7 @@ if(!isDedicated)then{
axeTowerLights = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lights_tower.sqf";
axeHouseLights = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lights_house.sqf";
waitUntil {getPos Player select 0 > 0};
waitUntil {(([Player] call FNC_getPos) select 0) > 0};
//Detect Dusk and Dawn
_sunrise = call world_sunRise;
@@ -101,7 +101,7 @@ if(!isDedicated)then{
};
};
//};
_plyPos = getPos player;
_plyPos = [Player] call FNC_getPos;
};
sleep _slpTime;
};

View File

@@ -16,7 +16,7 @@ _objHouses = nearestObjects [_nrstTrig, ["House"], _hsRange];
_hsCount = count _objHouses;
_rnd = random _hsCount;
_objHouse = _objHouses select _rnd;
_pos = getPos _objHouse;
_pos = [_objHouse] call FNC_getPos;
_lightstate = _objHouse animationPhase "Lights_1";
if(_lightstate==1) then{
_animlightpoint = nearestObject [_objHouse, "#lightpoint"];
@@ -47,7 +47,7 @@ _nrTowers = nearestObjects [_nrstTrig, ["Land_Ind_IlluminantTower"], _rng];
if(count _objHouses >0)then{
{
_objLightPoint = nearestObject [_x, "#lightpoint"];
if((abs ([getPos _x, _objLightPoint] call BIS_fnc_distance2D))<1.5)then{
if((abs ([([_x] call FNC_getPos), _objLightPoint] call BIS_fnc_distance2D))<1.5)then{
deleteVehicle _objLightPoint;
};
}forEach _objHouses;
@@ -65,7 +65,7 @@ _nrTowers = nearestObjects [_nrstTrig, ["Land_Ind_IlluminantTower"], _rng];
{
for "_s" from 1 to 4 do {
_objLightPoint = nearestObject [_x, "#lightpoint"];
if((abs ([getPos _x, _objLightPoint] call BIS_fnc_distance2D))<25)then{
if((abs ([([_x] call FNC_getPos), _objLightPoint] call BIS_fnc_distance2D))<25)then{
deleteVehicle _objLightPoint;
};
};

View File

@@ -7,13 +7,13 @@ _nearPlotPole = nearestObject [player, "Plastic_Pole_EP1_DZ"];
//"privatized" center variable
_BD_radius = DZE_PlotPole select 0;
_BD_center = getPos _nearPlotPole;
_BD_center = [_nearPlotPole] call FNC_getPos;
_objects = [];
// circle
for "_i" from 0 to 360 step (270 / _BD_radius) do {
_location = [(_BD_center select 0) + ((cos _i) * _BD_radius), (_BD_center select 1) + ((sin _i) * _BD_radius), _BD_center select 2];
_object = "Plastic_Pole_EP1" createVehicle _location;
_object = createVehicle ["Plastic_Pole_EP1", _location, [], 0, "CAN_COLLIDE"];
_object setpos _location;
};

View File

@@ -54,7 +54,7 @@ if (_height < 100) then {
_bolt attachTo [_hitObject,_val,_hitMemoryPt];
_dir = ([_hitObject,_unit] call BIS_fnc_relativeDirTo) + 180;
_bolt setDir (_dir);
_bolt setPos (getPos _bolt);
[_bolt] call FNC_GetSetPos;
_unit setVariable["firedHit",[]];
_unit setVariable["firedDamage",0,true];
};

View File

@@ -19,7 +19,7 @@ while {(alive _projectile) && !(isNull _projectile) && _callCount < 85;} do {
if (_projectflight > 0) then {
sleep (12 / (_projectflight));
};
if (alive _projectile && !(isNull _projectile)) then {_currentNear = (Position _projectile) nearEntities [["CAManBase","AllVehicles"],15];};
if (alive _projectile && !(isNull _projectile)) then {_currentNear = ([_projectile] call FNC_GetPos) nearEntities [["CAManBase","AllVehicles"],15];};
_listNear = _listNear + _currentNear;
_callCount = _callCount + 1;
};

View File

@@ -3,7 +3,7 @@ _target = _this select 0;
//_caller = _this select 1;
_id = _this select 2;
//_params = _this select 3;
_pos = position _target;
_pos = [_target] call FNC_GetPos;
_hasRawMeat = "FoodSteakRaw" in magazines player;
_hasdog = player getVariable ["dogid", "false"];

View File

@@ -1,6 +1,6 @@
private ["_listTalk","_eyeDir","_attacked","_continue","_type","_chance","_last","_refObj","_inAngle","_tPos","_zPos","_cantSee","_entHeight","_delta","_targets","_pHeight","_lowBlood","_dist"];
_refObj = vehicle player;
_listTalk = (getPos _refObj) nearEntities ["zZombie_Base",80];
_listTalk = ([_refObj] call FNC_GetPos) nearEntities ["zZombie_Base",80];
_pHeight = (getPosATL _refObj) select 2;
_attacked = false;
{

View File

@@ -25,7 +25,7 @@ _animalID setFSMVariable ["_isTamed", true];
sleep 1;
diag_log format["DEBUG: %1, id: %2 [%3]",_dog,_animalID,completedFSM _animalID];
if (!moveToCompleted _dog) then {
_dog moveTo (position _dog);
_dog moveTo ([_dog] call FNC_GetPos);
};
_dog disableAI "FSM";
(group _dog) setBehaviour "AWARE";

View File

@@ -2,7 +2,7 @@ private ["_unit","_originalPos","_pos","_chance","_playerpos"];
_unit = _this select 0;
_originalPos = _this select 1;
_pos = getPosATL _unit;
_playerpos = getPos player;
_playerpos = ([player] call FNC_GetPos);
if (count _this > 2) then {
_pos = _this select 2;