Update vanilla building

Vanilla commits:

9b2092c9f7

674624d122
This commit is contained in:
ebaydayz
2016-11-25 16:25:26 -05:00
parent 1097eaba0c
commit b6d88b1329
13 changed files with 161 additions and 172 deletions

View File

@@ -1,6 +1,6 @@
class ItemMetalSheet: CA_Magazine class ItemMetalSheet: CA_Magazine //Construection,farm,indestrial,castle
{ {
scope = public; scope = 2;
count = 1; count = 1;
type = 256; type = 256;
displayName = $STR_BLD_name_ItemMetalSheet;//"Corrugated Sheet" displayName = $STR_BLD_name_ItemMetalSheet;//"Corrugated Sheet"
@@ -8,9 +8,10 @@ class ItemMetalSheet: CA_Magazine
model = "z\addons\dayz_buildings\models\sheet_metal.p3d"; model = "z\addons\dayz_buildings\models\sheet_metal.p3d";
descriptionShort = $STR_BLD_desc_ItemMetalSheet;//"Metal Sheeting" descriptionShort = $STR_BLD_desc_ItemMetalSheet;//"Metal Sheeting"
}; };
class ItemConcreteBlock: CA_Magazine
class ItemConcreteBlock: CA_Magazine //Construection,indestrial
{ {
scope = public; scope = 2;
count = 1; count = 1;
type = 256; type = 256;
displayName = $STR_BLD_name_ItemConcreteBlock;//"Concrete Block" displayName = $STR_BLD_name_ItemConcreteBlock;//"Concrete Block"
@@ -18,9 +19,10 @@ class ItemConcreteBlock: CA_Magazine
model = "z\addons\dayz_buildings\models\concreteblock.p3d"; model = "z\addons\dayz_buildings\models\concreteblock.p3d";
descriptionShort = $STR_BLD_desc_ItemConcreteBlock;//"Concrete Block" descriptionShort = $STR_BLD_desc_ItemConcreteBlock;//"Concrete Block"
}; };
class ItemRSJ: CA_Magazine
class ItemRSJ: CA_Magazine //Construection,farm,indestrial,castle
{ {
scope = public; scope = 2;
count = 1; count = 1;
type = 256; type = 256;
displayName = $STR_BLD_name_ItemRSJ;//"Steel Beam" displayName = $STR_BLD_name_ItemRSJ;//"Steel Beam"
@@ -28,13 +30,41 @@ class ItemRSJ: CA_Magazine
model = "z\addons\dayz_buildings\models\rsj.p3d"; model = "z\addons\dayz_buildings\models\rsj.p3d";
descriptionShort = $STR_BLD_desc_ItemRSJ;//"Steel RSJ Support Beam" descriptionShort = $STR_BLD_desc_ItemRSJ;//"Steel RSJ Support Beam"
}; };
class ItemScrews: CA_Magazine
class ItemScrews: CA_Magazine //Construection,farm,indestrial,castle,residential
{ {
scope = public; scope = 2;
count = 1;
type = 256;
displayName = "Loose Screws";//"Box of screws for metal"
picture = "\z\addons\dayz_buildings\equip\item_screws.paa";
model = "z\addons\dayz_buildings\models\screws.p3d";
descriptionShort = $STR_BLD_desc_ItemScrews;//"Box of screws"
};
class ItemBagScrews: CA_Magazine//Construection,indestrial,supermarket
{
scope = 2;
count = 1; count = 1;
type = 256; type = 256;
displayName = $STR_BLD_name_ItemScrews;//"Box of screws for metal" displayName = $STR_BLD_name_ItemScrews;//"Box of screws for metal"
picture = "\z\addons\dayz_buildings\equip\item_screws.paa"; picture = "\z\addons\dayz_buildings\equip\item_screws.paa";
model = "z\addons\dayz_buildings\models\screws.p3d"; model = "z\addons\dayz_buildings\models\screws.p3d";
descriptionShort = $STR_BLD_desc_ItemScrews;//"Box of screws" descriptionShort = $STR_BLD_desc_ItemScrews;//"Box of screws"
class ItemActions {
class Spilt {
text = "Spilt Box";
script = "; [_this] call fn_spiltBag;";
};
};
}; };
/*
ItemScrews //Construection,farm,indestrial,castle,residential
ItemBagScrews //(LowChance)Construection,(LowChance)indestrial,supermarket
ItemRSJ //Construection,farm,indestrial,castle
ItemConcreteBlock //Construection,indestrial
ItemMetalSheet //Construection,farm,indestrial,castle
*/

View File

@@ -108,7 +108,7 @@ if (_startMaintenance) then {
//publicVariableServer "PVDZ_object_replace"; //publicVariableServer "PVDZ_object_replace";
}; };
_cursorTarget setVariable["Maintenance",true,true]; _cursorTarget setVariable["Maintenance",false,true];
localize "str_maintenanceDone" call dayz_rollingMessages; localize "str_maintenanceDone" call dayz_rollingMessages;
}; };

View File

@@ -1,5 +1,5 @@
private ["_brokein","_isOk","_hasSledgeHammer","_gps","_vars","_hasToolbox","_hasCrowbar","_limit","_proceed","_counter", private ["_brokein","_isOk","_hasSledgeHammer","_gps","_vars","_hasToolbox","_hasCrowbar","_limit","_proceed","_counter",
"_dis","_sfx","_roll","_animState","_started","_finished","_isMedic","_isGate"]; "_dis","_sfx","_roll","_animState","_started","_finished","_isMedic","_isGate","_values"];
_target = _this select 3; _target = _this select 3;
_pos = getPos _target; _pos = getPos _target;
@@ -25,6 +25,15 @@ _proceed = false;
_counter = 0; _counter = 0;
_brokein = false; _brokein = false;
//[ChanceToBreakin,SledgeChance,CowbarChance]
_values = switch (1==1) do {
case (_isWoodenGate): { [0.04,0.30,0.20] };
case (_isMetalGate): { [0.02,0.60,0.40] };
default { [] };
};
if ( (count _values) == 0 ) exitwith {};
while {_isOk} do { while {_isOk} do {
//Check if we have the tools to start //Check if we have the tools to start
_hasSledgeHammer = "ItemSledge" in items player; _hasSledgeHammer = "ItemSledge" in items player;
@@ -88,9 +97,8 @@ while {_isOk} do {
//Add to Counter //Add to Counter
_counter = _counter + 1; _counter = _counter + 1;
if (_isMetalGate) then {
//start chance to gain access. //start chance to gain access.
if ([0.02] call fn_chance) then { if ([(_values select 0)] call fn_chance) then {
_isOk = false; _isOk = false;
_proceed = true; _proceed = true;
_brokein = true; _brokein = true;
@@ -98,19 +106,9 @@ while {_isOk} do {
}; };
}; };
if (_isWoodenGate) then {
if ([0.04] call fn_chance) then {
_isOk = false;
_proceed = true;
_brokein = true;
_target setVariable ["isOpen", "1", true];
};
};
};
if (dayz_toolBreaking) then { if (dayz_toolBreaking) then {
//Chances to damage tools //Chances to damage tools
if ([0.30] call fn_chance) then { if ([(_values select 1)] call fn_chance) then {
player removeWeapon "ItemSledge"; player removeWeapon "ItemSledge";
player addMagazine "ItemSledgeHandle"; player addMagazine "ItemSledgeHandle";
player addMagazine "ItemSledgeHead"; player addMagazine "ItemSledgeHead";
@@ -118,7 +116,7 @@ while {_isOk} do {
localize "STR_BLD_BREAKIN_BROKEN_SLEDGE" call dayz_rollingMessages; localize "STR_BLD_BREAKIN_BROKEN_SLEDGE" call dayz_rollingMessages;
}; };
if ([0.20] call fn_chance) then { if ([(_values select 2)] call fn_chance) then {
player removeWeapon "ItemCrowbar"; player removeWeapon "ItemCrowbar";
player addWeapon "ItemCrowbarBent"; player addWeapon "ItemCrowbarBent";

View File

@@ -10,39 +10,43 @@ private["_obj","_total","_damage"];
//Object the EH is assigned too //Object the EH is assigned too
_obj = _this select 0; _obj = _this select 0;
//Total damage of the object
_total = (damage _obj);
//Modify damage done based on level of fence if !((_this select 4) in ["PipeBomb","explosive_bolt","Hatchet_Swing_Ammo","Crowbar_Swing_Ammo","Machete_Swing_Ammo"]) exitwith { false };
_damage = switch (1==1) do { _damage = switch (1==1) do {
case ((typeof _obj) in ["WoodenFence_3","WoodenFence_4","WoodenFence_5","WoodenFence_6","WoodenFence_7","WoodenGate_2","WoodenGate_3","WoodenGate_4"]): { 0.5 }; case ((_this select 4) in ["PipeBomb"]): { 0.5 }; //High explosive
//case ((typeof _obj) in ["WoodenFence_6","WoodenFence_7","WoodenGate_4"]): { 0.35 }; case ((_this select 4) in ["explosive_bolt"]): { 0.25 }; //Medium explosive, maybe grenades and other such items.
default { 1 }; case ((_this select 4) in ["Hatchet_Swing_Ammo","Crowbar_Swing_Ammo","Machete_Swing_Ammo"]): { 0.00001 }; //Melee damage
default { 0 };
}; };
//Is the object local //Server running or client
if (local _obj) then { if (isServer) then {
//is damage being done aboue 0 (should always be) not needed. if !(_obj in needUpdate_FenceObjects) then {
if (_damage > 0) then { needUpdate_FenceObjects set [count needUpdate_FenceObjects, _obj];
//Server running or client
if (!isServer) then {
//If its a client send to server get the ownering player and send damage to that player
PVDZ_veh_Save = [_obj,"objWallDamage",(_total + _damage)];
publicVariableServer "PVDZ_veh_Save";
} else {
//Server running the EH, update object to db
[_obj,"objWallDamage",(_total + _damage)] call server_updateObject;
};
}; };
//TotalDamage Set by the server
_obj setDamage (damage _obj) + _damage;
//diag_log format["Server Reporting - %1",needUpdate_FenceObjects];
} else { } else {
//send to server then back to owning client/server //If its a client send to server for saving and damage setting.
PVDZ_send = [_obj,"objWallDamage",_this]; PVDZ_fence_Update = [_obj,(damage _obj) + _damage];
publicVariableServer "PVDZ_send"; publicVariableServer "PVDZ_fence_Update";
//diag_log ("Client Reporting");
}; };
//Logging. //} else {
diag_log format["INFO - %1(%3) - %2(%4)",_obj,_damage,(typeof _obj),_total]; // //We really coulde just send to server and have the server setDamage
// //send to server then back to owning client/server
// PVDZ_send = [_obj,"objWallDamage",_this];
// publicVariableServer "PVDZ_send";
//};
diag_log format["Object: %1, Damage:%2(%4), Projectile:%3",typeof (_this select 0),((damage _obj) + _damage),(_this select 4),(damage _obj)];
// all "HandleDamage event" functions should return the effective damage that the engine will record for that part // all "HandleDamage event" functions should return the effective damage that the engine will record for that part
0 false

View File

@@ -35,7 +35,8 @@ if (!isNull _cursorTarget and !_inVehicle and (player distance _cursorTarget < 4
//building System //building System
_text = getText (configFile >> "CfgVehicles" >> typeOf _cursorTarget >> "displayName"); _text = getText (configFile >> "CfgVehicles" >> typeOf _cursorTarget >> "displayName");
if ((_cursorTarget iskindof "DZ_buildables") and isText(configFile >> "CfgVehicles" >> (typeOf _cursorTarget) >> "Upgrade" >> "create") and !_ownerBuildLock) then { /*
if ((_cursorTarget iskindof "DZ_buildables") and !_ownerBuildLock) then {
if (s_player_building < 0) then { if (s_player_building < 0) then {
if (isText (configFile >> "CfgVehicles" >> (typeof _cursorTarget) >> "Upgrade" >> "create")) then { if (isText (configFile >> "CfgVehicles" >> (typeof _cursorTarget) >> "Upgrade" >> "create")) then {
s_player_building = player addAction [format[localize "str_upgrade",_text], "\z\addons\dayz_code\actions\object_upgradebuilding.sqf",_cursorTarget, 0, false, true, "",""]; s_player_building = player addAction [format[localize "str_upgrade",_text], "\z\addons\dayz_code\actions\object_upgradebuilding.sqf",_cursorTarget, 0, false, true, "",""];
@@ -54,6 +55,7 @@ if (!isNull _cursorTarget and !_inVehicle and (player distance _cursorTarget < 4
player removeAction s_player_maintenance; player removeAction s_player_maintenance;
s_player_maintenance = -1; s_player_maintenance = -1;
}; };
*/
if ((((getPlayerUID player) in _ownerArray) or (count _ownerArray == 0) or ((typeof _cursorTarget) in ["WoodenFence_1_foundation","WoodenGate_foundation"])) and !_ownerBuildLock) then { if ((((getPlayerUID player) in _ownerArray) or (count _ownerArray == 0) or ((typeof _cursorTarget) in ["WoodenFence_1_foundation","WoodenGate_foundation"])) and !_ownerBuildLock) then {

View File

@@ -81,12 +81,13 @@ if (isServer) then {
"PVDZ_plr_SwitchMove" addPublicVariableEventHandler {((_this select 1) select 0) switchMove ((_this select 1) select 1);}; //Needed to execute switchMove on server machine. rSwitchMove only executes on other clients "PVDZ_plr_SwitchMove" addPublicVariableEventHandler {((_this select 1) select 0) switchMove ((_this select 1) select 1);}; //Needed to execute switchMove on server machine. rSwitchMove only executes on other clients
"PVDZ_obj_Publish" addPublicVariableEventHandler {(_this select 1) call server_publishObj}; //Used by built items (Epoch and Vanilla) "PVDZ_obj_Publish" addPublicVariableEventHandler {(_this select 1) call server_publishObj}; //Used by built items (Epoch and Vanilla)
"PVDZ_veh_Save" addPublicVariableEventHandler {(_this select 1) call server_updateObject}; "PVDZ_veh_Save" addPublicVariableEventHandler {(_this select 1) call server_updateObject};
"PVDZ_fence_Update" addPublicVariableEventHandler {(_this select 1) call server_addtoFenceUpdateArray};
"PVDZ_plr_Login1" addPublicVariableEventHandler {_id = (_this select 1) call server_playerLogin}; "PVDZ_plr_Login1" addPublicVariableEventHandler {_id = (_this select 1) call server_playerLogin};
"PVDZ_plr_Login2" addPublicVariableEventHandler {(_this select 1) call server_playerSetup}; "PVDZ_plr_Login2" addPublicVariableEventHandler {(_this select 1) call server_playerSetup};
"PVDZ_plr_LoginRecord" addPublicVariableEventHandler {_id = (_this select 1) spawn dayz_recordLogin}; "PVDZ_plr_LoginRecord" addPublicVariableEventHandler {_id = (_this select 1) spawn dayz_recordLogin};
"PVDZ_obj_Destroy" addPublicVariableEventHandler {(_this select 1) call server_deleteObj}; "PVDZ_obj_Destroy" addPublicVariableEventHandler {(_this select 1) call server_deleteObj};
"PVDZ_send" addPublicVariableEventHandler {(_this select 1) call server_sendToClient}; "PVDZ_send" addPublicVariableEventHandler {(_this select 1) call server_sendToClient};
"PVDZ_dayzCarBomb" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\actions\detonate_bomb.sqf";}; //"PVDZ_dayzCarBomb" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\actions\detonate_bomb.sqf";};
//[player,[medical Array]]; //[player,[medical Array]];
"PVDZ_playerMedicalSync" addPublicVariableEventHandler { (_this select 1) call server_medicalSync; ((_this select 1) select 0) setVariable["Medical",((_this select 1) select 1),false]; }; //diag_log format["%1 - %2",((_this select 1) select 0),((_this select 1) select 1)]; }; "PVDZ_playerMedicalSync" addPublicVariableEventHandler { (_this select 1) call server_medicalSync; ((_this select 1) select 0) setVariable["Medical",((_this select 1) select 1),false]; }; //diag_log format["%1 - %2",((_this select 1) select 0),((_this select 1) select 1)]; };

View File

@@ -569,6 +569,7 @@ TimeOutDisplayed = false;
if (isServer) then { if (isServer) then {
dead_bodyCleanup = []; dead_bodyCleanup = [];
needUpdate_objects = []; needUpdate_objects = [];
needUpdate_FenceObjects = [];
//dayz_spawnCrashSite_clutterCutter=0; // helicrash spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass //dayz_spawnCrashSite_clutterCutter=0; // helicrash spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass
//dayz_spawnInfectedSite_clutterCutter=0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass //dayz_spawnInfectedSite_clutterCutter=0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass
//Objects to remove when killed. //Objects to remove when killed.

View File

@@ -1716,11 +1716,11 @@
<German>Bauansicht deaktiviert.</German> <German>Bauansicht deaktiviert.</German>
</Key> </Key>
<Key ID="str_maintenance"> <Key ID="str_maintenance">
<English>%1 Maintenance</English> <English>Maintenance</English>
<Russian>%1 Обслуживание</Russian> <Russian>Обслуживание</Russian>
<French>Entretien de la %1</French> <French>Entretien de la</French>
<Czech>Údržba %1</Czech> <Czech>Údržba</Czech>
<German>%1 - Wartung</German> <German>Wartung</German>
</Key> </Key>
<Key ID="str_disassembly"> <Key ID="str_disassembly">
<English>%1 Disassembly</English> <English>%1 Disassembly</English>

View File

@@ -158,15 +158,17 @@ _object_damage = {
//Walls //Walls
_objWallDamage = { _objWallDamage = {
private "_key"; private ["_key","_damage"];
_damage = _this select 2; _damage = (damage _object);
_object setDamage _damage;
if (_objectID == "0") then { if (_objectID == "0") then {
_key = format["CHILD:306:%1:%2:%3:",_objectUID,[],_damage]; _key = format["CHILD:306:%1:%2:%3:",_objectUID,[],_damage];
} else { } else {
_key = format["CHILD:306:%1:%2:%3:",_objectID,[],_damage]; _key = format["CHILD:306:%1:%2:%3:",_objectID,[],_damage];
}; };
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite; _key call server_hiveWrite;
}; };

View File

@@ -8,16 +8,6 @@ _owner = owner _unit;
//diag_log format ["%1, %2, %3, %4", _unit, _variable, _arraytosend, _owner]; //diag_log format ["%1, %2, %3, %4", _unit, _variable, _arraytosend, _owner];
switch (_variable) do { switch (_variable) do {
case "objWallDamage": {
_object = _arraytosend select 0;
if (local _object) then {
_arraytosend call fnc_Obj_FenceHandleDam;
} else {
PVCDZ_obj_Damage = _arraytosend;
_owner publicVariableClient "PVCDZ_obj_Damage";
};
};
case "VehHandleDam": { case "VehHandleDam": {
_vehicle = _arraytosend select 0; _vehicle = _arraytosend select 0;
if (local _vehicle) then { if (local _vehicle) then {

View File

@@ -79,6 +79,20 @@ dayz_Achievements = {
_player setVariable ["Achievements",_achievements]; _player setVariable ["Achievements",_achievements];
}; };
*/ */
//Send fences to this array to be synced to db, should prove to be better performaince wise rather then updaing each time they take damage.
server_addtoFenceUpdateArray = {
//Potential problem no current way to say what is setting the damage.
if ((_this select 0) isKindOf "DZ_buildables") then {
(_this select 0) setDamage (_this select 1);
if !((_this select 0) in needUpdate_FenceObjects) then {
needUpdate_FenceObjects set [count needUpdate_FenceObjects, (_this select 0)];
};
};
};
vehicle_handleServerKilled = { vehicle_handleServerKilled = {
private ["_unit","_killer"]; private ["_unit","_killer"];
_unit = _this select 0; _unit = _this select 0;

View File

@@ -5,15 +5,14 @@ item0[] = {"init",0,250,-75.000000,-425.000000,25.000000,-375.000000,0.000000,"i
item1[] = {"true",8,218,-75.000000,-200.000000,25.000000,-150.000000,0.000000,"true"}; item1[] = {"true",8,218,-75.000000,-200.000000,25.000000,-150.000000,0.000000,"true"};
item2[] = {"waiting",2,250,-75.000000,-125.000000,25.000000,-75.000000,0.000000,"waiting"}; item2[] = {"waiting",2,250,-75.000000,-125.000000,25.000000,-75.000000,0.000000,"waiting"};
item3[] = {"true",8,218,-75.000000,250.000000,25.000000,300.000000,0.000000,"true"}; item3[] = {"true",8,218,-75.000000,250.000000,25.000000,300.000000,0.000000,"true"};
item4[] = {"",7,210,-129.000015,271.000000,-120.999977,279.000031,0.000000,""}; item4[] = {"",7,210,-204.000015,271.000000,-195.999985,279.000031,0.000000,""};
item5[] = {"",7,210,-129.000000,-104.000000,-120.999992,-96.000000,0.000000,""}; item5[] = {"",7,210,-204.000015,-104.000000,-196.000000,-96.000000,0.000000,""};
item6[] = {"initialized",4,218,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"initialized"}; item6[] = {"initialized",4,218,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"initialized"};
item7[] = {"prepare",2,250,-75.000000,-275.000000,25.000000,-225.000000,0.000000,"prepare"}; item7[] = {"prepare",2,250,-75.000000,-275.000000,25.000000,-225.000000,0.000000,"prepare"};
item8[] = {"update_objects",2,4346,-75.000000,75.000000,25.000000,125.000000,0.000000,"update objects"}; item8[] = {"update_objects",2,250,-125.000000,75.000000,-25.000000,125.000000,0.000000,"update objects"};
item9[] = {"Objects_need_upd",4,218,-75.000000,0.000000,25.000000,50.000000,1.000000,"Objects" \n "need update"}; item9[] = {"Objects_need_upd",4,218,-125.000000,0.000000,-25.000000,50.000000,1.000000,"Objects" \n "need update"};
item10[] = {"",7,210,58.500000,-104.000000,66.500000,-96.000000,0.000000,""}; item10[] = {"FenceObjects_need",4,218,-25.000000,0.000000,75.000000,50.000000,1.000000,"FenceObjects" \n "need update"};
item11[] = {"",7,210,58.500031,271.000000,66.499969,279.000000,0.000000,""}; item11[] = {"update_objects_1",2,250,-25.000000,75.000000,75.000000,125.000000,0.000000,"update objects"};
item12[] = {"New_Cleanup_Obje",2,250,375.000000,75.000000,475.000000,125.000000,0.000000,"New Cleanup" \n "Objects"};
link0[] = {0,6}; link0[] = {0,6};
link1[] = {1,2}; link1[] = {1,2};
link2[] = {2,9}; link2[] = {2,9};
@@ -27,8 +26,8 @@ link9[] = {8,3};
link10[] = {9,8}; link10[] = {9,8};
link11[] = {10,11}; link11[] = {10,11};
link12[] = {11,3}; link12[] = {11,3};
globals[] = {25.000000,1,0,0,0,640,480,1,13,6316128,1,-520.235962,640.978394,444.212921,-448.684845,779,598,1}; globals[] = {25.000000,1,0,0,0,640,480,1,15,6316128,1,-520.235962,640.978394,444.212921,-448.684845,779,598,1};
window[] = {2,-1,-1,-1,-1,858,130,1459,130,3,797}; window[] = {2,-1,-1,-32000,-32000,780,52,1381,52,3,797};
*//*%FSM</HEAD>*/ *//*%FSM</HEAD>*/
class FSM class FSM
{ {
@@ -64,26 +63,26 @@ class FSM
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links class Links
{ {
/*%FSM<LINK "FenceObjects_need">*/
class FenceObjects_need
{
priority = 1.000000;
to="update_objects_1";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(( (count needUpdate_FenceObjects) > 0) && (diag_tickTime -_lastfenceUpdate> 5) && (!isNil ""sm_done""))"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_lastfenceUpdate = diag_tickTime;"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Objects_need_upd">*/ /*%FSM<LINK "Objects_need_upd">*/
class Objects_need_upd class Objects_need_upd
{ {
priority = 1.000000; priority = 1.000000;
to="update_objects"; to="update_objects";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(( (count needUpdate_objects) > 0) && (diag_tickTime -_lastNeedUpdate> 5) && (!isNil ""sm_done""))"/*%FSM</CONDITION""">*/; condition=/*%FSM<CONDITION""">*/"(( (count needUpdate_objects) > 0) && (diag_tickTime -_lastVehicleUpdate> 5) && (!isNil ""sm_done""))"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_lastNeedUpdate = diag_tickTime;"/*%FSM</ACTION""">*/; action=/*%FSM<ACTION""">*/"_lastNeedUpdate = diag_tickTime;"/*%FSM</ACTION""">*/;
}; };
/*%FSM</LINK>*/ /*%FSM</LINK>*/
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="waiting";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
}; };
}; };
/*%FSM</STATE>*/ /*%FSM</STATE>*/
@@ -94,7 +93,8 @@ class FSM
init = /*%FSM<STATEINIT""">*/"diag_log (""CLEANUP: INITIALIZING Vehicle SCRIPT"");" \n init = /*%FSM<STATEINIT""">*/"diag_log (""CLEANUP: INITIALIZING Vehicle SCRIPT"");" \n
"" \n "" \n
"" \n "" \n
"_lastNeedUpdate = diag_tickTime;" \n "_lastVehicleUpdate = diag_tickTime;" \n
"_lastfenceUpdate = diag_tickTime;" \n
"" \n "" \n
"" \n "" \n
""/*%FSM</STATEINIT""">*/; ""/*%FSM</STATEINIT""">*/;
@@ -141,83 +141,30 @@ class FSM
}; };
}; };
/*%FSM</STATE>*/ /*%FSM</STATE>*/
/*%FSM<STATE "New_Cleanup_Obje">*/ /*%FSM<STATE "update_objects_1">*/
class New_Cleanup_Obje class update_objects_1
{ {
name = "New_Cleanup_Obje"; name = "update_objects_1";
init = /*%FSM<STATEINIT""">*/"diag_log ""DEBUG: New_Cleanup_Obje ""; " \n init = /*%FSM<STATEINIT""">*/"diag_log format[""INFO: needUpdate_FenceObjects=%1"",needUpdate_FenceObjects];" \n
"_lootingrids = [];" \n
"" \n "" \n
"{" \n "{" \n
" _loc = _x select 0;" \n " needUpdate_FenceObjects = needUpdate_FenceObjects - [_x];" \n
" _ref = _x select 1;" \n " [_x,""objWallDamage""] call server_updateObject;" \n
"" \n "} forEach needUpdate_FenceObjects;" \n
" _nearBy = nearestObjects [_loc, [""ReammoBox""], 1500];" \n
" {" \n
" _lootingrids set [count _lootingrids,[_x,_ref]];" \n
" } foreach _nearBy;" \n
"" \n
" dayz_deseedloot set [0,-1];" \n
" dayz_deseedloot = dayz_deseedloot - [-1];" \n
"" \n
"}foreach dayz_deseedloot;" \n
"" \n
"_qty = count _lootingrids;" \n
"diag_log (""CLEANUP:TOTAL "" + str(_qty) + "" LOOT BAGS"");" \n
"" \n
"_delQty = 0;" \n
"_delQtyDroped = 0;" \n
"_delQtySpawned = 0;" \n
"_delQtyPerma = 0;" \n
"" \n
"{" \n
" " \n
" _obj = _x select 0;" \n
" _ref = _x select 1;" \n
"" \n
" diag_log format [""%1,%2"", _obj, _ref];" \n
"" \n
" _Dropped = (_obj getVariable [""Dropped"",false]);" \n
" _Spawned = (_obj getVariable [""spawnedLoot"",false]);" \n
" _Perma = (_obj getVariable [""permaLoot"",false]);" \n
"" \n
" if (!_Spawned and !_Perma) then {" \n
" _obj setVariable [""Dropped"",true];" \n
" };" \n
"" \n
" //Dropped loot" \n
" if (_Dropped) then {" \n
" " \n
" [""Dropped_Loot"",_obj,_ref] call server_systemCleanup;" \n
" _delQtyDroped = _delQtyDroped + 1;" \n
"" \n
" };" \n
"" \n
" //Spawned Loot" \n
" if (_Spawned) then {" \n
"" \n
" [""Spawned_Loot"",_obj,_ref] call server_systemCleanup;" \n
" _delQtySpawned = _delQtySpawned + 1; " \n
" " \n
" };" \n
"" \n
" //Permaloot" \n
" if (_Perma) then {" \n
"" \n
" _delQtyPerma = _delQtyPerma + 1;" \n
"" \n
" };" \n
"" \n
"} foreach _lootingrids;" \n
"" \n
"if ((_delQtySpawned > 0) or (_delQtyDroped > 0) or (_delQtyPerma > 0)) then {" \n
" //diag_log (""CLEANUP: DELETED "" + str(_delQty) + "" LOOT BAGS"");" \n
" diag_log format [""CLEANUP: (DELETED, DroppedLoot: %1, SpawnedLoot: %2), (KEPT, PermaLoot: %3)"", _delQtyDroped, _delQtySpawned, _delQtyPerma];" \n
"};" \n
""/*%FSM</STATEINIT""">*/; ""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links class Links
{ {
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="waiting";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
}; };
}; };
/*%FSM</STATE>*/ /*%FSM</STATE>*/

View File

@@ -30,7 +30,7 @@
5 "playableUnits" !"for [{_y=0},{_y < count(playableUnits)},{_y=_y+1}] do {" !"typeName player == \"OBJECT\")}) AND {((player in playableUnits) AND {(alive player)" !"(1 max count playableUnits)) min (dayz_maxAnimals - _count))) to 1 step -1 do {" !"AND {((alive _x) AND {((vehicle _x) distance _obj < 150)})}} count playableUnits)}) then {" !="_local = { _unit distance _x < _dis; } count playableUnits <= 1;" !"if (!_isOk) exitWith {false};\nuiSleep 0.001;\n} forEach playableUnits;" !"ManagementMustBeClose) then { player nearEntities [\"CAManBase\", 10] } else { playableUnits };" 5 "playableUnits" !"for [{_y=0},{_y < count(playableUnits)},{_y=_y+1}] do {" !"typeName player == \"OBJECT\")}) AND {((player in playableUnits) AND {(alive player)" !"(1 max count playableUnits)) min (dayz_maxAnimals - _count))) to 1 step -1 do {" !"AND {((alive _x) AND {((vehicle _x) distance _obj < 150)})}} count playableUnits)}) then {" !="_local = { _unit distance _x < _dis; } count playableUnits <= 1;" !"if (!_isOk) exitWith {false};\nuiSleep 0.001;\n} forEach playableUnits;" !"ManagementMustBeClose) then { player nearEntities [\"CAManBase\", 10] } else { playableUnits };"
5 "selectPlayer" !"dayz_originalPlayer enableSimulation true;\naddSwitchableUnit dayz_originalPlayer;\nsetPlayable dayz_originalPlayer;\nselectPlayer dayz_originalPlayer;" !"addSwitchableUnit _newUnit;\nsetPlayable _newUnit;\nselectPlayer _newUnit;" 5 "selectPlayer" !"dayz_originalPlayer enableSimulation true;\naddSwitchableUnit dayz_originalPlayer;\nsetPlayable dayz_originalPlayer;\nselectPlayer dayz_originalPlayer;" !"addSwitchableUnit _newUnit;\nsetPlayable _newUnit;\nselectPlayer _newUnit;"
5 "serverCommand" !="_character = if (serverCommandAvailable \"#kick\") then { call sched_tg_follow } else { player };" !"serverCommand (\"#kick \" + _selectedName);" 5 "serverCommand" !="_character = if (serverCommandAvailable \"#kick\") then { call sched_tg_follow } else { player };" !"serverCommand (\"#kick \" + _selectedName);"
5 "setDamage" !"([4654,9595,0] nearestObject 145259) setDamage 1;\n([4654,9595,0] nearestObject 145260) setDamage 1;" !"if (_entity isKindOf \"Animal\") then {\n_entity setDamage 1;" !"_tree setDamage 1;\ndayz_choppedTrees set [count dayz_choppedTrees,_tree];" !="if ((alive player) && (r_fracture_legs or {player isKindOf 'PZombie_VB'})) then { player SetDamage 1;};" !"_id = [player,20,true,getPosATL player] call player_alertZombies;\nuiSleep 0.5;\nplayer setDamage 1;" !"if(\"\" == typeOf _tree) then {\n_tree setDamage 1;\n};" !"if (_ent isKindOf \"Animal\" || _ent isKindOf \"zZombie_base\") then {\n_ent setDamage 1;" 5 "setDamage" !"([4654,9595,0] nearestObject 145259) setDamage 1;\n([4654,9595,0] nearestObject 145260) setDamage 1;" !"if (_entity isKindOf \"Animal\") then {\n_entity setDamage 1;" !"_tree setDamage 1;\ndayz_choppedTrees set [count dayz_choppedTrees,_tree];" !="if ((alive player) && (r_fracture_legs or {player isKindOf 'PZombie_VB'})) then { player SetDamage 1;};" !"_id = [player,20,true,getPosATL player] call player_alertZombies;\nuiSleep 0.5;\nplayer setDamage 1;" !"\n_obj setDamage (damage _obj) + _damage;\n" !"if(\"\" == typeOf _tree) then {\n_tree setDamage 1;\n};" !"if (_ent isKindOf \"Animal\" || _ent isKindOf \"zZombie_base\") then {\n_ent setDamage 1;"
5 "setDammage" 5 "setDammage"
5 "SetEventHandler" !="_menu ctrlSetEventHandler [\"ButtonClick\",_compile];" !="inGameUISetEventHandler [\"PrevAction\",\"false\"];" !="inGameUISetEventHandler [\"NextAction\",\"false\"];" !="inGameUISetEventHandler [\"Action\",\"false\"];" 5 "SetEventHandler" !="_menu ctrlSetEventHandler [\"ButtonClick\",_compile];" !="inGameUISetEventHandler [\"PrevAction\",\"false\"];" !="inGameUISetEventHandler [\"NextAction\",\"false\"];" !="inGameUISetEventHandler [\"Action\",\"false\"];"
5 "setMarkerAlpha" 5 "setMarkerAlpha"