private array updates + fixes

This commit is contained in:
vbawol
2013-05-26 12:23:31 -05:00
parent 04393b3383
commit 59905c1d18
123 changed files with 268 additions and 260 deletions

View File

@@ -1,4 +1,4 @@
private["_obj","_type","_config","_positions","_iPos","_nearBy","_itemType","_itemTypes","_itemChances","_lootChance","_weights","_cntWeights","_index"];
private ["_obj","_type","_config","_positions","_iPos","_nearBy","_itemType","_itemTypes","_lootChance","_weights","_cntWeights","_index"];
_obj = _this select 0;

View File

@@ -15,7 +15,7 @@ if (_canLoot) then {
_max = getNumber (_config >> "maxRoaming");
//Walking Zombies
//_num = round(random _max) min _min;
_num = round(random _max) max _min;
_num = (round(random _max)) max _min;
_config = configFile >> "CfgBuildingLoot" >> _type;
//Get zombie class
_zombieChance = getNumber (_config >> "zombieChance");

View File

@@ -1,4 +1,4 @@
private["_position","_unitTypes","_group","_unit","_target","_bodies","_targetPos","_codeSpawns","_unitSpawn","_lead","_isAlive","_units"];
private ["_position","_target","_targetPos","_isAlive","_list","_isSomeone","_myDest","_agent"];
//Definitions
_agent = _this select 0;
@@ -8,6 +8,7 @@ _agent = _this select 0;
//Loop behaviour
_list = (getposATL _agent) nearEntities ["Man",200];
_isSomeone = ({isPlayer _x} count _list) > 0;
_isAlive = alive _agent;
while {_isAlive and _isSomeone} do {
//NO TARGET
_agent disableAI "FSM";

View File

@@ -1,4 +1,4 @@
private["_dog","_target","_targets","_targetDis","_c","_man","_manDis","_targets","_agentheight","_nearEnts","_rnd","_assigned","_range","_objects"];
private ["_dog","_target","_targets","_man","_manDis"];
_dog = _this;
_target = objNull;
_targets = [];

View File

@@ -18,8 +18,8 @@ scriptName "Functions\arrays\fn_selectRandomWeighted.sqf";
[*] Algorithm is inefficient?
*/
private ["_array", "_weights"];
_array = _this select 0;
private ["_weights","_weighted"];
//_array = _this select 0;
_weights = _this select 1;
/*

View File

@@ -1,3 +1,4 @@
private ["_hrStr","_minStr","_curDate","_hr","_min"];
_curDate = date;
_hr = _curDate select 3;
_min = _curDate select 4;

View File

@@ -4,7 +4,7 @@ scriptName "Functions\misc\fn_damageActions.sqf";
- Function
- [] call fnc_usec_damageActions;
************************************************************/
private ["_weaponName","_action","_turret","_weapons","_assignedRole","_action1","_action2","_x","_vehicle","_unit","_vehType","_displayName","_ammoQty","_ammoSerial","_weapon","_magTypes","_type","_typeVeh","_index","_inventory","_unitTo","_isEngineer","_vehClose","_hasVehicle","_unconscious","_lowBlood","_injured","_inPain","_legsBroke","_armsBroke","_charID","_friendlies","_playerMagazines","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_hasToolbox","_hasJerry","_hasJerryE","_hasEtool","_hasWire","_hasPainkillers","_unconscious_crew","_patients","_crew","_menClose","_hasPatient","_inVehicle","_isClose","_bag","_classbag","_isDisallowRefuel","_hasBarrel","_hasBarrelE"];
private ["_weaponName","_action","_turret","_weapons","_assignedRole","_action1","_action2","_x","_vehicle","_unit","_vehType","_displayName","_ammoQty","_ammoSerial","_weapon","_magTypes","_type","_typeVeh","_index","_inventory","_unitTo","_isEngineer","_vehClose","_hasVehicle","_unconscious","_lowBlood","_injured","_inPain","_legsBroke","_armsBroke","_charID","_friendlies","_playerMagazines","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_hasToolbox","_hasJerry","_hasJerryE","_hasWire","_hasPainkillers","_unconscious_crew","_patients","_crew","_menClose","_hasPatient","_inVehicle","_isClose","_bag","_classbag","_isDisallowRefuel","_hasBarrel","_hasBarrelE"];
if (TradeInprogress) exitWith {}; // Do not allow if any script is running.
@@ -65,7 +65,7 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco
_hasBarrel = "ItemFuelBarrel" in _playerMagazines;
_hasJerryE = "ItemJerrycanEmpty" in _playerMagazines;
_hasBarrelE = "ItemFuelBarrelEmpty" in _playerMagazines;
_hasEtool = "ItemEtool" in weapons player;
//_hasEtool = "ItemEtool" in weapons player;
_hasWire = "ItemWire" in _playerMagazines;
_hasPainkillers = "ItemPainkiller" in _playerMagazines;

View File

@@ -1,10 +1,12 @@
private ["_unit","_humanityHit","_myKills","_hit","_damage","_isPlayer","_unconscious","_wound","_isHit","_isInjured","_type","_hitPain","_isCardiac","_isHeadHit","_isMinor","_scale","_canHitFree","_rndPain","_rndInfection","_hitInfection","_lowBlood","_isPZombie","_source","_ammo","_unitIsPlayer"];
scriptName "Functions\misc\fn_damageHandler.sqf";
/***********************************************************
PROCESS DAMAGE TO A UNIT
- Function
- [unit, selectionName, damage, source, projectile] call fnc_usec_damageHandler;
************************************************************/
private["_unit","_humanityHit","_myKills","_isBandit","_hit","_damage","_isPlayer","_unconscious","_wound","_isHit","_isInjured","_type","_hitPain","_inPain","_isDead","_isCardiac","_killerID","_evType","_recordable","_isHeadHit","_isMinor","_scale","_canHitFree"];
private ["_unit","_humanityHit","_myKills","_hit","_damage","_isPlayer","_unconscious","_wound","_isHit","_isInjured","_type","_hitPain","_isCardiac","_isHeadHit","_isMinor","_scale","_canHitFree","_rndPain","_rndInfection","_hitInfection","_lowBlood","_isPZombie","_source","_ammo","_unitIsPlayer"];
_unit = _this select 0;
_hit = _this select 1;
_damage = _this select 2;
@@ -14,8 +16,8 @@ _ammo = _this select 4;
_type = [_damage,_ammo] call fnc_usec_damageType;
_isMinor = (_hit in USEC_MinorWounds);
_isHeadHit = (_hit == "head_hit");
_evType = "";
_recordable = false;
//_evType = "";
//_recordable = false;
_isPlayer = (isPlayer _source);
_humanityHit = 0;
_myKills = 0;
@@ -161,7 +163,7 @@ if (_damage > 0.4) then { //0.25
};
};
if ((_damage > 1.5) and _isHeadHit) then {
_id = [_source,"shothead"] spawn player_death;
[_source,"shothead"] spawn player_death;
};
};
if(!_isHit) then {
@@ -203,7 +205,7 @@ if (_type == 1) then {
if (_damage > 4) then {
//serious ballistic damage
if (_unitIsPlayer) then {
_id = [_source,"explosion"] spawn player_death;
[_source,"explosion"] spawn player_death;
};
} else {
if (_damage > 2) then {
@@ -222,7 +224,7 @@ if (_type == 2) then {
if (_damage > 4) then {
//serious ballistic damage
if (_unitIsPlayer) then {
_id = [_source,"shotheavy"] spawn player_death;
[_source,"shotheavy"] spawn player_death;
};
} else {
if (_damage > 2) then {

View File

@@ -4,12 +4,12 @@ scriptName "Functions\misc\fn_damageHandler.sqf";
- Function
- [unit, selectionName, damage, source, projectile] call fnc_usec_damageHandler;
************************************************************/
private["_unit","_hit","_damage","_unconscious","_wound","_isHit","_isInjured","_type","_hitPain","_inPain","_isDead","_isCardiac","_killerID","_evType","_recordable","_inVehicle","_isHeadHit","_isMinor","_total"];
private ["_unit","_hit","_damage","_total"];
_unit = _this select 0;
_hit = _this select 1;
_damage = _this select 2;
_source = _this select 3;
_ammo = _this select 4;
//_source = _this select 3;
//_ammo = _this select 4;
_total = _damage;
//diag_log ("DAMAGE VEH: " + typeof(_unit) + " / " + str(_hit) + " / " + str(_damage) + " / " + str(getDammage _unit));

View File

@@ -1,9 +1,9 @@
private["_unit1","_building","_type","_relPos","_boundingBox","_min","_max","_myX","_myY","_myZ","_inside"];
private ["_unit1","_building","_relPos","_boundingBox","_min","_max","_myX","_myY","_myZ","_inside"];
_unit1 = _this select 0;
//_building = _this select 1;
_building = nearestObject [player, "HouseBase"];
_type = typeOf _building;
//_type = typeOf _building;
_relPos = _building worldToModel (getPosATL _unit1);
_boundingBox = boundingBox _building;
//diag_log ("DEBUG: Building: " + str(_building) );

View File

@@ -18,7 +18,7 @@ scriptName "Functions\arrays\fn_selectRandomWeighted.sqf";
[*] Algorithm is inefficient?
*/
private ["_array", "_weights","_index","_weighted","_i"];
private ["_array","_weights","_index","_weighted"];
_array = _this select 0;
_weights = _this select 1;

View File

@@ -67,7 +67,7 @@ _v
_sign = [1,-1] select (_pitch < 0);
//cut off numbers above 180
while {abs _pitch > 180} do {_pitch = _sign*(abs _pitch - 180)};
while {abs _pitch > 180} do {_pitch = _sign*((abs _pitch) - 180)};
//we can't use pitch that is exactly equal to 90, because then the engine doesn't know what 2d compass direction the object is facing
if(abs _pitch == 90) then {_pitch = _sign*(89.9)};
@@ -102,7 +102,7 @@ _vdir = [_vdir, _yaw] call _rotate;
_sign = [1,-1] select (_bank < 0);
//cut off numbers above 360
while {abs _bank > 360} do {_bank = _sign*(abs _bank - 360)};
while {abs _bank > 360} do {_bank = _sign*((abs _bank) - 360)};
//reflect numbers above 180
if(abs _bank > 180) then {_sign = -1*_sign; _bank = (360-_bank)*_sign};

View File

@@ -14,7 +14,7 @@
Reference:
http://forums.bistudio.com/showthread.php?107476-How-do-I-detect-sundown-sunrise
*/
private ["_lat", "_day", "_hour"];
private ["_lat","_day","_hour","_daytime"];
_lat = -1 * getNumber(configFile >> "CfgWorlds" >> worldName >> "latitude");
_day = 360 * (dateToNumber date);
_hour = acos ((24 * sin(_lat) * cos(_day)) / ((12 * cos(_day) - 78) * cos(_lat)));

View File

@@ -1,5 +1,5 @@
//Assess Terrain
private["_unit","_pos","_type","_typeA","_soundType","_soundVal","_array","_test"];
private ["_unit","_pos","_type","_typeA","_soundType","_soundVal","_array"];
_unit = _this;
_pos = getPosATL _unit;
_type = surfaceType _pos;
@@ -7,7 +7,7 @@ _typeA = toArray _type;
_typeA set [0,"DEL"];
_typeA = _typeA - ["DEL"];
_type = toString _typeA;
_test = 0;
// _test = 0;
//diag_log ("FINDME: " + _type);

View File

@@ -19,7 +19,7 @@ Missing:
*/
private ["_looptime","_sun_factor","_building_factor","_vehicle_factor","_fire_factor","_water_factor","_rain_factor","_night_factor","_wind_factor","_height_mod","_difference","_hasfireffect","_isinbuilding","_isinvehicle","_raining","_sunrise","_building"];
private ["_looptime","_sun_factor","_building_factor","_vehicle_factor","_fire_factor","_water_factor","_rain_factor","_night_factor","_wind_factor","_height_mod","_difference","_isinbuilding","_isinvehicle","_raining","_sunrise","_building","_fireplaces","_daytime","_temp","_moving_factor"];
_looptime = _this;
@@ -38,7 +38,7 @@ Missing:
_wind_factor = -1;
_difference = 0;
_hasfireffect = false;
// _hasfireffect = false;
_isinbuilding = false;
_isinvehicle = false;
@@ -65,7 +65,7 @@ Missing:
if(({inflamed _x} count _fireplaces) > 0 && !_isinvehicle ) then {
//Math: factor * 1 / (0.5*(distance max 1)^2) 0.5 = 12.5% of the factor effect in a distance o 4 meters
_difference = _difference + (_fire_factor /(0.5*((player distance (_fireplaces select 0)) max 1)^2));
_hasfireffect = true;
//_hasfireffect = true;
};
//building
@@ -98,12 +98,12 @@ Missing:
s = sunrise
d = daytime
I: a = f / (12 - s)²
II: t = -a * (d - 12)² + f
I: a = f / (12 - s)<EFBFBD>
II: t = -a * (d - 12)<EFBFBD> + f
I + II =>
t = -(f / (12 - s)²) * (d - 12)² + f
t = -(f / (12 - s)<EFBFBD>) * (d - 12)<EFBFBD> + f
Parabel with highest Point( greatest Effect == _sun_factor) always at 12.00
Zero Points are always at sunrise and sunset -> Only Positiv Values Possible

View File

@@ -1,3 +1,4 @@
private ["_timeout","_isOnDeck","_isInLocation","_inVehicle","_bloodLow","_isHospital","_totalTimeout","_display","_ctrl1","_ctrl1Pos"];
disableSerialization;
if ((!r_player_handler1) and (r_handlerCount == 0)) then {
//Unconscious Meter
@@ -25,7 +26,7 @@ if ((!r_player_handler1) and (r_handlerCount == 0)) then {
sleep 1;
_isOnDeck = false; //getPos player in LHA_Deck;
_isInLocation = false; //getPos player in LHA_Location;
_inVehicle = (vehicle _unit != _unit);
_inVehicle = (vehicle player != player);
_bloodLow = ((r_player_blood/r_player_bloodTotal) < 0.5);
if ((surfaceIsWater (getPosASL player)) and !_isOnDeck and !_inVehicle) then {
player setpos [(getPosASL player select 0),(getPosASL player select 1),0.3];

View File

@@ -1,33 +1,31 @@
if ("ItemMap_Debug" in items player) then {
_world = toUpper(worldName);
_maptype = ["NameCityCapital","NameCity","NameVillage","NameLocal"];
_config = configFile >> "CfgWorlds" >> worldName >> "Names";
for "_i" from 0 to (count _config -1) do {
_class = _config select _i; //Returns a conif
_name = getText (_class >> "name");
_type = getText (_class >> "type");
_position = getArray (_class >> "position");
_radiusA = getNumber (_class >> "radiusA");
_radiusB = getNumber (_class >> "radiusB");
if (_type in _maptype) then {
diag_log(format["Config Type, Name: %1 / Type: %2 / Position: %3, Passed",_name,_type,_position]);
// _rnd = random 1;
// _chance = 0.6;
// if (_rnd < _chance) then {
_markerstr = createMarkerLocal ["markername_" +str (_name), _position];
_markerstr setMarkerTextLocal _name;
_markerstr setMarkerColorLocal "ColorGreen";
_markerstr setMarkerShapeLocal "ELLIPSE";
_markerstr setMarkerBrushLocal "Grid";
_markerstr setMarkerSizeLocal [_radiusA, _radiusB];
// };
};
};
};
private ["_markerstr","_class","_name","_type","_position","_radiusA","_radiusB","_maptype","_config"];
if ("ItemMap_Debug" in items player) then {
// _world = toUpper(worldName);
_maptype = ["NameCityCapital","NameCity","NameVillage","NameLocal"];
_config = configFile >> "CfgWorlds" >> worldName >> "Names";
for "_i" from 0 to (count _config -1) do {
_class = _config select _i; //Returns a conif
_name = getText (_class >> "name");
_type = getText (_class >> "type");
_position = getArray (_class >> "position");
_radiusA = getNumber (_class >> "radiusA");
_radiusB = getNumber (_class >> "radiusB");
if (_type in _maptype) then {

View File

@@ -1,6 +1,6 @@
private["_zombiebody","_qty","_type","_meat","_loop"];
private ["_zombiebody","_ehLoc"];
_zombiebody = _this select 0;
_qty = _this select 1;
// _qty = _this select 1;
if (local _zombiebody) then {
_zombiebody addMagazine "ItemZombieParts";

View File

@@ -1,4 +1,4 @@
private["_currentObjects","_currentTypes","_currentQty","_previousTypes","_previousQty","_serial","_itemVal","_itemQty","_oldSerial","_oldQty"];
private ["_currentObjects","_currentTypes","_currentQty","_previousTypes","_previousQty","_serial","_itemVal","_itemQty","_oldSerial","_oldQty","_change","_checkObjects"];
//_newObjects = [_previous,weapons player] call player_weaponCheck;
_currentObjects = _this select 0;
_checkObjects = _this select 1;

View File

@@ -1,4 +1,4 @@
private["_unit","_hp","_selection","_strH","_dam","_display"];
private ["_unit","_selection","_strH","_dam","_display","_id","_break","_ctrlFracture","_total","_damage"];
disableSerialization;
_unit = _this select 0;
_selection = _this select 1;

View File

@@ -1,11 +1,11 @@
private["_flare","_sfx","_isLocal","_lightArea","_lightSpark","_type","_color"];
private ["_flare","_lightArea","_lightSpark","_type","_color"];
_flare = _this select 0;
_type = _this select 1;
_sfx = objNull;
//_sfx = objNull;
if (!isNull _flare) then {
switch (_type) do {
case 0: {
_isLocal = local _flare;
//_isLocal = local _flare;
//Area Light
_lightArea = "#lightpoint" createVehicleLocal (getPosATL _flare);
_lightArea setLightColor [0.5,0,0]; //[0.1,0.005,0.005];

View File

@@ -1,4 +1,4 @@
private["_unit","_selection","_strH","_damage","_total"];
private ["_unit","_selection","_strH","_damage"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;

View File

@@ -1,4 +1,4 @@
private["_unit","_selection","_strH","_dam"];
private ["_unit","_selection","_strH","_dam"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
@@ -10,4 +10,4 @@ if (_selection != "") then {
_unit setHit[_selection,(_dam + _damage)];
};
};
_damage
_damage;

View File

@@ -1,4 +1,4 @@
private["_unit","_selection","_strH","_dam","_total"];
private ["_unit","_selection","_strH","_dam","_total"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
@@ -13,4 +13,4 @@ if ((_selection != "")) then {
} else {
_damage = 0;
};
_damage
_damage;

View File

@@ -1,4 +1,4 @@
private["_unit","_type","_chance","_rnd","_sound","_local","_dis"];
private ["_unit","_type","_chance","_rnd","_sound","_local","_dis","_num","_isWoman"];
_unit = _this select 0;
_type = _this select 1;
_chance = _this select 2;

View File

@@ -1,9 +1,9 @@
private["_unit","_killer","_type","_pos","_dir"];
private ["_unit"];
_unit = _this select 0;
_killer = _this select 1;
_type = typeOf _unit;
_pos = getposATL _unit;
_dir = direction _unit;
//_killer = _this select 1;
//_type = typeOf _unit;
//_pos = getposATL _unit;
//_dir = direction _unit;
if (local _unit) then {
deleteVehicle _unit;
};

View File

@@ -1,4 +1,4 @@
private["_unit","_distance","_i","_listTalk","_zombie","_targets","_pos"];
private ["_unit","_distance","_listTalk","_zombie","_targets","_pos","_doRun"];
//Alert Zed's to noise of shot
_unit = _this select 0;
_distance = _this select 1;

View File

@@ -1,5 +1,5 @@
private["_list","_animalssupported","_type","_root","_favouritezones","_randrefpoint","_PosList","_PosSelect","_Pos","_agent","_id","_pos","_near"];
private ["_list","_animalssupported","_type","_root","_favouritezones","_randrefpoint","_PosList","_PosSelect","_Pos","_agent","_id"];
_list = getposATL player nearEntities [["CAAnimalBase"],dayz_animalDistance];
if (count _list < dayz_maxAnimals) then {

View File

@@ -1,11 +1,11 @@
private["_lightOn","_vel","_speed","_pos","_scalePose","_scaleMvmt","_scaleLight","_scaleAlert","_anim","_anim4","_initial","_scaleSound","_nearFlare","_scaler","_nearLight","_nearFire","_building","_isPlayerInside","_audial"];
private ["_vel","_speed","_pos","_scalePose","_scaleMvmt","_scaleLight","_anim","_anim4","_initial","_scaleSound","_nearFlare","_scaler","_nearLight","_nearFire","_building","_isPlayerInside","_audial","_isWater","_isPZombie"];
_vel = velocity (vehicle player);
_speed = (_vel distance [0,0,0]);
_pos = getPosATL player;
_scalePose = 0.9;
_scaleMvmt = 0.2; //0.4;
_scaleLight = 0.5;
_scaleAlert = 1;
// _scaleAlert = 1;
_isPZombie = player isKindOf "PZombie_VB";
if(_isPZombie) exitWith { DAYZ_disAudial = 0; DAYZ_disVisual = 0; };

View File

@@ -1,4 +1,4 @@
private["_unit","_ammo","_audible","_distance","_listTalk","_weapon","_projectile","_vUp","_endPos","_dir","_height","_bolt","_hitArray","_hitObject","_hitSelection","_config","_hitMemoryPt","_variation","_val","_doLoop","_countr"];
private ["_unit","_ammo","_distance","_weapon","_projectile","_vUp","_endPos","_dir","_height","_bolt","_hitArray","_hitObject","_hitSelection","_config","_hitMemoryPt","_variation","_val","_doLoop","_countr","_magazine"];
_unit = _this select 0;
_weapon = _this select 1;
_ammo = _this select 4;

View File

@@ -1,4 +1,4 @@
private["_array","_source","_kills","_killsV","_humanity","_wait","_myKills","_infected"];
private ["_array","_source","_kills","_killsV","_humanity","_wait","_myKills","_infected","_canHitFree","_myHumanity","_method","_body","_playerID","_id","_myGroup"];
if (deathHandled) exitWith {};
deathHandled = true;

View File

@@ -1,4 +1,4 @@
private["_unit","_ammo","_audible","_distance","_listTalk","_weapon"];
private ["_unit","_ammo","_audible","_distance","_listTalk","_weapon","_group","_targets","_i","_projectile","_id","_caliber"];
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
_unit = _this select 0;
_weapon = _this select 1;

View File

@@ -1,4 +1,4 @@
private["_charID", "_friendlies", "_rcharID", "_rfriendlyTo", "_tag", "_player", "_newTagList"];
private ["_charID","_friendlies","_rcharID","_rfriendlyTo","_tag","_player","_newTagList","_position","_rfriendlies","_tagList"];
_charID = player getVariable ["characterID", "0"];
_friendlies = player getVariable ["friendlies", []];
_tagList = player getVariable ["tagList", []];

View File

@@ -1,4 +1,4 @@
private["_inventory","_wpns","_mags","_idc","_isOK","_val","_item","_x"];
private ["_inventory","_wpns","_mags","_idc","_isOK"];
_inventory = _this;
if (count _inventory > 0) then {
_wpns = _inventory select 0;

View File

@@ -1,4 +1,4 @@
private["_object","_change","_humanity","_timeStart"];
private ["_object","_change","_humanity","_wait"];
//Set Variables
_object = _this select 0;
_change = _this select 1;
@@ -14,7 +14,7 @@ if (_object == player) then {
waitUntil{!(player getVariable ["freeTarget",false])};
};
player setVariable ["freeTarget",true,true];
_timeStart = time;
//_timeStart = time;
sleep _wait;
player setVariable ["freeTarget",false,true];

View File

@@ -1,4 +1,4 @@
private["_updates","_playerUID","_charID","_humanity","_worldspace","_model","_friendlies"];
private ["_updates","_playerUID","_charID","_humanity","_worldspace","_model","_friendlies","_fractures","_old","_medical","_zombieKills","_headShots","_humanKills","_banditKills","_tagList"];
_playerUID = _this select 0;
_charID = _this select 1;
_model = _this select 2;

View File

@@ -1,4 +1,4 @@
private["_unit","_move","_damage","_wound","_sound","_local","_dir","_hpList","_hp","_strH","_dam","_total","_result","_vehicle"];
private ["_unit","_detail"];
_unit = _this select 0;
_detail = _this select 1;
if(_unit == getPlayerUID player) then {

View File

@@ -1,4 +1,4 @@
private["_zombie","_type","_chance","_rnd","_sound"];
private ["_sound","_num","_length","_pause"];
while {!r_player_dead} do {
_num = round(random 35);
_sound = "z_suspense_" + str(_num);

View File

@@ -1,4 +1,4 @@
private["_display","_btnRespawn","_btnAbort","_timeOut","_timeMax","_isDead"];
private ["_display","_btnRespawn","_btnAbort","_timeOut","_timeMax"];
disableSerialization;
waitUntil {
_display = findDisplay 49;
@@ -24,7 +24,7 @@ private["_display","_btnRespawn","_btnAbort","_timeOut","_timeMax","_isDead"];
switch true do {
case ({isPlayer _x} count (player nearEntities ["AllVehicles", 6]) > 1) : {
_btnAbort ctrlEnable false;
cutText [format[localize "str_abort_playerclose",_text], "PLAIN DOWN"];
cutText [localize "str_abort_playerclose", "PLAIN DOWN"];
};
case (_timeOut < _timeMax && count (player nearEntities ["zZombie_Base", 35]) > 0) : {
_btnAbort ctrlEnable false;
@@ -38,7 +38,7 @@ private["_display","_btnRespawn","_btnAbort","_timeOut","_timeMax","_isDead"];
case (player getVariable["combattimeout", 0] >= time) : {
_btnAbort ctrlEnable false;
//cutText ["Cannot Abort while in combat!", "PLAIN DOWN"];
cutText [format[localize "str_abort_playerincombat",_text], "PLAIN DOWN"];
cutText [localize "str_abort_playerincombat", "PLAIN DOWN"];
};
default {
_btnAbort ctrlEnable true;

View File

@@ -1,7 +1,7 @@
/*
[_obj] spawn player_packTent;
*/
private["_objectID","_objectUID","_obj","_ownerID","_dir","_pos","_object","_holder","_weapons","_magazines","_backpacks","_objWpnTypes","_objWpnQty","_countr"];
private ["_objectID","_objectUID","_obj","_ownerID","_dir","_pos","_object","_holder","_weapons","_magazines","_backpacks","_objWpnTypes","_objWpnQty","_countr","_alreadyPacking","_dis","_sfx","_classname","_location"];
if(TradeInprogress) exitWith { cutText ["Pack tent already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;

View File

@@ -1,10 +1,10 @@
private["_unit","_projectile","_isInCombat"];
private ["_unit","_projectile","_isInCombat","_currentNear","_projectilespeed","_projectflight","_listNear","_callCount","_nearVehicle"];
_unit = _this select 0;
_projectile = _this select 6;
diag_log ("0");
_isInComat = _unit getVariable["startcombattimer",0];
//_isInComat = _unit getVariable["startcombattimer",0];
diag_log ("Bullit Speed: " +str(Speed _projectile));
diag_log ("Bullit Velocity: " +str(velocity _projectile));

View File

@@ -1,6 +1,6 @@
private["_type","_isAir","_inVehicle","_dateNow","_maxZombies","_maxWildZombies","_age","_nearbyBuildings","_radius","_locationstypes","_nearestCity","_position","_nearbytype"];
private ["_type","_isAir","_inVehicle","_dateNow","_maxZombies","_maxWildZombies","_age","_radius","_position","_markerstr","_markerstr1","_markerstr2","_markerstr3","_nearByObj","_handle","_looted","_cleared","_zombied","_config","_canLoot","_dis","_players","_spawnZombies","_nearby","_nearbyCount"];
_type = _this select 0;
_Keepspawning = _this select 1;
//_Keepspawning = _this select 1;
_isAir = vehicle player iskindof "Air";
_inVehicle = (vehicle player != player);
_dateNow = (DateToNumber date);
@@ -8,7 +8,7 @@ _maxZombies = dayz_maxLocalZombies;
_maxWildZombies = 3;
_age = -1;
_nearbyBuildings = [];
//_nearbyBuildings = [];
_radius = 200;
_position = getPosATL player;

View File

@@ -1,4 +1,4 @@
private["_radius","_position","_inVehicle","_dateNow","_age","_locationstypes","_nearestCity","_nearbyBuildings","_nearby","_type","_config","_canZombie","_canLoot","_dis","_keepAwayDist","_isNoone","_looted","_cleared"];//_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _nearbyBuildings
private ["_radius","_position","_inVehicle","_dateNow","_age","_locationstypes","_nearestCity","_type","_looted","_cleared","_nearByObj","_handle","_x"];//_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _nearbyBuildings
_radius = _this select 0;
_position = _this select 1;

View File

@@ -1,13 +1,13 @@
private["_radius","_position","_inVehicle","_dateNow","_age","_locationstypes","_nearestCity","_maxZombies","_nearby","_maxWildZombies","_tooManyZs","_tooManyWildZs","_type","_config","_canZombie","_dis","_zombied","_bPos","_zombiesNum","_withinRange","_spawnWildZs"];
private ["_dateNow","_age","_zombied","_x"];
_radius = _this select 0;
_position = _this select 1;
_inVehicle = _this select 2;
//_radius = _this select 0;
//_position = _this select 1;
//_inVehicle = _this select 2;
_dateNow = _this select 3;
_age = _this select 4;
_locationstypes = _this select 5;
_nearestCity = _this select 6;
_maxZombies = _this select 7;
//_locationstypes = _this select 5;
//_nearestCity = _this select 6;
//_maxZombies = _this select 7;
_zombied = (_x getVariable ["zombieSpawn",-0.1]);

View File

@@ -1,4 +1,4 @@
private["_class","_position","_dir","_group","_oldUnit","_newUnit","_currentWpn","_muzzles","_currentAnim","_currentCamera"];
private ["_class","_position","_dir","_group","_oldUnit","_newUnit","_currentWpn","_muzzles","_currentAnim","_playerUID","_weapons","_magazines","_primweapon","_secweapon","_newBackpackType","_backpackWpn","_backpackMag","_backpackWpnTypes","_backpackWpnQtys","_countr","_backpackmagTypes","_backpackmagQtys","_playerObjName"];
_class = _this;
_position = getPosATL player;
@@ -128,7 +128,7 @@ private ["_newBackpackType","_backpackWpn","_backpackMag"];
if (!isNil "_newBackpackType") then {
if (_newBackpackType != "") then {
_newUnit addBackpack _newBackpackType;
_oldBackpack = dayz_myBackpack;
//_oldBackpack = dayz_myBackpack;
dayz_myBackpack = unitBackpack _newUnit;

View File

@@ -1,8 +1,8 @@
private["_target", "_caller", "_id", "_params", "_pos"];
private ["_target","_id","_pos","_dog","_fsmid","_hasRawMeat","_hasdog"];
_target = _this select 0;
_caller = _this select 1;
//_caller = _this select 1;
_id = _this select 2;
_params = _this select 3;
//_params = _this select 3;
_pos = position _target;
_hasRawMeat = "FoodSteakRaw" in magazines player;
_hasdog = player getVariable ["dogid", "false"];
@@ -11,11 +11,12 @@ if ((_hasRawMeat) && (_hasdog == "false")) then {
player removeMagazine "FoodSteakRaw";
deleteVehicle (_this select 0);
_dog = (group player) createUnit [typeOf _target, _pos, [], 0, "FORM"];
player setvariable ["dogid", _fsmid];
_dog disableAI "FSM";
_fsmid = [_dog, typeOf _target] execFSM "\z\addons\dayz_code\system\dog_agent.fsm";
_fsmid setFSMVariable ["_handle", _fsmid];
_target removeAction _id;
player setvariable ["dogid", _fsmid];
} else {
cutText ["You must have RawMeat", "PLAIN DOWN"];
};

View File

@@ -1,4 +1,4 @@
private["_unit","_ammo","_audible","_distance","_listTalk","_weapon","_projectile","_vUp","_endPos","_dir","_height","_bolt","_hitArray","_hitObject","_hitSelection","_config","_hitMemoryPt","_variation","_val","_doLoop","_countr"];
private ["_unit","_ammo","_distance","_weapon","_projectile","_endPos","_dir","_doWait","_vel"];
_unit = _this select 0;
_weapon = _this select 1;
_ammo = _this select 4;

View File

@@ -1,4 +1,4 @@
private["_display","_ctrlBlood","_ctrlBleed","_bloodVal","_ctrlFood","_ctrlThirst","_thirstVal","_foodVal","_ctrlTemp","_tempVal","_combatVal","_array","_ctrlEar","_ctrlEye"/*,"_ctrlHumanity"*/,"_ctrlCombat","_ctrlFracture","_visualText","_visual","_audibleText","_audible"];
private ["_display","_ctrlBlood","_ctrlBleed","_bloodVal","_ctrlFood","_ctrlThirst","_thirstVal","_foodVal","_ctrlTemp","_tempVal","_combatVal","_array","_ctrlEar","_ctrlEye","_ctrlCombat","_ctrlFracture","_visualText","_visual","_audibleText","_audible","_blood","_thirstLvl","_foodLvl","_tempImg","_thirst","_food","_temp","_bloodLvl","_tempLvl"];
disableSerialization;
_foodVal = 1 - (dayz_hunger / SleepFood);
@@ -85,7 +85,7 @@ _ctrlTemp ctrlSetText _temp;
Visual:
*/
_visualtext = "";
_visual = round((dayz_disVisual / 100) * 4) min 5;
_visual = (round((dayz_disVisual / 100) * 4)) min 5;
if (_visual > 0) then {_visualtext = "\z\addons\dayz_code\gui\val_" + str(_visual) + "_ca.paa"};
_ctrlEye ctrlSetText _visualtext;
@@ -93,7 +93,7 @@ _ctrlEye ctrlSetText _visualtext;
Audible:
*/
_audibletext = "";
_audible = round((dayz_disAudial / 50) * 4) min 5;
_audible = (round((dayz_disAudial / 50) * 4)) min 5;
if (_audible > 0) then {_audibletext = "\z\addons\dayz_code\gui\val_" + str(_audible) + "_ca.paa"};
_ctrlEar ctrlSetText _audibletext;

View File

@@ -1,4 +1,4 @@
private["_currentObjects","_newObjects","_checkObjects"];
private ["_currentObjects","_newObjects","_checkObjects","_type","_qtyNow","_qtyBefore"];
//_newObjects = [_previous,weapons player] call player_weaponCheck;
_currentObjects = _this select 0;
_checkObjects = _this select 1;
@@ -33,4 +33,4 @@ _newObjects = [];
};
} forEach _checkObjects;
_change
_change;

View File

@@ -1,5 +1,5 @@
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
private["_unit","_magazine","_used","_quantity","_magsNet","_magsWhole","_key","_result","_evType","_recordable","_inVehicle","_isPlayer","_isRocket","_dmgDistance","_isBallistic","_handled"];
private ["_unit","_evType","_recordable","_inVehicle","_isPlayer","_isRocket","_dmgDistance","_isBallistic","_handled","_id","_firer","_distance","_weapon","_ammo","_killerID","_arc","_turretDir","_weaponDir","_pos1","_pos2","_facing","_firingArc","_isInFront","_isInRear"];
//Init
//[unit, firer, distance, weapon, muzzle, mode, ammo]
_unit = _this select 0;

View File

@@ -1,18 +1,19 @@
private["_unit","_targets","_move","_damage","_wound","_index","_cnt","_sound","_local","_dir","_hpList","_hp","_strH","_dam","_total","_vehicle","_tPos","_zPos","_cantSee","_inAngle"];
private ["_unit","_targets","_move","_damage","_wound","_index","_cnt","_dir","_hpList","_hp","_strH","_dam","_total","_vehicle","_tPos","_zPos","_cantSee","_inAngle","_rnd","_openVehicles","_chance","_attackanimations","_type"];
_unit = _this select 0;
_type = _this select 1;
_vehicle = (vehicle player);
_targets = _unit getVariable ["targets",[]];
//if (!(_vehicle in _targets)) exitWith {};
if (dayz_zedsAttackVehicles and !(_vehicle in _targets)) exitWith {};
//Do the attack
if (r_player_unconscious && _vehicle == player && _type == "zombie") then {
_rnd = round(random 4) + 1;
_rnd = (round(random 4)) + 1;
_move = "ZombieFeed" + str(_rnd);
} else {
if (_type == "zombie") then {
_rnd = round(random 9) + 1;
_rnd = (round(random 9)) + 1;
_move = "ZombieStandingAttack" + str(_rnd);
} else {
_move = "Dog_Attack";

View File

@@ -1,4 +1,4 @@
private["_listTalk","_isZombie","_group","_eyeDir","_attacked","_continue","_type","_chance","_last","_audial","_distance","_refObj","_list","_scaleMvmt","_scalePose","_scaleLight","_anim","_activators","_nearFire","_nearFlare","_scaleAlert","_inAngle","_scaler","_initial","_tPos","_zPos","_cantSee"];
private ["_listTalk","_group","_eyeDir","_attacked","_continue","_type","_chance","_last","_refObj","_inAngle","_tPos","_zPos","_cantSee","_entHeight","_delta","_targets","_lowBlood","_pHeight"];
_refObj = vehicle player;
_listTalk = (getPos _refObj) nearEntities ["zZombie_Base",80];
_pHeight = (getPosATL _refObj) select 2;
@@ -10,13 +10,14 @@ _attacked = false;
{
_continue = true;
_type = "zombie";
_targets = _group getVariable ["targets",[]];
if (alive _x && _continue) then {
private["_dist"];
_dist = (_x distance _refObj);
_group = _x;
_targets = _group getVariable ["targets",[]];
_chance = 1;
if ((_x distance player < dayz_areaAffect) and !(animationState _x == "ZombieFeed")) then {
if (_type == "zombie") then { [_x,"attack",(_chance),true] call dayz_zombieSpeak; };

View File

@@ -1,4 +1,4 @@
private["_characterID","_currentModelCheck","_temp","_isSync","_currentWpn","_currentMag","_magazines","_qty","_qtyT","_val","_isNewPos","_isNewBackp","_humanity","_isNewGear","_doUpdate","_currentModel","_modelChk","_playerPos","_playerGear","_playerBackp","_backpack","_updates","_killsB","_killsH","_medical","_isNewMed","_character","_timeSince","_charPos","_isInVehicle","_justAte","_justDrank","_distanceFoot","_lastPos","_legs","_arms","_kills","_headShots","_killsCHK","_headShotsCHK","_timeGross","_timeLeft","_onLadder","_isTerminal"];
private ["_characterID","_temp","_isSync","_currentWpn","_currentMag","_magazines","_qty","_qtyT","_val","_isNewPos","_isNewBackp","_humanity","_isNewGear","_doUpdate","_currentModel","_modelChk","_playerPos","_playerGear","_playerBackp","_backpack","_updates","_killsB","_killsH","_medical","_isNewMed","_character","_timeSince","_charPos","_isInVehicle","_justAte","_justDrank","_distanceFoot","_lastPos","_kills","_headShots","_timeGross","_timeLeft","_onLadder","_isTerminal","_vehicle","_wounds","_currentAnim","_muzzles","_array","_key","_lastTime","_config","_currentState"];
_character = _this;
_doUpdate = false;
_characterID = _character getVariable ["characterID","0"];

View File

@@ -1,4 +1,4 @@
private["_iItem","_iClass","_iPos","_radius","_itemTypes","_index","_item","_qty","_max","_tQty","_canType","_weights","_cntWeights","_dateNow","_iPosZ"];
private ["_iItem","_iClass","_iPos","_radius","_itemTypes","_index","_item","_qty","_max","_tQty","_canType","_weights","_cntWeights","_dateNow","_mags"];
_iItem = _this select 0;
_iClass = _this select 1;
_iPos = _this select 2;
@@ -22,11 +22,11 @@ switch (_iClass) do {
if(_iClass == "clothes" or _iClass == "militaryclothes" or _iClass == "specialclothes") then {
_max = 1;
} else {
_max = ceil(random 2) + 1;
_max = (ceil(random 2)) + 1;
};
while {_qty < _max} do {
_tQty = round(random 1) + 1;
_tQty = (round(random 1)) + 1;
_index = floor(random _cntWeights);
_index = _weights select _index;
_canType = _itemTypes select _index;

View File

@@ -1,6 +1,5 @@
//diag_log "running location check...";
{
private ["_location","_distCfg","_configClass","_distAct","_config","_position"];
{private ["_location","_distCfg","_configClass","_distAct","_config","_position"];
_location = _x select 0;
_distCfg = (_x select 2) + 200;
_configClass = _x select 1;

View File

@@ -13,7 +13,7 @@
_dog = Intended target of the script.
*/
private["_target", "_caller", "_id", "_dog", "_pos", "_fsmid"];
private ["_target","_caller","_id","_dog","_fsmid","_animalID"];
_target = _this select 0;
_caller = _this select 1;
_id = _this select 2;

View File

@@ -1,4 +1,4 @@
private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_uiControl"];
private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType"];
disableSerialization;
_control = _this select 0;
_button = _this select 1;