Jump to content
  • 0

hanging on boot after adding self actions


Lanmanfm

Question

I am at a loss here... I usually don't mess with adding any scripts where I have to mess with the self actions, but it was requested by my clan to add some stuff...

 

I am trying to add the self blood, remove clothing, zombie taunt, knockout and fire dancing. it just hangs on the last little bit of the boot and never goes any further.

 

I am going to remove the zombie taunt, sicne it is built for 1.7.7.1 code and see if that makes a difference.

 

what I really want to know is if anyone has had luck with some of these scripts running on 1.0.1.5.

 

 

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

OK, ran into some major issues... I pulled the dayz code from github. it is apparently NOT 1.0.1.5. when using it, it breaks traders and also says that it is missing a plant script, vehicle script and something else...

 

Does anyone have the dayz code files for 1.0.1.5 that would be willing to share?

 

I tried unPBOing the dayz_code PBO from my game cache and get an error about a header block.

Link to comment
Share on other sites

  • 0

fn_selfactions.sqf

scriptName "Functions\misc\fn_selfActions.sqf";
/***********************************************************
	ADD ACTIONS FOR SELF
	- Function
	- [] call fnc_usec_selfActions;
************************************************************/
private ["_temp_keys","_magazinesPlayer","_isPZombie","_vehicle","_inVehicle","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_canmove","_Unlock","_lock","_buy","_dogHandle","_lieDown","_warn","_hastinitem","_allowedDistance","_menu","_menu1","_humanity_logic","_low_high","_cancel","_metals_trader","_traderMenu","_isWreck","_isRemovable","_isDisallowRepair","_rawmeat","_humanity","_speed","_dog","_hasbottleitem","_isAir","_isShip","_playersNear","_findNearestGens","_findNearestGen","_IsNearRunningGen","_cursorTarget","_isnewstorage","_itemsPlayer","_ownerKeyId","_typeOfCursorTarget","_hasKey","_oldOwner","_combi","_key_colors","_player_deleteBuild"];

if (TradeInprogress) exitWith {}; // Do not allow if any script is running.

_vehicle = vehicle player;
_isPZombie = player isKindOf "PZombie_VB";
_inVehicle = (_vehicle != player);

_onLadder =		(getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);

_nearLight = 	nearestObject [player,"LitObject"];
_canPickLight = false;
if (!isNull _nearLight) then {
	if (_nearLight distance player < 4) then {
		_canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
	};
};

//Grab Flare
if (_canPickLight and !dayz_hasLight and !_isPZombie) then {
	if (s_player_grabflare < 0) then {
		_text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
		s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
		s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
	};
} else {
	player removeAction s_player_grabflare;
	player removeAction s_player_removeflare;
	s_player_grabflare = -1;
	s_player_removeflare = -1;
};

if(DZEdebug) then {
	hint str(typeOf cursorTarget);
	if (s_player_debuglootpos < 0) then {
		s_player_debuglootpos = player addAction ["Save to arma2.rpt", "\z\addons\dayz_code\actions\debug\Make_lootPos.sqf", ["start"], 99, false, true, "",""];
		s_player_debuglootpos1 = player addAction ["Raise Z", "\z\addons\dayz_code\actions\debug\Make_lootPos.sqf", ["up"], 99, false, true, "",""];
		s_player_debuglootpos2 = player addAction ["Lower Z", "\z\addons\dayz_code\actions\debug\Make_lootPos.sqf", ["down"], 99, false, true, "",""];
		s_player_debuglootpos3 = player addAction ["Raise Z", "\z\addons\dayz_code\actions\debug\Make_lootPos.sqf", ["up_small"], 99, false, true, "",""];
		s_player_debuglootpos4 = player addAction ["Lower Z", "\z\addons\dayz_code\actions\debug\Make_lootPos.sqf", ["down_small"], 99, false, true, "",""];
		Base_Z_height = 0.5;
	};
};

if(_isPZombie) then {
	if (s_player_callzombies < 0) then {
		s_player_callzombies = player addAction ["Raise Horde", "\z\addons\dayz_code\actions\call_zombies.sqf",player, 5, true, false, "",""];
	};
	if (s_player_pzombiesattack < 0) then {
		s_player_pzombiesattack = player addAction ["Attack", "\z\addons\dayz_code\actions\pzombie\pz_attack.sqf",cursorTarget, 6, true, false, "",""];
	};
	if (s_player_pzombiesvision < 0) then {
		s_player_pzombiesvision = player addAction ["Night Vision", "\z\addons\dayz_code\actions\pzombie\pz_vision.sqf", [], 4, false, true, "nightVision", "_this == _target"];
	};
	if (!isNull cursorTarget and (player distance cursorTarget < 3)) then {	//Has some kind of target
		_isAnimal = cursorTarget isKindOf "Animal";
		_isZombie = cursorTarget isKindOf "zZombie_base";
		_isHarvested = cursorTarget getVariable["meatHarvested",false];
		_isMan = cursorTarget isKindOf "Man";
		// Pzombie Gut human corpse or animal
		if (!alive cursorTarget and (_isAnimal or _isMan) and !_isZombie and !_isHarvested) then {
			if (s_player_pzombiesfeed < 0) then {
				s_player_pzombiesfeed = player addAction ["Feed", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",cursorTarget, 3, true, false, "",""];
			};
		} else {
			player removeAction s_player_pzombiesfeed;
			s_player_pzombiesfeed = -1;
		};
	} else {
		player removeAction s_player_pzombiesfeed;
		s_player_pzombiesfeed = -1;
	};
};

// Increase distance only if AIR OR SHIP
_allowedDistance = 4;
_isAir = cursorTarget isKindOf "Air";
_isShip = cursorTarget isKindOf "Ship";
if(_isAir or _isShip) then {
	_allowedDistance = 6;
};

if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cursorTarget < _allowedDistance) and _canDo) then {	//Has some kind of target
	
	// set cursortarget to variable
	_cursorTarget = cursorTarget;
	
	// get typeof cursortarget once
	_typeOfCursorTarget = typeOf _cursorTarget;

	_isVehicle = _cursorTarget isKindOf "AllVehicles";
	_isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"];
	_isnewstorage = _typeOfCursorTarget in DZE_isNewStorage;
	
	// get items and magazines only once
	_magazinesPlayer = magazines player;

	//boiled Water
	_hasbottleitem = "ItemWaterbottle" in _magazinesPlayer;
	_hastinitem = false;
	{
		if (_x in _magazinesPlayer) then {
			_hastinitem = true;
		};
	} forEach boil_tin_cans;
	_hasFuelE = 	"ItemJerrycanEmpty" in _magazinesPlayer;

	_itemsPlayer = items player;
	
	_temp_keys = [];
	// find available keys
	_key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
	{
		if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then {
			_ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid");
			_temp_keys set [count _temp_keys,str(_ownerKeyId)];
		};
	} forEach _itemsPlayer;

	_hasKnife = 	"ItemKnife" in _itemsPlayer;
	_hasToolbox = 	"ItemToolbox" in _itemsPlayer;

	_isMan = _cursorTarget isKindOf "Man";
	_traderType = _typeOfCursorTarget;
	_ownerID = _cursorTarget getVariable ["characterID","0"];
	_isAnimal = _cursorTarget isKindOf "Animal";
	_isDog =  (_cursorTarget isKindOf "DZ_Pastor" || _cursorTarget isKindOf "DZ_Fin");
	_isZombie = _cursorTarget isKindOf "zZombie_base";
	_isDestructable = _cursorTarget isKindOf "BuiltItems";
	_isWreck = _typeOfCursorTarget in DZE_isWreck;
	_isRemovable = _typeOfCursorTarget in DZE_isRemovable;
	_isDisallowRepair = _typeOfCursorTarget in ["M240Nest_DZ"];

	_isTent = _cursorTarget isKindOf "TentStorage";
	
	_isAlive = alive _cursorTarget;
	_canmove = canmove _cursorTarget;
	_text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
	
	_rawmeat = meatraw;
	_hasRawMeat = false;
	{
		if (_x in _magazinesPlayer) then {
			_hasRawMeat = true;
		};
	} forEach _rawmeat; 
	
	_isFuel = false;
	if (_hasFuelE) then {
		{
			if(_cursorTarget isKindOf _x) exitWith {_isFuel = true;};
		} forEach dayz_fuelsources;
	};

	// diag_log ("OWNERID = " + _ownerID + " CHARID = " + dayz_characterID + " " + str(_ownerID == dayz_characterID));
	
	//Allow player to delete objects
	_player_deleteBuild = false;
	if(_isAlive) then {
		if(_isDestructable or _isWreck or _isRemovable) then {
			if(_hasToolbox and "ItemCrowbar" in _itemsPlayer) then {
				_player_deleteBuild = true;
			};
		};
	};

	if(_player_deleteBuild) then {
		if (s_player_deleteBuild < 0) then {
			s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
		};
	} else {
		player removeAction s_player_deleteBuild;
		s_player_deleteBuild = -1;
	};

	
	// Allow Owner to lock and unlock vehicle  
	if(_isVehicle and _isAlive and !_isMan and _ownerID != "0") then {
		if (s_player_lockUnlock_crtl < 0) then {
			_hasKey = _ownerID in _temp_keys;
			_oldOwner = (_ownerID == dayz_playerUID);
			if(locked _cursorTarget) then {
				if(_hasKey or _oldOwner) then {
					_Unlock = player addAction [format["Unlock %1",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",_cursorTarget, 2, true, true, "", ""];
					s_player_lockunlock set [count s_player_lockunlock,_Unlock];
					s_player_lockUnlock_crtl = 1;
				} else {
					_Unlock = player addAction ["<t color='#ff0000'>Vehicle Locked</t>", "",_cursorTarget, 2, true, true, "", ""];
					s_player_lockunlock set [count s_player_lockunlock,_Unlock];
					s_player_lockUnlock_crtl = 1;
				};
			} else {
				if(_hasKey or _oldOwner) then {
					_lock = player addAction [format["Lock %1",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
					s_player_lockunlock set [count s_player_lockunlock,_lock];
					s_player_lockUnlock_crtl = 1;
				};
			};
		};
		 
	} else {
		{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
		s_player_lockUnlock_crtl = -1;
	};

	if(DZE_AllowForceSave) then {
		//Allow player to force save
		if((_isVehicle or _isTent) and !_isMan) then {
			if (s_player_forceSave < 0) then {
				s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, true, true, "", ""];
			};
		} else {
			player removeAction s_player_forceSave;
			s_player_forceSave = -1;
		};
	};
	
	If(DZE_AllowCargoCheck) then {
		if((_isVehicle or _isTent or _isnewstorage) and _isAlive and !_isMan) then {
			if (s_player_checkGear < 0) then {
				s_player_checkGear = player addAction ["Cargo Check", "\z\addons\dayz_code\actions\cargocheck.sqf",_cursorTarget, 1, true, true, "", ""];
			};
		} else {
			player removeAction s_player_checkGear;
			s_player_checkGear = -1;
		};
	};
	

	//flip vehicle small vehicles by your self and all other vehicles with help nearby
	if (_isVehicle and !_canmove and _isAlive and (player distance _cursorTarget >= 2) and (count (crew _cursorTarget))== 0 and ((vectorUp _cursorTarget) select 2) < 0.5) then {
		_playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]);
		if(_isVehicletype or (_playersNear >= 2)) then {
			if (s_player_flipveh  < 0) then {
				s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true, "", ""];		
			};	
		};
	} else {
		player removeAction s_player_flipveh;
		s_player_flipveh = -1;
	};
	
	//Allow player to fill jerrycan
	if(_hasFuelE and _isFuel) then {
		if (s_player_fillfuel < 0) then {
			s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",[], 1, false, true, "", ""];
		};
	} else {
		player removeAction s_player_fillfuel;
		s_player_fillfuel = -1;
	};
	
	// Human Gut animal or zombie
	if (!alive _cursorTarget and (_isAnimal or _isZombie) and _hasKnife) then {
		_isHarvested = _cursorTarget getVariable["meatHarvested",false];
		if (s_player_butcher < 0 and !_isHarvested) then {
			if(_isZombie) then {
				s_player_butcher = player addAction ["Gut Zombie", "\z\addons\dayz_code\actions\gather_zparts.sqf",_cursorTarget, 3, true, true, "", ""];
			} else {
				s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",_cursorTarget, 3, true, true, "", ""];
			};
		};
		
	} else {
		player removeAction s_player_butcher;
		s_player_butcher = -1;
	};
	
	//Fireplace Actions check
	if (inflamed _cursorTarget and _hasRawMeat) then {
		if (s_player_cook < 0) then {
			s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, true, true, "", ""];
		};
	} else {
		player removeAction s_player_cook;
		s_player_cook = -1;
	};
	if (inflamed _cursorTarget and (_hasbottleitem and _hastinitem)) then {
		if (s_player_boil < 0) then {
			s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, true, true, "", ""];
		};
	} else {
		player removeAction s_player_boil;
		s_player_boil = -1;
	};
	
	if(_cursorTarget == dayz_hasFire) then {
		if ((s_player_fireout < 0) and !(inflamed _cursorTarget) and (player distance _cursorTarget < 3)) then {
			s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",_cursorTarget, 0, false, true, "",""];
		};
	} else {
		player removeAction s_player_fireout;
		s_player_fireout = -1;
	};
	
	//Packing my tent
	if(_cursorTarget isKindOf "TentStorage" and _ownerID == dayz_characterID) then {
		if ((s_player_packtent < 0) and (player distance _cursorTarget < 3)) then {
			s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true, "",""];
		};
	} else {
		player removeAction s_player_packtent;
		s_player_packtent = -1;
	};

	//Allow owner to unlock vault
	if((_typeOfCursorTarget == "VaultStorageLocked" or _typeOfCursorTarget == "VaultStorage") and _ownerID != "0" and (player distance _cursorTarget < 3)) then {
		if (s_player_unlockvault < 0) then {
			if(_typeOfCursorTarget == "VaultStorageLocked") then {
				if(_ownerID == dayz_combination or _ownerID == dayz_playerUID) then {
					_combi = player addAction ["Open Safe", "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true, "",""];
				} else {
					_combi = player addAction ["Unlock Safe", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
				};
				s_player_combi set [count s_player_combi,_combi];
				s_player_unlockvault = 1;
			} else {
				if(_ownerID != dayz_combination and _ownerID != dayz_playerUID) then {
					_combi = player addAction ["Enter Combo", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""];
					s_player_combi set [count s_player_combi,_combi];
					s_player_unlockvault = 1;
				};
			};
		};
	} else {
		{player removeAction _x} forEach s_player_combi;s_player_combi = [];
		s_player_unlockvault = -1;
	};

	//Allow owner to pack vault
	if(_typeOfCursorTarget == "VaultStorage" and _ownerID != "0" and (player distance _cursorTarget < 3)) then {

		if (s_player_lockvault < 0) then {
			if(_ownerID == dayz_combination or _ownerID == dayz_playerUID) then {
				s_player_lockvault = player addAction ["Lock Safe", "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, false, true, "",""];
			};
		};
		if (s_player_packvault < 0 and (_ownerID == dayz_combination or _ownerID == dayz_playerUID)) then {
			s_player_packvault = player addAction ["<t color='#ff0000'>Pack Safe</t>", "\z\addons\dayz_code\actions\vault_pack.sqf",_cursorTarget, 0, false, true, "",""];
		};
	} else {
		player removeAction s_player_packvault;
		s_player_packvault = -1;
		player removeAction s_player_lockvault;
		s_player_lockvault = -1;
	};

	

    //Player Deaths
	if(_typeOfCursorTarget == "Info_Board_EP1") then {
		if ((s_player_information < 0) and (player distance _cursorTarget < 3)) then {
			s_player_information = player addAction ["Recent Deaths", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 0, false, true, "",""];
		};
	} else {
		player removeAction s_player_information;
		s_player_information = -1;
	};
	
	//Fuel Pump
	if(_typeOfCursorTarget in dayz_fuelpumparray) then {	
		if ((s_player_fuelauto < 0) and (player distance _cursorTarget < 3)) then {
			
			// check if Generator_DZ is running within 30 meters
			_findNearestGens = nearestObjects [player, ["Generator_DZ"], 30];
			_findNearestGen = [];
			{
				if (alive _x and (_x getVariable ["GeneratorRunning", false])) then {
					_findNearestGen set [(count _findNearestGen),_x];
				};
			} foreach _findNearestGens;
			_IsNearRunningGen = count (_findNearestGen);
			
			// show that pump needs power if no generator nearby.
			if(_IsNearRunningGen > 0) then {
				s_player_fuelauto = player addAction ["Fill Vehicle", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",[], 0, false, true, "",""];
			} else {
				s_player_fuelauto = player addAction ["<t color='#ff0000'>Needs Power</t>", "",[], 0, false, true, "",""];
			};
		};
	} else {
		player removeAction s_player_fuelauto;
		s_player_fuelauto = -1;
	};

	//Start Generator
	if(_cursorTarget isKindOf "Generator_DZ") then {
		if ((s_player_fillgen < 0) and (player distance _cursorTarget < 3)) then {
			
			// check if not running 
			if((_cursorTarget getVariable ["GeneratorRunning", false])) then {
				s_player_fillgen = player addAction ["Stop Generator", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, false, true, "",""];				
			} else {
			// check if not filled and player has jerry.
				if((_cursorTarget getVariable ["GeneratorFilled", false])) then {
					s_player_fillgen = player addAction ["Start Generator", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""];
				} else {
					if("ItemJerrycan" in _magazinesPlayer) then {
						s_player_fillgen = player addAction ["Fill and Start Generator", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""];
					};
				};
			};
		};
	} else {
		player removeAction s_player_fillgen;
		s_player_fillgen = -1;
	};

    //Sleep
	if(_cursorTarget isKindOf "TentStorage" and _ownerID == dayz_characterID) then {
		if ((s_player_sleep < 0) and (player distance _cursorTarget < 3)) then {
			s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true, "",""];
		};
	} else {
		player removeAction s_player_sleep;
		s_player_sleep = -1;
	};
	
	//Repairing Vehicles
	if ((dayz_myCursorTarget != _cursorTarget) and _isVehicle and !_isMan and _hasToolbox and (damage _cursorTarget < 1) and !_isDisallowRepair) then {
		if (s_player_repair_crtl < 0) then {
			dayz_myCursorTarget = _cursorTarget;
			_menu = dayz_myCursorTarget addAction ["Repair Vehicle", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
			_menu1 = dayz_myCursorTarget addAction ["Salvage Vehicle", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
			s_player_repairActions set [count s_player_repairActions,_menu];
			s_player_repairActions set [count s_player_repairActions,_menu1];
			s_player_repair_crtl = 1;
		} else {
			{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
			s_player_repair_crtl = -1;
		};
	};

	// All Traders
	if (_isMan and !_isPZombie and _traderType in serverTraders) then {
		
		if (s_player_parts_crtl < 0) then {

			// get humanity
			_humanity = player getVariable ["humanity",0];
			_traderMenu = call compile format["menu_%1;",_traderType];

			// diag_log ("TRADER = " + str(_traderMenu));
			
			_low_high = "low";
			_humanity_logic = false;
			if((_traderMenu select 2) == "friendly") then {
				_humanity_logic = (_humanity < -5000);
			};
			if((_traderMenu select 2) == "hostile") then {
				_low_high = "high";
				_humanity_logic = (_humanity > -5000);
			};
			if((_traderMenu select 2) == "hero") then {
				_humanity_logic = (_humanity < 5000);
			};
			if(_humanity_logic) then {
				_cancel = player addAction [format["Your humanity is too %1 this trader refuses to talk to you.",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
				s_player_parts set [count s_player_parts,_cancel];
			} else {
				
				// Static Menu
				{
					diag_log format["DEBUG TRADER: %1", _x];
					_buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true, "",""];
					s_player_parts set [count s_player_parts,_buy];
				
				} forEach (_traderMenu select 1);
				// Database menu 
				{
					_buy = player addAction [(_x select 0), "\z\addons\dayz_code\actions\buy_or_sell.sqf",[(_x select 1),(_x select 0)], 99, true, false, "",""];
					s_player_parts set [count s_player_parts,_buy];
				} forEach (_traderMenu select 0);
				
				// Add static metals trader options under sub menu
				_metals_trader = player addAction ["Trade Metals", "\z\addons\dayz_code\actions\trade_metals.sqf",["na"], 0, true, false, "",""];
				s_player_parts set [count s_player_parts,_metals_trader];

			};
			s_player_parts_crtl = 1;
			
		};
	} else {
		{player removeAction _x} forEach s_player_parts;s_player_parts = [];
		s_player_parts_crtl = -1;
	};

	if (_isMan and !_isAlive and !_isZombie) then {
		if (s_player_studybody < 0) then {
			s_player_studybody = player addAction [localize "str_action_studybody", "\z\addons\dayz_code\actions\study_body.sqf",_cursorTarget, 0, false, true, "",""];
		};
	} else {
		player removeAction s_player_studybody;
		s_player_studybody = -1;
	};
	
	if(dayz_tameDogs) then {
		
		//Dog
		if (_isDog and _isAlive and (_hasRawMeat) and _ownerID == "0" and player getVariable ["dogID", 0] == 0) then {
			if (s_player_tamedog < 0) then {
				s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\tame_dog.sqf", _cursorTarget, 1, false, true, "", ""];
			};
		} else {
			player removeAction s_player_tamedog;
			s_player_tamedog = -1;
		};
		if (_isDog and _ownerID == dayz_characterID and _isAlive) then {
			_dogHandle = player getVariable ["dogID", 0];
			if (s_player_feeddog < 0 and _hasRawMeat) then {
				s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true,"",""];
			};
			if (s_player_waterdog < 0 and "ItemWaterbottle" in _magazinesPlayer) then {
				s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, false, true,"",""];
			};
			if (s_player_staydog < 0) then {
				_lieDown = _dogHandle getFSMVariable "_actionLieDown";
				if (_lieDown) then { _text = "str_actions_liedog"; } else { _text = "str_actions_sitdog"; };
				s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, false, true,"",""];
			};
			if (s_player_trackdog < 0) then {
				s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, false, true,"",""];
			};
			if (s_player_barkdog < 0) then {
				s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, false, true,"",""];
			};
			if (s_player_warndog < 0) then {
				_warn = _dogHandle getFSMVariable "_watchDog";
				if (_warn) then { _text = "Quiet"; _warn = false; } else { _text = "Alert"; _warn = true; };
				s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, false, true,"",""];		
			};
			if (s_player_followdog < 0) then {
				s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,true], 6, false, true,"",""];
			};
		} else {
			player removeAction s_player_feeddog;
			s_player_feeddog = -1;
			player removeAction s_player_waterdog;
			s_player_waterdog = -1;
			player removeAction s_player_staydog;
			s_player_staydog = -1;
			player removeAction s_player_trackdog;
			s_player_trackdog = -1;
			player removeAction s_player_barkdog;
			s_player_barkdog = -1;
			player removeAction s_player_warndog;
			s_player_warndog = -1;
			player removeAction s_player_followdog;
			s_player_followdog = -1;
		};
	};

} else {
	//Engineering
	{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
	s_player_repair_crtl = -1;

	{player removeAction _x} forEach s_player_combi;s_player_combi = [];
		
	dayz_myCursorTarget = objNull;

	{player removeAction _x} forEach s_player_parts;s_player_parts = [];
	s_player_parts_crtl = -1;

	{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
	s_player_lockUnlock_crtl = -1;

	player removeAction s_player_checkGear;
	s_player_checkGear = -1;

	//Others
	player removeAction s_player_forceSave;
	s_player_forceSave = -1;
	player removeAction s_player_flipveh;
	s_player_flipveh = -1;
	player removeAction s_player_sleep;
	s_player_sleep = -1;
	player removeAction s_player_deleteBuild;
	s_player_deleteBuild = -1;
	player removeAction s_player_butcher;
	s_player_butcher = -1;
	player removeAction s_player_cook;
	s_player_cook = -1;
	player removeAction s_player_boil;
	s_player_boil = -1;
	player removeAction s_player_fireout;
	s_player_fireout = -1;
	player removeAction s_player_packtent;
	s_player_packtent = -1;
	player removeAction s_player_fillfuel;
	s_player_fillfuel = -1;
	player removeAction s_player_studybody;
	s_player_studybody = -1;
	//Dog
	player removeAction s_player_tamedog;
	s_player_tamedog = -1;
	player removeAction s_player_feeddog;
	s_player_feeddog = -1;
	player removeAction s_player_waterdog;
	s_player_waterdog = -1;
	player removeAction s_player_staydog;
	s_player_staydog = -1;
	player removeAction s_player_trackdog;
	s_player_trackdog = -1;
	player removeAction s_player_barkdog;
	s_player_barkdog = -1;
	player removeAction s_player_warndog;
	s_player_warndog = -1;
	player removeAction s_player_followdog;
	s_player_followdog = -1;
    
    // vault
	player removeAction s_player_unlockvault;
	s_player_unlockvault = -1;
	player removeAction s_player_packvault;
	s_player_packvault = -1;
	player removeAction s_player_lockvault;
	s_player_lockvault = -1;

	player removeAction s_player_information;
	s_player_information = -1;
	player removeAction s_player_fillgen;
	s_player_fillgen = -1;
	player removeAction s_player_fuelauto;
	s_player_fuelauto = -1;
};



//Dog actions on player self
_dogHandle = player getVariable ["dogID", 0];
if (_dogHandle > 0) then {
	_dog = _dogHandle getFSMVariable "_dog";
	_ownerID = "0";
	if (!isNull cursorTarget) then { _ownerID = cursorTarget getVariable ["characterID","0"]; };
	if (_canDo and !_inVehicle and alive _dog and _ownerID != dayz_characterID) then {
		if (s_player_movedog < 0) then {
			s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID", 0], 1, false, true, "", ""];
		};
		if (s_player_speeddog < 0) then {
			_text = "Walk";
			_speed = 0;
			if (_dog getVariable ["currentSpeed",1] == 0) then { _speed = 1; _text = "Run"; };
			s_player_speeddog = player addAction [format[localize "str_actions_speeddog", _text], "\z\addons\dayz_code\actions\dog\speed.sqf",[player getVariable ["dogID", 0],_speed], 0, false, true, "", ""];
		};
		if (s_player_calldog < 0) then {
			s_player_calldog = player addAction [localize "str_actions_calldog", "\z\addons\dayz_code\actions\dog\follow.sqf", [player getVariable ["dogID", 0], true], 2, false, true, "", ""];
		};
	};
} else {
	player removeAction s_player_movedog;		
	s_player_movedog =		-1;
	player removeAction s_player_speeddog;
	s_player_speeddog =		-1;
	player removeAction s_player_calldog;
	s_player_calldog = 		-1;
};
Link to comment
Share on other sites

  • 0

compiles.sqf

/*	
	FUNCTION COMPILES
*/
//Player only
if (!isDedicated) then {
	_config = 	configFile >> "CfgLoot";
	_config1 = 	configFile >> "CfgMagazines" >> "FoodEdible";
	_config2 = 	configFile >> "CfgWeapons" >> "Loot";

	"filmic" setToneMappingParams [0.07, 0.31, 0.23, 0.37, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";

	BIS_Effects_Burn = 			compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf"; 
	player_zombieCheck = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";	//Run on a players computer, checks if the player is near a zombie
	player_zombieAttack = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieAttack.sqf";	//Run on a players computer, causes a nearby zombie to attack them
	fnc_usec_damageActions =	compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageActions.sqf";		//Checks which actions for nearby casualty
	fnc_inAngleSector =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inAngleSector.sqf";		//Checks which actions for nearby casualty
	fnc_usec_selfActions =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selfActions.sqf";		//Checks which actions for self
	fnc_usec_unconscious =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
	player_temp_calculation	=	compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_temperatur.sqf";		//Temperatur System	//TeeChange
	player_weaponFiredNear =	compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponFiredNear.sqf";
	player_animalCheck =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_animalCheck.sqf";
	player_spawnCheck = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnCheck.sqf";
	player_dumpBackpack = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_dumpBackpack.sqf";
	// player_spawnLootCheck =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnlootCheck.sqf";
	// player_spawnZedCheck =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnzedCheck.sqf";
	building_spawnLoot =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnLoot.sqf";
	// player_taskHint =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_taskHint.sqf";
	building_spawnZombies =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnZombies.sqf";
	//animal_monitor =			compile preprocessFileLineNumbers "\z\addons\dayz_code\system\animal_monitor.sqf";
	// building_monitor =			compile preprocessFileLineNumbers "\z\addons\dayz_code\system\building_monitor.sqf";
	player_fired =				compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.sqf";			//Runs when player fires. Alerts nearby Zeds depending on calibre and audial rating
	player_packTent =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packTent.sqf";
	player_packVault =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packVault.sqf";
	player_unlockVault =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockVault.sqf";
	player_lockVault =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_lockVault.sqf";
	// control_zombieAgent = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\control_zombieAgent.sqf";
	player_updateGui =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_updateGui.sqf";
	player_crossbowBolt =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_crossbowBolt.sqf";
	spawn_flies = 				compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_flies.sqf";
	// stream_locationFill = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationFill.sqf";
	// stream_locationDel = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationDel.sqf";
	// stream_locationCheck = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationCheck.sqf";
	player_music = 				compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_music.sqf";			//Used to generate ambient music
	player_login = 				compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_login.sqf";			//Used to generate ambient music
	player_death =				compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_death.sqf";
	player_switchModel =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_switchModel.sqf";
	player_checkStealth =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_checkStealth.sqf";
	world_sunRise =				compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_sunRise.sqf";
	world_surfaceNoise =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_surfaceNoise.sqf";
	player_humanityMorph =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityMorph.sqf";
	player_throwObject = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_throwObject.sqf";
	player_alertZombies = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_alertZombies.sqf";
	player_fireMonitor = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\system\fire_monitor.sqf";
	player_friendliesCheck =	compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_friendliesCheck.sqf";
	
	//Objects
	object_roadFlare = 			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf";
	object_setpitchbank	=		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_setpitchbank.sqf";
	object_monitorGear =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_monitorGear.sqf";
	
	//Zombies
	zombie_findTargetAgent = 	compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf";
	zombie_loiter = 			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf";			//Server compile, used for loiter behaviour
	zombie_generate = 			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf";			//Server compile, used for loiter behaviour
	wild_spawnZombies = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\wild_spawnZombies.sqf";			//Server compile, used for loiter behaviour
	
	//
	dog_findTargetAgent = 	compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf";
	
	// Vehicle damage fix
	vehicle_handleDamage    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
	vehicle_handleKilled    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";

	//actions
	player_countmagazines =	compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_countmagazines.sqf";
	player_addToolbelt =		compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_addToolbelt.sqf";
	player_copyKey =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_copyKey.sqf";
	player_reloadMag =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_reloadMags.sqf";
	player_loadCrate =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_loadCrate.sqf";
	player_craftItem =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem.sqf";
	player_craftItem1 =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem1.sqf";
	player_craftItem2 =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem2.sqf";
	player_craftItem3 =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem3.sqf";
	player_craftItem4 =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem4.sqf";
	player_tentPitch =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\tent_pitch.sqf";
	player_vaultPitch =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\vault_pitch.sqf";
	player_drink =				compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_drink.sqf";
	player_eat =				compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_eat.sqf";
	player_useMeds =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_useMeds.sqf";
	player_fillWater = 			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\water_fill.sqf";
	player_makeFire =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_makefire.sqf";
	player_chopWood =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_chopWood.sqf";
	player_goFishing =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_goFishing.sqf";
	player_build =				compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_build.sqf";
	player_wearClothes =		compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_wearClothes.sqf";
	player_dropWeapon =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_dropWeapon.sqf";
	player_setTrap =			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_setTrap.sqf";
	object_pickup = 			compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_pickup.sqf";
	player_flipvehicle = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_flipvehicle.sqf";
	player_sleep = 				compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_sleep.sqf";
	
	//ui
	player_selectSlot =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_selectSlot.sqf";
	player_gearSync	=			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSync.sqf";
	player_gearSet	=			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSet.sqf";
	ui_changeDisplay = 			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_changeDisplay.sqf";
	
	//System
	player_monitor =			compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_monitor.sqf";
	player_spawn_1 =			compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_1.sqf";
	player_spawn_2 =			compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_2.sqf";
	onPreloadStarted 			"dayz_preloadFinished = false;";
	onPreloadFinished 			"dayz_preloadFinished = true;";
	
	// TODO: need move it in player_monitor.fsm
	// allow player disconnect from server, if loading hang, kicked by BE etc.
	[] spawn {
		private["_timeOut","_display","_control1","_control2"];
		disableSerialization;
		_timeOut = 0;
		dayz_loadScreenMsg = "";
		diag_log "DEBUG: loadscreen guard started.";
		_display = uiNameSpace getVariable "BIS_loadingScreen";
		_control1 = _display displayctrl 8400;
		_control2 = _display displayctrl 102;
		// 120 sec timeout
		while { _timeOut < 500 && !dayz_clientPreload && !dayz_authed } do {

			if ( isNull _display ) then {
				waitUntil { !dialog; };
				startLoadingScreen ["","RscDisplayLoadCustom"];
				_display = uiNameSpace getVariable "BIS_loadingScreen";
				_control1 = _display displayctrl 8400;
				_control2 = _display displayctrl 102;
			};
			if ( dayz_loadScreenMsg != "" ) then {
				_control1 ctrlSetText dayz_loadScreenMsg;
				dayz_loadScreenMsg = "";
			};
			_control2 ctrlSetText format["%1",round(_timeOut*0.1)];
			_timeOut = _timeOut + 1;
			sleep 0.1;
		};
			endLoadingScreen;
		/*
		if ( !dayz_clientPreload && !dayz_authed ) then {
			diag_log "DEBUG: loadscreen guard ended with timeout.";
			disableUserInput false;
			1 cutText ["Disconnected!", "PLAIN"];
			player enableSimulation false;
		} else { diag_log "DEBUG: loadscreen guard ended."; };
		*/
	}; 
	dayz_losChance = {
		private["_agent","_maxDis","_dis","_val","_maxExp","_myExp"];
		_agent = 	_this select 0;
		_dis =		_this select 1;
		_maxDis = 	_this select 2;
		// diag_log ("VAL:  " + str(_this));
		_val = 		(_maxDis - _dis) max 0;
		_maxExp = 	((exp 2) * _maxDis);
		_myExp = 	((exp 2) * (_val)) / _maxExp;
		_myExp = _myExp * 0.7;
		_myExp
	};
	
	ui_initDisplay = {
		private["_control","_ctrlBleed","_display","_ctrlFracture","_ctrlDogFood","_ctrlDogWater","_ctrlDogWaterBorder", "_ctrlDogFoodBorder"];
		disableSerialization;
		_display = uiNamespace getVariable 'DAYZ_GUI_display';
		_control = 	_display displayCtrl 1204;
		_control ctrlShow false;
		if (!r_player_injured) then {
			_ctrlBleed = 	_display displayCtrl 1303;
			_ctrlBleed ctrlShow false;
		};
		if (!r_fracture_legs and !r_fracture_arms) then {
			_ctrlFracture = 	_display displayCtrl 1203;
			_ctrlFracture ctrlShow false;
		};
		_ctrlDogFoodBorder = _display displayCtrl 1501;
		_ctrlDogFoodBorder ctrlShow false;
		_ctrlDogFood = _display displayCtrl 1701;
		_ctrlDogFood ctrlShow false;
		
		_ctrlDogWaterBorder = _display displayCtrl 1502;
		_ctrlDogWaterBorder ctrlShow false;
		_ctrlDogWater = _display displayCtrl 1702;
		_ctrlDogWater ctrlShow false
	};
	
	dayz_losCheck = {
		private["_target","_agent","_cantSee"];
		_target = _this select 0; // PUT THE PLAYER IN FIRST ARGUMENT!!!!
		_agent = _this select 1;
		_cantSee = true;
		if (!isNull _target) then {
			_tPos = eyePos _target;
			_zPos = eyePos _agent;
			if ((count _tPos > 0) and (count _zPos > 0)) then {
				_cantSee = terrainIntersectASL [_tPos, _zPos];
				if (!_cantSee) then {
					_cantSee = lineIntersects [_tPos, _zPos, _agent, vehicle _target];
				};
			};
		};
		_cantSee
	};
	
	eh_zombieInit = 	{
		private["_unit","_pos"];
		//_unit = 	_this select 0;
		//_pos =		getPosATL _unit;
		//_id = [_pos,_unit] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
	};
	
	dayz_equipCheck = {
		private ["_empty", "_needed","_diff","_success"];
		_config = _this;
		_empty = [player] call BIS_fnc_invSlotsEmpty;
		_needed = [_config] call BIS_fnc_invSlotType;
		_diff = [_empty,_needed] call BIS_fnc_vectorDiff;
		
		_success = true;
		{
			if (_x > 0) then {_success = false};
		} forEach _diff;
		hint format["Config: %5\nEmpty: %1\nNeeded: %2\nDiff: %3\nSuccess: %4",_empty,_needed,_diff,_success,_config];
		_success
	};

	vehicle_gear_count = {
		private["_counter"];
		_counter = 0;
		{
			_counter = _counter + _x;
		} forEach _this;
		_counter
	};
	
	dayz_spaceInterrupt = {
		private ["_dikCode", "_handled"];
		_dikCode = 	_this select 1;
		_handled = false;
		if (_dikCode in (actionKeys "GetOver")) then {
			
			if (player isKindOf  "PZombie_VB") exitWith {
				player switchAction "walkf";
			};
			if (!r_fracture_legs and (time - dayz_lastCheckBit > 4)) then {
				_inBuilding = [player] call fnc_isInsideBuilding;
				_nearbyObjects = nearestObjects[getPosATL player, dayz_disallowedVault, 8];
				if (!_inBuilding and (count _nearbyObjects == 0)) then {
					dayz_lastCheckBit = time;
					call player_CombatRoll;
				};
			};
		};
		//if (_dikCode == 57) then {_handled = true}; // space
		//if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
		if (_dikCode == 210) then //SCROLL LOCK
			{
				_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
			};
		//Prevent exploit of drag body
		if ((_dikCode in actionKeys "Prone") and r_drag_sqf) then { force_dropBody = true; };
		if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) then { force_dropBody = true; };
		if (_dikCode in actionKeys "MoveLeft") then {r_interrupt = true};
		if (_dikCode in actionKeys "MoveRight") then {r_interrupt = true};
		if (_dikCode in actionKeys "MoveForward") then {r_interrupt = true};
		if (_dikCode in actionKeys "MoveBack") then {r_interrupt = true};
		if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
		if (_dikCode in actionKeys "PushToTalk" and (time - dayz_lastCheckBit > 10)) then {
			dayz_lastCheckBit = time;
			[player,50,true,(getPosATL player)] spawn player_alertZombies;
		};
		if (_dikCode in actionKeys "VoiceOverNet" and (time - dayz_lastCheckBit > 10)) then {
			dayz_lastCheckBit = time;
			[player,50,true,(getPosATL player)] spawn player_alertZombies;
		};
		if (_dikCode in actionKeys "PushToTalkDirect" and (time - dayz_lastCheckBit > 10)) then {
			dayz_lastCheckBit = time;
			[player,15,false,(getPosATL player)] spawn player_alertZombies;
		};
		if (_dikCode in actionKeys "Chat" and (time - dayz_lastCheckBit > 10)) then {
			dayz_lastCheckBit = time;
			[player,15,false,(getPosATL player)] spawn player_alertZombies;
		};
		if (_dikCode in actionKeys "User20" and (time - dayz_lastCheckBit > 5)) then {
			dayz_lastCheckBit = time;
			_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
		};
		if ((_dikCode == 0x3E or _dikCode == 0x0F or _dikCode == 0xD3) and (time - dayz_lastCheckBit > 10)) then {
			dayz_lastCheckBit = time;
			call dayz_forceSave;
		};
		/*
		if (_dikCode in actionKeys "IngamePause") then {
			_idOnPause = [] spawn dayz_onPause;
		};
		*/
		_handled
	};
	
	player_CombatRoll = {
		DoRE = ({isPlayer _x} count (player nearEntities ["AllVehicles",100]) > 1);
		if (canRoll && animationState player in ["amovpercmrunslowwrfldf","amovpercmrunsraswrfldf","amovpercmevaslowwrfldf","amovpercmevasraswrfldf"]) then {
			canRoll = false;
			null = [] spawn {
				if (DoRE) then {
					[nil, player, rSWITCHMOVE, "ActsPercMrunSlowWrflDf_FlipFlopPara"] call RE;
				} else {
					player switchMove "ActsPercMrunSlowWrflDf_FlipFlopPara";
				};
				sleep 0.3;
				player setVelocity [(velocity player select 0) + 1.5 * sin direction player, (velocity player select 1) + 1.5 * cos direction player, (velocity player select 2) + 4];
				sleep 1;
				canRoll = true;
			};
			_handled = true;
		};
	};
	
	player_serverModelChange = {
		private["_object","_model"];
		_object = _this select 0;
		_model = _this select 1;
		if (_object == player) then {
			_model call player_switchModel;
		};
	};
	
	player_guiControlFlash = 	{
		private["_control"];
		_control = _this;
		if (ctrlShown _control) then {
			_control ctrlShow false;
		} else {
			_control ctrlShow true;
		};
	};
	
	gear_ui_offMenu = {
		private["_control","_parent","_menu"];
		disableSerialization;
		_control = 	_this select 0;
		_parent = 	findDisplay 106;
		if (!(_this select 3)) then {
			for "_i" from 0 to 9 do {
				_menu = _parent displayCtrl (1600 + _i);
				_menu ctrlShow false;
			};
			_grpPos = ctrlPosition _control;
			_grpPos set [3,0];
			_control ctrlSetPosition _grpPos;
			_control ctrlShow false;
			_control ctrlCommit 0;
		};
	};
	

	gear_ui_init = {
		private["_control","_parent","_menu","_dspl","_grpPos"];
		disableSerialization;
		_parent = findDisplay 106;
		_control = 	_parent displayCtrl 6902;
		for "_i" from 0 to 9 do {
			_menu = _parent displayCtrl (1600 + _i);
			_menu ctrlShow false;
		};
		_grpPos = ctrlPosition _control;
		_grpPos set [3,0];
		_control ctrlSetPosition _grpPos;
		_control ctrlShow false;
		_control ctrlCommit 0;
	};
	
	dayz_eyeDir = {
		private["_vval","_vdir"];
		_vval = (eyeDirection _this);
		_vdir = (_vval select 0) atan2 (_vval select 1);
		if (_vdir < 0) then {_vdir = 360 + _vdir};
		_vdir
	};
	
	dayz_lowHumanity = {
		private["_unit","_humanity","_delay"];
		_unit = _this;
		if ((_unit distance player) < 15) then {
			_humanity = _unit getVariable["humanity",0];
			dayz_heartBeat = true;
			if (_humanity < -3000) then {
				_delay = ((10000 + _humanity) / 5500) + 0.3;
				playSound "heartbeat_1";
				sleep _delay;
			};
			dayz_heartBeat = false;
		};
	};
	/*
	dayz_meleeMagazineCheck = {
		private["_meleeNum","_magType","_wpnType"];
		_wpnType = _this;
		_magType = 	([] + getArray (configFile >> "CfgWeapons" >> _wpnType >> "magazines")) select 0;
		_meleeNum = ({_x == _magType} count magazines player);
		if (_meleeNum > 1) then {
			if (player hasWeapon _wpnType) then {
				_meleeNum = _meleeNum - 1;
			};
			for "_i" from 1 to _meleeNum do {
				player removeMagazine _magType;
			};
		};
	};
	*/
	dayz_originalPlayer =		player;
};

	progressLoadingScreen 0.8;
	
//Both
	BIS_fnc_selectRandom =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandom.sqf";		//Checks which actions for nearby casualty
	fnc_buildWeightedArray = 	compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf";		//Checks which actions for nearby casualty
	fnc_usec_damageVehicle =	compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerVehicle.sqf";		//Event handler run on damage
	zombie_initialize = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\init\zombie_init.sqf";
	// object_vehicleKilled =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_vehicleKilled.sqf";		//Event handler run on damage
	object_setHitServer =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHitServer.sqf";	//process the hit as a NORMAL damage (useful for persistent vehicles)
	object_setFixServer =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setFixServer.sqf";	//process the hit as a NORMAL damage (useful for persistent vehicles)
	object_getHit =				compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_getHit.sqf";			//gets the hit value for a HitPoint (i.e. HitLegs) against the selection (i.e. "legs"), returns the value
	object_setHit =				compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHit.sqf";			//process the hit as a NORMAL damage (useful for persistent vehicles)
	object_processHit =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_processHit.sqf";		//process the hit in the REVO damage system (records and sets hit)
	object_delLocal =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_delLocal.sqf";
	// object_cargoCheck =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_cargoCheck.sqf";		//Run by the player or server to monitor changes in cargo contents
	fnc_usec_damageHandler =	compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";		//Event handler run on damage
	// Vehicle damage fix
	vehicle_handleDamage    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
	vehicle_handleKilled    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
	fnc_vehicleEventHandler = 	compile preprocessFileLineNumbers "\z\addons\dayz_code\init\vehicle_init.sqf";			//Initialize vehicle
	fnc_inString = 				compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inString.sqf";	
	fnc_isInsideBuilding = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf";	//_isInside = [_unit,_building] call fnc_isInsideBuilding;
	fnc_isInsideBuilding2 = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding2.sqf";	//_isInside = [_unit,_building] call fnc_isInsideBuilding;
	dayz_zombieSpeak = 			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_speak.sqf";			//Used to generate random speech for a unit
	vehicle_getHitpoints =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getHitpoints.sqf";
	local_gutObject =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObject.sqf";		//Generated on the server (or local to unit) when gutting an object
	local_lockUnlock =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lockUnlock.sqf";		//When vehicle is local to unit perform locking vehicle
	local_gutObjectZ =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObjectZ.sqf";		//Generated on the server (or local to unit) when gutting an object
	local_zombieDamage = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerZ.sqf";		//Generated by the client who created a zombie to track damage
	local_setFuel =				compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_setFuel.sqf";			//Generated when someone refuels a vehicle
	local_eventKill = 			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_eventKill.sqf";		//Generated when something is killed
	//player_weaponCheck =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponCheck.sqf";	//Run by the player or server to monitor whether they have picked up a new weapon
	curTimeStr =				compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_curTimeStr.sqf";
	player_medBandage =			compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
	player_medInject =			compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medInject.sqf";
	player_medEpi =				compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medEpi.sqf";
	player_medTransfuse =		compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medTransfuse.sqf";
	player_medMorphine =		compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
	player_breaklegs =			compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBreakLegs.sqf";
	player_medPainkiller =		compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
	world_isDay = 				{if ((daytime < (24 - dayz_sunRise)) and (daytime > dayz_sunRise)) then {true} else {false}};
	player_humanityChange =		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityChange.sqf";
	spawn_loot =				compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot.sqf";
	// player_projectileNear = 		compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf";
	
	player_sumMedical = {
		private["_character","_wounds","_legs","_arms","_medical"];
		_character = 	_this;
		_wounds =		[];
		if (_character getVariable["USEC_injured",false]) then {
			{
				if (_character getVariable[_x,false]) then {
					_wounds set [count _wounds,_x];
				};
			} forEach USEC_typeOfWounds;
		};
		_legs = _character getVariable ["hit_legs",0];
		_arms = _character getVariable ["hit_arms",0];
		_medical = [
			_character getVariable["USEC_isDead",false],
			_character getVariable["NORRN_unconscious", false],
			_character getVariable["USEC_infected",false],
			_character getVariable["USEC_injured",false],
			_character getVariable["USEC_inPain",false],
			_character getVariable["USEC_isCardiac",false],
			_character getVariable["USEC_lowBlood",false],
			_character getVariable["USEC_BloodQty",12000],
			_wounds,
			[_legs,_arms],
			_character getVariable["unconsciousTime",0],
			_character getVariable["messing",[0,0]]
		];
		_medical
	};
	
	
	//Server Only
	if (isServer) then {
		call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
	} else {
		eh_localCleanup = {};
	};
	
	
	//Start Dynamic Weather
	execVM "\z\addons\dayz_code\external\DynamicWeatherEffects.sqf";
	initialized = true;
Link to comment
Share on other sites

  • 0
/*%FSM<COMPILE "F:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Player Monitor">*/
/*%FSM<HEAD>*/
/*
item0[] = {"init",0,250,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"init"};
item1[] = {"isServer",4,218,50.000000,-350.000000,150.000000,-300.000000,0.000000,"isServer"};
item2[] = {"wait",2,250,50.000000,-275.000000,150.000000,-225.000000,0.000000,"wait"};
item3[] = {"Allow_Conn",4,218,50.000000,-200.000000,150.000000,-150.000000,0.000000,"Allow" \n "Conn"};
item4[] = {"Loading",2,250,-75.000000,-200.000000,25.000000,-150.000000,0.000000,"Loading"};
item5[] = {"Client",4,218,-75.000000,-275.000000,25.000000,-225.000000,0.000000,"Client"};
item6[] = {"player_not_null",4,218,-175.000000,-50.000000,-75.000000,0.000000,0.000000,"player" \n "not null"};
item7[] = {"Prepare",2,250,-75.000000,0.000000,25.000000,50.000000,0.000000,"Prepare"};
item8[] = {"player___player",4,218,50.000000,50.000000,150.000000,100.000000,0.000000,"player =" \n "player"};
item9[] = {"Collect",2,250,-75.000000,100.000000,25.000000,150.000000,0.000000,"Collect"};
item10[] = {"Single_Player",4,218,-200.000000,100.000000,-100.000000,150.000000,3.000000,"Single" \n "Player"};
item11[] = {"Make_PlayerID",2,250,-200.000000,175.000000,-100.000000,225.000000,0.000000,"Make PlayerID"};
item12[] = {"Has_PlayerID",4,218,-75.000000,175.000000,25.000000,225.000000,1.000000,"Has PlayerID"};
item13[] = {"no_PlayerID",4,218,50.000000,150.000000,150.000000,200.000000,2.000000,"no PlayerID"};
item14[] = {"ERROR__No_Player",2,250,175.000000,150.000000,275.000000,200.000000,0.000000,"ERROR:" \n "No PlayerID"};
item15[] = {"Request",2,250,-75.000000,250.000000,25.000000,300.000000,0.000000,"Request"};
item16[] = {"Response",4,218,-175.000000,300.000000,-75.000000,350.000000,0.000000,"Response"};
item17[] = {"Parse_Login",2,250,-75.000000,350.000000,25.000000,400.000000,0.000000,"Parse Login"};
item18[] = {"Hive_Bad",4,218,50.000000,350.000000,150.000000,400.000000,10.000000,"Hive" \n "Bad"};
item19[] = {"ERROR__Wrong_HIVE",2,250,175.000000,350.000000,275.000000,400.000000,0.000000,"ERROR:" \n "Wrong HIVE" \n "Version"};
item20[] = {"Hive_Ok",4,218,-175.000000,400.000000,-75.000000,450.000000,0.000000,"Hive" \n "Ok"};
item21[] = {"Phase_One",2,250,-75.000000,450.000000,25.000000,500.000000,0.000000,"Phase One"};
item22[] = {"Response",4,218,-175.000000,500.000000,-75.000000,550.000000,0.000000,"Response"};
item23[] = {"Phase_Two",2,4346,-75.000000,550.000000,25.000000,600.000000,0.000000,"Phase Two"};
item24[] = {"Dead_Player",4,218,50.000000,550.000000,150.000000,600.000000,0.000000,"Dead" \n "Player"};
item25[] = {"ERROR__Player_Already",2,250,175.000000,550.000000,275.000000,600.000000,0.000000,"ERROR:" \n "Player Already" \n "Dead"};
item26[] = {"Alive",4,218,-175.000000,600.000000,-75.000000,650.000000,0.000000,"Alive"};
item27[] = {"Position",2,250,-75.000000,650.000000,25.000000,700.000000,0.000000,"Position"};
item28[] = {"Version_Ok",4,218,-175.000000,700.000000,-75.000000,750.000000,0.000000,"Version" \n "Ok"};
item29[] = {"Load_In",2,250,-75.000000,850.000000,25.000000,900.000000,0.000000,"Load In"};
item30[] = {"Bad_Version",4,218,50.000000,650.000000,150.000000,700.000000,0.000000,"Bad" \n "Version"};
item31[] = {"ERROR__Bad_Versi",2,250,175.000000,650.000000,275.000000,700.000000,0.000000,"ERROR:" \n "Bad Version"};
item32[] = {"Display_Ready",4,218,-175.000000,900.000000,-75.000000,950.000000,0.000000,"Display" \n "Ready"};
item33[] = {"Preload_Display",2,250,-75.000000,950.000000,25.000000,1000.000000,0.000000,"Preload" \n "Display"};
item34[] = {"Preload_Done",4,218,-175.000000,1000.000000,-75.000000,1050.000000,0.000000,"Preload" \n "Done"};
item35[] = {"Initialize",2,250,-75.000000,1050.000000,25.000000,1100.000000,0.000000,"Initialize"};
item36[] = {"Finish",1,250,-75.000000,1150.000000,25.000000,1200.000000,0.000000,"Finish"};
item37[] = {"True",8,218,25.000000,1100.000000,125.000000,1150.000000,0.000000,"True"};
item38[] = {"Too_Long",4,218,300.000000,150.000000,400.000000,200.000000,0.000000,"Too" \n "Long"};
item39[] = {"Too_Long",4,218,300.000000,350.000000,400.000000,400.000000,0.000000,"Too" \n "Long"};
item40[] = {"Too_Long",4,218,300.000000,550.000000,400.000000,600.000000,0.000000,"Too" \n "Long"};
item41[] = {"Too_Long",4,218,300.000000,650.000000,400.000000,700.000000,0.000000,"Too" \n "Long"};
item42[] = {"Enable_Sim",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,"Enable Sim"};
item43[] = {"Initialized",4,218,-175.000000,-150.000000,-75.000000,-100.000000,0.000000,"Initialized"};
item44[] = {"New_Character",4,218,-425.000000,275.000000,-325.000000,325.000000,6.000000,"New" \n "Character"};
item45[] = {"Gender_Selection",2,250,-500.000000,350.000000,-400.000000,400.000000,0.000000,"Gender Selection" \n "Dialog"};
item46[] = {"Selected",4,218,-450.000000,450.000000,-350.000000,500.000000,0.000000,"Selected"};
item47[] = {"Process",2,250,-300.000000,475.000000,-200.000000,525.000000,0.000000,"Process"};
item48[] = {"no_PlayerID",4,218,50.000000,-100.000000,150.000000,-50.000000,2.000000,"no PlayerID"};
item49[] = {"ERROR__No_Player_1",2,250,175.000000,-100.000000,275.000000,-50.000000,0.000000,"ERROR:" \n "No PlayerID"};
item50[] = {"Too_Long",4,218,300.000000,-100.000000,400.000000,-50.000000,0.000000,"Too" \n "Long"};
item51[] = {"Stream",2,250,-75.000000,750.000000,25.000000,800.000000,0.000000,"Stream"};
item52[] = {"Preloaded",4,218,-175.000000,800.000000,-75.000000,850.000000,0.000000,"Preloaded"};
item53[] = {"New_Infected_Cha",4,218,-250.000000,350.000000,-150.000000,400.000000,5.000000,"New" \n "Infected" \n "Character"};
item54[] = {"Player_Zombie__S",2,250,-375.000000,375.000000,-275.000000,425.000000,0.000000,"Player Zombie" \n " Selection"};
link0[] = {0,1};
link1[] = {0,5};
link2[] = {1,2};
link3[] = {2,3};
link4[] = {3,4};
link5[] = {4,43};
link6[] = {5,4};
link7[] = {6,7};
link8[] = {7,8};
link9[] = {8,9};
link10[] = {9,10};
link11[] = {9,12};
link12[] = {9,13};
link13[] = {10,11};
link14[] = {11,12};
link15[] = {12,15};
link16[] = {13,14};
link17[] = {14,38};
link18[] = {15,16};
link19[] = {16,17};
link20[] = {17,18};
link21[] = {17,20};
link22[] = {17,44};
link23[] = {17,53};
link24[] = {18,19};
link25[] = {19,39};
link26[] = {20,21};
link27[] = {21,22};
link28[] = {22,23};
link29[] = {23,24};
link30[] = {23,26};
link31[] = {24,25};
link32[] = {25,40};
link33[] = {26,27};
link34[] = {27,28};
link35[] = {27,30};
link36[] = {28,51};
link37[] = {29,32};
link38[] = {30,31};
link39[] = {31,41};
link40[] = {32,33};
link41[] = {33,34};
link42[] = {34,35};
link43[] = {35,37};
link44[] = {37,36};
link45[] = {38,14};
link46[] = {39,19};
link47[] = {40,25};
link48[] = {41,31};
link49[] = {42,6};
link50[] = {42,48};
link51[] = {43,42};
link52[] = {44,45};
link53[] = {45,46};
link54[] = {46,47};
link55[] = {47,20};
link56[] = {48,49};
link57[] = {49,50};
link58[] = {50,49};
link59[] = {51,52};
link60[] = {52,29};
link61[] = {53,54};
link62[] = {54,20};
globals[] = {25.000000,1,0,0,0,640,480,1,85,6316128,1,-452.194977,340.078094,1506.747437,277.117401,565,880,1};
window[] = {2,-1,-1,-1,-1,806,2041,3012,46,3,583};
*//*%FSM</HEAD>*/
class FSM
{
  fsmName = "DayZ Player Monitor";
  class States
  {
    /*%FSM<STATE "init">*/
    class init
    {
      name = "init";
      init = /*%FSM<STATEINIT""">*/"dayz_versionNo = getText(configFile >> ""CfgMods"" >> ""DayZ"" >> ""version"");" \n
       "diag_log (""DAYZ: CLIENT IS RUNNING DAYZ_CODE "" + str(dayz_versionNo));" \n
       "" \n
       "0 fadeSound 0;" \n
       "//player setPosATL [-2148,6655,0];" \n
       "progressLoadingScreen 0.1;" \n
       "_timeStart = time;" \n
       "player enableSimulation false;" \n
       ""/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Client">*/
        class Client
        {
          priority = 0.000000;
          to="Loading";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"!isServer"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "isServer">*/
        class isServer
        {
          priority = 0.000000;
          to="wait";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"isServer"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "wait">*/
    class wait
    {
      name = "wait";
      init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Allow_Conn">*/
        class Allow_Conn
        {
          priority = 0.000000;
          to="Loading";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"allowConnection"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Loading">*/
    class Loading
    {
      name = "Loading";
      init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
       "diag_log (""PLOGIN: Initating"");" \n
       "" \n
       "dayz_loadScreenMsg = (localize ""str_player_13""); " \n
       "progressLoadingScreen 0.2;" \n
       ""/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Initialized">*/
        class Initialized
        {
          priority = 0.000000;
          to="Enable_Sim";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"!isnil ""bis_fnc_init"""/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/"dayz_forceSave = {" \n
           "" \n
           "	createGearDialog [player, ""RscDisplayGear""];" \n
           "_dialog = 			findDisplay 106;" \n
           "_magazineArray = 	[];" \n
           "" \n
           "//Primary Mags" \n
           "for ""_i"" from 109 to 120 do " \n
           "{" \n
           "	_control = 	_dialog displayCtrl _i;" \n
           "	_item = 	gearSlotData _control;" \n
           "	_val =		gearSlotAmmoCount _control;" \n
           "	_max = 		getNumber (configFile >> ""CfgMagazines"" >> _item >> ""count"");" \n
           "	if (_item != """") then {" \n
           "		if (_val != _max) then {" \n
           "			_magazineArray set [count _magazineArray,[_item,_val]];" \n
           "		} else {" \n
           "			_magazineArray set [count _magazineArray,_item];" \n
           "		};" \n
           "	};" \n
           "};" \n
           "" \n
           "//Secondary Mags" \n
           "for ""_i"" from 122 to 129 do " \n
           "{" \n
           "	_control = 	_dialog displayCtrl _i;" \n
           "	_item = 	gearSlotData _control;" \n
           "	_val =		gearSlotAmmoCount _control;" \n
           "	_max = 		getNumber (configFile >> ""CfgMagazines"" >> _item >> ""count"");" \n
           "	if (_item != """") then {" \n
           "		if (_val != _max) then {" \n
           "			_magazineArray set [count _magazineArray,[_item,_val]];" \n
           "		} else {" \n
           "			_magazineArray set [count _magazineArray,_item];" \n
           "		};" \n
           "	};" \n
           "};" \n
           "	closeDialog 0;" \n
           "" \n
           "	_medical = player call player_sumMedical;" \n
           "		" \n
           "	/*" \n
           "		Get character state details" \n
           "	*/" \n
           "	_currentWpn = 	currentMuzzle player;" \n
           "	_currentAnim =	animationState player;" \n
           "	_config = 		configFile >> ""CfgMovesMaleSdr"" >> ""States"" >> _currentAnim;" \n
           "	_onLadder =		(getNumber (_config >> ""onLadder"")) == 1;" \n
           "	_isTerminal = 	(getNumber (_config >> ""terminal"")) == 1;" \n
           "	//_wpnDisabled =	(getNumber (_config >> ""disableWeapons"")) == 1;" \n
           "	_currentModel = typeOf player;" \n
           "	_charPos = getPosATL player;" \n
           "	_playerPos = 	[round(direction player),_charPos];" \n
           "	" \n
           "	if (_onLadder or _isInVehicle or _isTerminal) then {" \n
           "		_currentAnim = """";" \n
           "		//If position to be updated, make sure it is at ground level!" \n
           "		if ((count _playerPos > 0) and !_isTerminal) then {" \n
           "			_charPos set [2,0];" \n
           "			_playerPos set[1,_charPos];					" \n
           "		};" \n
           "	};" \n
           "	if (_isInVehicle) then {" \n
           "		_currentWpn = """";" \n
           "	} else {" \n
           "		if ( typeName(_currentWpn) == ""STRING"" ) then {" \n
           "			_muzzles = getArray(configFile >> ""cfgWeapons"" >> _currentWpn >> ""muzzles"");" \n
           "			if (count _muzzles > 1) then {" \n
           "				_currentWpn = currentMuzzle player;" \n
           "			};	" \n
           "		} else {" \n
           "			//diag_log (""DW_DEBUG: _currentWpn: "" + str(_currentWpn));" \n
           "			_currentWpn = """";" \n
           "		};" \n
           "	};" \n
           "	_temp = round(player getVariable [""temperature"",100]);" \n
           "	_currentState = [_currentWpn,_currentAnim,_temp];" \n
           "	" \n
           "	dayz_Magazines = _magazineArray;" \n
           "	dayzPlayerSave = [player,dayz_Magazines,false,true];" \n
           "	publicVariableServer ""dayzPlayerSave"";" \n
           "			" \n
           "	if (isServer) then {" \n
           "		dayzPlayerSave call server_playerSync;" \n
           "	};" \n
           "" \n
           "	dayz_lastSave = time;" \n
           "	dayz_Magazines = [];" \n
           "};"/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Prepare">*/
    class Prepare
    {
      name = "Prepare";
      init = /*%FSM<STATEINIT""">*/"diag_log (""PLOGIN: Player Model Exists"");"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "player___player">*/
        class player___player
        {
          priority = 0.000000;
          to="Collect";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"player == player"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Collect">*/
    class Collect
    {
      name = "Collect";
      init = /*%FSM<STATEINIT""">*/"diag_log (""PLOGIN: Player Ready"");" \n
       "" \n
       "dayz_loadScreenMsg = (localize ""str_player_13""); " \n
       "progressLoadingScreen 0.3;" \n
       "" \n
       "_playerUID = getPlayerUID player;"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Single_Player">*/
        class Single_Player
        {
          priority = 3.000000;
          to="Make_PlayerID";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"count playableUnits == 0 and isServer"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "no_PlayerID">*/
        class no_PlayerID
        {
          priority = 2.000000;
          to="ERROR__No_Player";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"_playerUID == """""/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Has_PlayerID">*/
        class Has_PlayerID
        {
          priority = 1.000000;
          to="Request";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"!(isNil ""_playerUID"")"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Make_PlayerID">*/
    class Make_PlayerID
    {
      name = "Make_PlayerID";
      init = /*%FSM<STATEINIT""">*/"//In Single Player" \n
       "	isSinglePlayer = true;" \n
       "	player sidechat ""PLOGIN: Single player Mode detected!"";" \n
       "	_playerUID = ""42"";"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Has_PlayerID">*/
        class Has_PlayerID
        {
          priority = 1.000000;
          to="Request";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"!(isNil ""_playerUID"")"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "ERROR__No_Player">*/
    class ERROR__No_Player
    {
      name = "ERROR__No_Player";
      init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
       "selectNoPlayer;" \n
       "_myTime = time;" \n
       "1 cutText [localize ""str_player_14"", ""PLAIN"",15];"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Too_Long">*/
        class Too_Long
        {
          priority = 0.000000;
          to="ERROR__No_Player";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"(time - _myTime) > 10"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Request">*/
    class Request
    {
      name = "Request";
      init = /*%FSM<STATEINIT""">*/"//startLoadingScreen ["""",""DayZ_loadingScreen""];" \n
       "" \n
       "diag_log (""PLOGIN: Requesting Authentication... ("" + _playerUID + "")"");" \n
       "dayz_loadScreenMsg = (localize ""str_player_15"");" \n
       "progressLoadingScreen 0.5;" \n
       "" \n
       "_msg = [];" \n
       "" \n
       "//[""dayzLogin"",[_playerUID,player]] call callRpcProcedure;" \n
       "" \n
       "dayzLogin = [_playerUID,player];" \n
       "publicVariableServer ""dayzLogin"";" \n
       "" \n
       "dayzPlayerLogin = [];" \n
       ""/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Response">*/
        class Response
        {
          priority = 0.000000;
          to="Parse_Login";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"count (dayzPlayerLogin) > 1"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/"_msg = 		dayzPlayerLogin;"/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Parse_Login">*/
    class Parse_Login
    {
      name = "Parse_Login";
      init = /*%FSM<STATEINIT""">*/"dayz_authed = true;" \n
       "" \n
       "progressLoadingScreen 0.6;" \n
       "_charID		= _msg select 0;" \n
       "_inventory	= _msg select 1;" \n
       "_backpack	= _msg select 2;" \n
       "_survival 	= _msg select 3;" \n
       "_isNew 		= _msg select 4;" \n
       "//_state 		= _msg select 5;" \n
       "_version	= _msg select 5;" \n
       "_model		= _msg select 6;" \n
       "" \n
       "_isHiveOk = false;" \n
       "_newPlayer = false;" \n
       "_isInfected = _msg select 9;" \n
       "" \n
       "if (count _msg > 7) then {" \n
       "	_isHiveOk = _msg select 7;" \n
       "	_newPlayer = _msg select 8;" \n
       "	diag_log (""PLAYER RESULT: "" + str(_isHiveOk));" \n
       "};" \n
       "" \n
       "dayz_loadScreenMsg = (localize ""str_player_17""); " \n
       "progressLoadingScreen 0.7;" \n
       "diag_log (""PLOGIN: authenticated with : "" + str(_msg));" \n
       "" \n
       "//Not Equal Failure" \n
       "" \n
       "if (isNil ""_model"") then {" \n
       "	_model = ""Survivor2_DZ"";" \n
       "	diag_log (""PLOGIN: Model was nil, loading as survivor"");" \n
       "};" \n
       "" \n
       "if (_model == """") then {" \n
       "	_model = ""Survivor2_DZ"";" \n
       "	diag_log (""PLOGIN: Model was empty, loading as survivor"");" \n
       "};" \n
       "" \n
       "if (_model == ""Survivor1_DZ"") then {" \n
       "	_model = ""Survivor2_DZ"";" \n
       "};" \n
       "" \n
       "_isHack = false;" \n
       "if (_model == ""hacker"") then {" \n
       "	_isHack = true;" \n
       "};"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Hive_Bad">*/
        class Hive_Bad
        {
          priority = 10.000000;
          to="ERROR__Wrong_HIVE";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"!_isHiveOk"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "New_Character">*/
        class New_Character
        {
          priority = 6.000000;
          to="Gender_Selection";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"_isNew && _isInfected == 0"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "New_Infected_Cha">*/
        class New_Infected_Cha
        {
          priority = 5.000000;
          to="Player_Zombie__S";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"_isNew && _isInfected == 1"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Hive_Ok">*/
        class Hive_Ok
        {
          priority = 0.000000;
          to="Phase_One";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "ERROR__Wrong_HIVE">*/
    class ERROR__Wrong_HIVE
    {
      name = "ERROR__Wrong_HIVE";
      init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
       "selectNoPlayer;" \n
       "" \n
       "_myTime = time;" \n
       "1 cutText [""This server is running an incorrect version of the server side application. If this is the first time you have seen this error please reconnect. If you are the server admin please contact DayZepoch.com staff."", ""PLAIN"",5];"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Too_Long">*/
        class Too_Long
        {
          priority = 0.000000;
          to="ERROR__Wrong_HIVE";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"(time - _myTime) > 10"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Phase_One">*/
    class Phase_One
    {
      name = "Phase_One";
      init = /*%FSM<STATEINIT""">*/"//_model = ""BanditW1_DZ"";" \n
       "" \n
       "dayz_playerName = name player;" \n
       "_model call player_switchModel;" \n
       "" \n
       "player allowDamage false;" \n
       "_lastAte = _survival select 1;" \n
       "_lastDrank = _survival select 2;" \n
       "" \n
       "_usedFood = 0;" \n
       "_usedWater = 0;" \n
       "" \n
       "//_inventory = [[""Mk_48_DZ"",""NVGoggles"",""Binocular_Vector"",""M9SD"",""ItemGPS"",""ItemToolbox"",""ItemEtool"",""ItemCompass"",""ItemMatchbox"",""FoodCanBakedBeans"",""ItemKnife"",""ItemMap"",""ItemWatch""],[[""100Rnd_762x51_M240"",47],""ItemPainkiller"",""ItemBandage"",""15Rnd_9x19_M9SD"",""100Rnd_762x51_M240"",""ItemBandage"",""ItemBandage"",""15Rnd_9x19_M9SD"",""15Rnd_9x19_M9SD"",""15Rnd_9x19_M9SD"",""ItemMorphine"",""PartWoodPile""]];" \n
       "" \n
       "dayzGearSave = false;" \n
       "_inventory call player_gearSet;" \n
       "" \n
       "//Assess in backpack" \n
       "if (count _backpack > 0) then {" \n
       "	//Populate" \n
       "	_backpackType = 	_backpack select 0;" \n
       "	_backpackWpn = 		_backpack select 1;" \n
       "	_backpackMagTypes = [];" \n
       "	_backpackMagQty = [];" \n
       "	if (count _backpackWpn > 0) then {" \n
       "		_backpackMagTypes = (_backpack select 2) select 0;" \n
       "		_backpackMagQty = 	(_backpack select 2) select 1;" \n
       "	};" \n
       "	_countr = 0;" \n
       "	_backpackWater = 0;" \n
       "" \n
       "	//Add backpack" \n
       "	if (_backpackType != """") then {" \n
       "		_isOK = 	isClass(configFile >> ""CfgVehicles"" >>_backpackType);" \n
       "		if (_isOK) then {" \n
       "			player addBackpack _backpackType; " \n
       "			dayz_myBackpack =	unitBackpack player;" \n
       "			" \n
       "			//Fill backpack contents" \n
       "			//Weapons" \n
       "			_backpackWpnTypes = [];" \n
       "			_backpackWpnQtys = [];" \n
       "			if (count _backpackWpn > 0) then {" \n
       "				_backpackWpnTypes = _backpackWpn select 0;" \n
       "				_backpackWpnQtys = 	_backpackWpn select 1;" \n
       "			};" \n
       "			_countr = 0;" \n
       "			{" \n
       "				if (_x == ""Crossbow"") then { _x = ""Crossbow_DZ"" };" \n
       "				dayz_myBackpack addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];" \n
       "				_countr = _countr + 1;" \n
       "			} forEach _backpackWpnTypes;" \n
       "			" \n
       "			//Magazines" \n
       "			_countr = 0;" \n
       "			{" \n
       "				if (_x == ""BoltSteel"") then { _x = ""WoodenArrow"" }; // Convert BoltSteel to WoodenArrow" \n
       "				dayz_myBackpack addMagazineCargoGlobal [_x,(_backpackMagQty select _countr)];" \n
       "				_countr = _countr + 1;" \n
       "			} forEach _backpackMagTypes;" \n
       "			" \n
       "			dayz_myBackpackMags =	getMagazineCargo dayz_myBackpack;" \n
       "			dayz_myBackpackWpns =	getWeaponCargo dayz_myBackpack;" \n
       "		} else {" \n
       "			dayz_myBackpack		=	objNull;" \n
       "			dayz_myBackpackMags = [];" \n
       "			dayz_myBackpackWpns = [];" \n
       "		};" \n
       "	} else {" \n
       "		dayz_myBackpack		=	objNull;" \n
       "		dayz_myBackpackMags =	[];" \n
       "		dayz_myBackpackWpns =	[];" \n
       "	};" \n
       "} else {" \n
       "	dayz_myBackpack		=	objNull;" \n
       "	dayz_myBackpackMags =	[];" \n
       "	dayz_myBackpackWpns =	[];" \n
       "};" \n
       "" \n
       "dayzPlayerLogin2 = [];" \n
       "//[""dayzLogin2"",[_charID,player,_playerUID]] call callRpcProcedure;" \n
       "" \n
       "dayzLogin2 = [_charID,player,_playerUID];" \n
       "publicVariableServer ""dayzLogin2"";" \n
       "" \n
       "dayz_loadScreenMsg =  ""Requesting Character data from server"";" \n
       "progressLoadingScreen 0.8;" \n
       "diag_log ""Attempting Phase two..."";"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Response">*/
        class Response
        {
          priority = 0.000000;
          to="Phase_Two";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"count (dayzPlayerLogin2) > 0"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/"_msg = 		player getVariable[""worldspace"",[]];"/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Phase_Two">*/
    class Phase_Two
    {
      name = "Phase_Two";
      init = /*%FSM<STATEINIT""">*/"dayz_loadScreenMsg =  ""Character Data received from server""; " \n
       "diag_log ""Finished..."";" \n
       "" \n
       "_worldspace = 	dayzPlayerLogin2 select 0;" \n
       "_state =			dayzPlayerLogin2 select 1;" \n
       "" \n
       "_setDir = 			_worldspace select 0;" \n
       "_setPos = 			_worldspace select 1;" \n
       "" \n
       "if(dayz_paraSpawn and !(player isKindOf ""PZombie_VB"")) then {" \n
       "	_para = createVehicle [""ParachuteWest"", _setPos, [], 0, ""FLY""];  " \n
       "	player moveInDriver _para;" \n
       "} else {" \n
       "	player setPosATL _setPos;" \n
       "	player setDir _setDir;" \n
       "};" \n
       "" \n
       "//Legs and Arm fractures" \n
       "_legs = player getVariable [""hit_legs"",0];" \n
       "_arms = player getVariable [""hit_hands"",0];" \n
       "" \n
       "if (_legs > 1) then {" \n
       "	player setHit[""legs"",1];" \n
       "	r_fracture_legs = true;" \n
       "};" \n
       "if (_arms > 1) then {" \n
       "	player setHit[""hands"",1];" \n
       "	r_fracture_arms = true;" \n
       "};" \n
       "" \n
       "//Record current weapon state" \n
       "dayz_myWeapons = 		weapons player;		//Array of last checked weapons" \n
       "dayz_myItems = 			items player;		//Array of last checked items" \n
       "dayz_myMagazines = 	magazines player;" \n
       "" \n
       "dayz_playerUID = _playerUID;" \n
       "" \n
       "if ((_isNew) OR (count _inventory == 0)) then {" \n
       "	//player is new, add initial loadout only if player is not pzombie" \n
       "	if(!(player isKindOf ""PZombie_VB"")) then {" \n
       "		_config = (configFile >> ""CfgSurvival"" >> ""Inventory"" >> ""Default"");" \n
       "		_mags = getArray (_config >> ""magazines"");" \n
       "		_wpns = getArray (_config >> ""weapons"");		" \n
       "		_bcpk = getText (_config >> ""backpack"");" \n
       "		_bcpkWpn = getText (_config >> ""backpackWeapon"");" \n
       "		if(!isNil ""DefaultMagazines"") then {" \n
       "			_mags = DefaultMagazines;" \n
       "		};" \n
       "		if(!isNil ""DefaultWeapons"") then {" \n
       "			_wpns = DefaultWeapons;" \n
       "		};" \n
       "		if(!isNil ""DefaultBackpack"") then {" \n
       "			_bcpk = DefaultBackpack;" \n
       "		};" \n
       "		if(!isNil ""DefaultBackpackWeapon"") then {" \n
       "			_bcpkWpn = DefaultBackpackWeapon;" \n
       "		};" \n
       "		//Add inventory" \n
       "		{" \n
       "			_isOK = 	isClass(configFile >> ""CfgMagazines"" >> _x);" \n
       "			if (_isOK) then {" \n
       "				player addMagazine _x;" \n
       "			};" \n
       "		} forEach _mags;" \n
       "		{" \n
       "			_isOK = 	isClass(configFile >> ""CfgWeapons"" >> _x);" \n
       "			if (_isOK) then {" \n
       "				player addWeapon _x;" \n
       "			};" \n
       "		} forEach _wpns;" \n
       "		" \n
       "		if (_bcpk != """") then {" \n
       "			player addBackpack _bcpk; " \n
       "			dayz_myBackpack =	unitBackpack player;" \n
       "		};" \n
       "		if (_bcpkWpn != """") then {" \n
       "			dayz_myBackpack addWeaponCargoGlobal [_bcpkWpn,1];" \n
       "		};" \n
       "	};" \n
       "};" \n
       "" \n
       "//Work out survival time" \n
       "_totalMins = _survival select 0;" \n
       "_days = floor (_totalMins / 1440);" \n
       "_totalMins = (_totalMins - (_days * 1440));" \n
       "_hours = floor (_totalMins / 60);" \n
       "_mins =  (_totalMins - (_hours * 60));" \n
       "" \n
       "//player variables" \n
       "dayz_characterID =		_charID;" \n
       "dayz_hasFire = 			objNull;		//records players Fireplace object" \n
       "dayz_myCursorTarget = 	objNull;" \n
       "dayz_myPosition = 		getPosATL player;	//Last recorded position" \n
       "dayz_lastMeal =			(_lastAte * 60);" \n
       "dayz_lastDrink =		(_lastDrank * 60);" \n
       "dayz_zombiesLocal = 	0;			//Used to record how many local zombies being tracked" \n
       "dayz_skilllevel = _days;  //total alive dayz" \n
       "" \n
       "//load in medical details" \n
       "r_player_dead = 		player getVariable[""USEC_isDead"",false];" \n
       "r_player_unconscious = 	player getVariable[""NORRN_unconscious"", false];" \n
       "r_player_infected =	player getVariable[""USEC_infected"",false];" \n
       "r_player_injured = 	player getVariable[""USEC_injured"",false];" \n
       "r_player_inpain = 		player getVariable[""USEC_inPain"",false];" \n
       "r_player_cardiac = 	player getVariable[""USEC_isCardiac"",false];" \n
       "r_player_lowblood =	player getVariable[""USEC_lowBlood"",false];" \n
       "r_player_blood = 		player getVariable[""USEC_BloodQty"",r_player_bloodTotal];" \n
       "" \n
       "//Hunger/Thirst" \n
       "_messing =			player getVariable[""messing"",[0,0]];" \n
       "dayz_hunger = 	_messing select 0;" \n
       "dayz_thirst = 		_messing select 1;" \n
       "" \n
       "//player setVariable [""humanity"",-3000, true];"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Alive">*/
        class Alive
        {
          priority = 0.000000;
          to="Position";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"!r_player_dead"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Dead_Player">*/
        class Dead_Player
        {
          priority = 0.000000;
          to="ERROR__Player_Already";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"r_player_dead"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "ERROR__Player_Already">*/
    class ERROR__Player_Already
    {
      name = "ERROR__Player_Already";
      init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
       "selectNoPlayer;" \n
       "_myTime = time;" \n
       ""/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Too_Long">*/
        class Too_Long
        {
          priority = 0.000000;
          to="ERROR__Player_Already";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"(time - _myTime) > 10"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Position">*/
    class Position
    {
      name = "Position";
      init = /*%FSM<STATEINIT""">*/"" \n
       "//Location" \n
       "_myLoc = getPosATL player;" \n
       "" \n
       "dayz_loadScreenMsg = ""Setup Completed, please wait..."";" \n
       "progressLoadingScreen 0.9;" \n
       "" \n
       "//GUI" \n
       "3 cutRsc [""playerStatusGUI"", ""PLAIN"",0];" \n
       "//5 cutRsc [""playerKillScore"", ""PLAIN"",2];" \n
       "" \n
       "//Update GUI" \n
       "call player_updateGui;" \n
       "_id = [] spawn {" \n
       "	disableSerialization;" \n
       "	_display = uiNamespace getVariable 'DAYZ_GUI_display';" \n
       "	_control = 	_display displayCtrl 1204;" \n
       "	_control ctrlShow false;" \n
       "	if (!r_player_injured) then {" \n
       "		_ctrlBleed = 	_display displayCtrl 1303;" \n
       "		_ctrlBleed ctrlShow false;" \n
       "	};" \n
       "	if (!r_fracture_legs and !r_fracture_arms) then {" \n
       "		_ctrlFracture = 	_display displayCtrl 1203;" \n
       "		_ctrlFracture ctrlShow false;" \n
       "	};" \n
       "};" \n
       "" \n
       "call ui_changeDisplay;"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Bad_Version">*/
        class Bad_Version
        {
          priority = 0.000000;
          to="ERROR__Bad_Versi";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"_version != dayz_versionNo"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Version_Ok">*/
        class Version_Ok
        {
          priority = 0.000000;
          to="Stream";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"_version == dayz_versionNo"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Load_In">*/
    class Load_In
    {
      name = "Load_In";
      init = /*%FSM<STATEINIT""">*/"//Reveal action types" \n
       "" \n
       "{player reveal _x} forEach (nearestObjects [getPosATL player, dayz_reveal, 50]);" \n
       "" \n
       "dayz_clientPreload = true;" \n
       "3 fadeSound 1;" \n
       "1 cutText ["""", ""PLAIN""];" \n
       "0 fadeMusic 0.5;" \n
       "" \n
       "//Check mission objects" \n
       "{ _id = [_x,0] spawn object_roadFlare } forEach (allMissionObjects ""RoadFlare"");" \n
       "{ _id = [_x,1] spawn object_roadFlare } forEach (allMissionObjects ""ChemLight"");"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Display_Ready">*/
        class Display_Ready
        {
          priority = 0.000000;
          to="Preload_Display";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"!(isNull (findDisplay 46))"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "ERROR__Bad_Versi">*/
    class ERROR__Bad_Versi
    {
      name = "ERROR__Bad_Versi";
      init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
       "selectNoPlayer;" \n
       "_myTime = time;" \n
       "1 cutText [format[localize ""str_player_18"",dayz_versionNo,_version], ""PLAIN""];"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Too_Long">*/
        class Too_Long
        {
          priority = 0.000000;
          to="ERROR__Bad_Versi";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"(time - _myTime) > 10"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Preload_Display">*/
    class Preload_Display
    {
      name = "Preload_Display";
      init = /*%FSM<STATEINIT""">*/"dayz_lastCheckBit = 0;" \n
       "" \n
       "(findDisplay 46) displayAddEventHandler [""KeyDown"",""_this call dayz_spaceInterrupt""];" \n
       "player disableConversation true;" \n
       "" \n
       "eh_player_killed = player addeventhandler [""FiredNear"",{_this call player_weaponFiredNear;} ];" \n
       "//_eh_combat_projectilenear = player addEventHandler [""IncomingFire"",{_this call player_projectileNear;}];" \n
       "" \n
       "//Select Weapon" \n
       "// Desc: select default weapon & handle multiple muzzles" \n
       "_playerObjName = format[""player%1"",_playerUID];" \n
       "call compile format[""player%1 = player;"",_playerUID];" \n
       "diag_log (format[""player%1 = player"",_playerUID]);" \n
       "publicVariable _playerObjName;" \n
       "" \n
       "//_state = player getVariable[""state"",[]];" \n
       "_currentWpn = """";" \n
       "_currentAnim = """";" \n
       "if (count _state > 0) then {" \n
       "	//Reload players state" \n
       "	_currentWpn		=	_state select 0;" \n
       "	_currentAnim	=	_state select 1;" \n
       "	//Reload players state" \n
       "	if (count _state > 2) then {" \n
       "		dayz_temperatur = _state select 2;" \n
       "	};" \n
       "};" \n
       "" \n
       "if (player hasWeapon ""MeleeCrowbar"") then {" \n
       "	player addMagazine 'crowbar_swing';" \n
       "};" \n
       "if (player hasWeapon ""MeleeHatchet"") then {" \n
       "	player addMagazine 'hatchet_swing';" \n
       "};" \n
       "if (player hasWeapon ""MeleeMachete"") then {" \n
       "	player addMagazine 'machete_swing';" \n
       "};" \n
       "if (player hasWeapon ""MeleeFishingPole"") then {" \n
       "	player addMagazine 'Fishing_Swing';" \n
       "};" \n
       "" \n
       "reload player;" \n
       "" \n
       "if (_currentAnim != """" and !dayz_paraSpawn) then {" \n
       "	[objNull, player, rSwitchMove,_currentAnim] call RE;" \n
       "};" \n
       "if (_currentWpn != """") then {" \n
       "	player selectWeapon _currentWpn;" \n
       "} else {" \n
       "	//Establish default weapon" \n
       "	if (count weapons player > 0) then" \n
       "	{" \n
       "		private['_type', '_muzzles'];" \n
       "" \n
       "		_type = ((weapons player) select 0);" \n
       "		// check for multiple muzzles (eg: GL)" \n
       "		_muzzles = getArray(configFile >> ""cfgWeapons"" >> _type >> ""muzzles"");" \n
       "" \n
       "		if (count _muzzles > 1) then {" \n
       "			player selectWeapon (_muzzles select 0);" \n
       "		} else {" \n
       "			player selectWeapon _type;" \n
       "		};" \n
       "	};" \n
       "};" \n
       "" \n
       "//Player control loop" \n
       "dayz_monitor1 = [] spawn {" \n
       "	while {true} do {" \n
       "		call player_zombieCheck;" \n
       "		sleep 1;" \n
       "	};" \n
       "};" \n
       "" \n
       ""/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Preload_Done">*/
        class Preload_Done
        {
          priority = 0.000000;
          to="Initialize";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"dayz_preloadFinished"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Initialize">*/
    class Initialize
    {
      name = "Initialize";
      init = /*%FSM<STATEINIT""">*/"#define ods(arg1) ""armaperflib"" callextension arg1" \n
       "" \n
       "//Medical" \n
       "dayz_medicalH = 	[] execVM ""\z\addons\dayz_code\medical\init_medical.sqf"";	//Medical Monitor Script (client only)" \n
       "[player] call fnc_usec_damageHandle;" \n
       "if (r_player_unconscious) then {" \n
       "	r_player_timeout = player getVariable[""unconsciousTime"",0];" \n
       "	player playActionNow ""Die"";" \n
       "};" \n
       "player allowDamage true;" \n
       "player enableSimulation true;" \n
       "0 cutText ["""", ""BLACK IN"",3];" \n
       "" \n
       "//Add core tools" \n
       "player addWeapon ""Loot"";" \n
       "player addWeapon ""Flare"";" \n
       "" \n
       "//load in medical details" \n
       "r_player_dead = 		player getVariable[""USEC_isDead"",false];" \n
       "r_player_unconscious = 	player getVariable[""NORRN_unconscious"", false];" \n
       "r_player_infected =		player getVariable[""USEC_infected"",false];" \n
       "r_player_injured = 		player getVariable[""USEC_injured"",false];" \n
       "r_player_inpain = 		player getVariable[""USEC_inPain"",false];" \n
       "r_player_cardiac = 		player getVariable[""USEC_isCardiac"",false];" \n
       "r_player_lowblood =		player getVariable[""USEC_lowBlood"",false];" \n
       "r_player_blood = 		player getVariable[""USEC_BloodQty"",r_player_bloodTotal];" \n
       "" \n
       """colorCorrections"" ppEffectEnable true;" \n
       """colorCorrections"" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, (r_player_blood/r_player_bloodTotal)],  [1, 1, 1, 0.0]];" \n
       """colorCorrections"" ppEffectCommit 0;" \n
       "" \n
       "dayz_gui = [] spawn {" \n
       "	private[""_distance""];" \n
       "	dayz_musicH = [] spawn player_music;" \n
       "	while {true} do {" \n
       "		_array = 			player call world_surfaceNoise;" \n
       "		dayz_surfaceNoise = _array select 1;" \n
       "		dayz_surfaceType = 	_array select 0;" \n
       "" \n
       "		call player_checkStealth;" \n
       "		dayz_statusArray = [] call player_updateGui;" \n
       "		if (!isNull cursorTarget and !dayz_heartBeat) then {" \n
       "			if (alive cursorTarget) then {" \n
       "				_id = cursorTarget spawn dayz_lowHumanity;" \n
       "			};" \n
       "		};" \n
       "		sleep 0.2;" \n
       "	};" \n
       "};" \n
       "" \n
       "dayzGearSave = true;" \n
       "" \n
       "dayz_slowCheck = 	[] spawn player_spawn_2;" \n
       "" \n
       "_world = toUpper(worldName); //toUpper(getText (configFile >> ""CfgWorlds"" >> (worldName) >> ""description""));" \n
       "_nearestCity = nearestLocations [getPos player, [""NameCityCapital"",""NameCity"",""NameVillage"",""NameLocal""],1000];" \n
       "_town = ""Wilderness"";" \n
       "" \n
       "if (count _nearestCity > 0) then {_town = text (_nearestCity select 0)};" \n
       "" \n
       "_strTime = call curTimeStr;" \n
       "_strDate = date;" \n
       "" \n
       "_first = [_world,_town,localize (""str_player_06"") + "" "" + str(_days)] spawn BIS_fnc_infoText;" \n
       "" \n
       "dayz_animalCheck = 	[] spawn player_spawn_1;" \n
       "" \n
       "dayz_spawnCheck = [] spawn {" \n
       "	while {true} do {" \n
       "		[""both""] call player_spawnCheck;" \n
       "		sleep 8;" \n
       "	};" \n
       "};" \n
       "" \n
       "dayz_friendliesCheck = [] spawn {" \n
       "	while {true} do {" \n
       "		call player_friendliesCheck;" \n
       "		sleep 5;" \n
       "	};" \n
       "};" \n
       "" \n
       "dayz_Totalzedscheck = [] spawn {" \n
       "	while {true} do {" \n
       "		dayz_maxCurrentZeds = {alive _x} count entities ""zZombie_Base"";" \n
       "		sleep 60;" \n
       "	};" \n
       "};" \n
       "" \n
       "dayz_backpackcheck = [] spawn {" \n
       "	while {true} do {" \n
       "		call player_dumpBackpack;" \n
       "		sleep 1;" \n
       "	};" \n
       "};" \n
       "//Removed for now" \n
       "//[] execVM ""\z\addons\dayz_code\system\antihack.sqf"";" \n
       "" \n
       "// TODO: questionably" \n
       "{ _x call fnc_vehicleEventHandler; } forEach vehicles;" \n
       "" \n
       "private[""_fadeFire""];" \n
       "{" \n
       "	_fadeFire = _x getVariable['fadeFire', true];" \n
       "	if (!_fadeFire) then {" \n
       "		nul = [_x,2,0,false,false] spawn BIS_Effects_Burn;" \n
       "	};" \n
       "} forEach allMissionObjects ""SpawnableWreck"";" \n
       ""/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "True">*/
        class True
        {
          priority = 0.000000;
          to="Finish";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Finish">*/
    class Finish
    {
      name = "Finish";
      init = /*%FSM<STATEINIT""">*/"dayzGearSave = true;" \n
       "dayz_myPosition = getPosATL player;" \n
       "" \n
       "//[""dayzLoginRecord"",[_playerUID,_charID,0]] call callRpcProcedure;" \n
       "" \n
       "dayzLoginRecord = [_playerUID,_charID,0];" \n
       "publicVariableServer ""dayzLoginRecord"";" \n
       ""/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Enable_Sim">*/
    class Enable_Sim
    {
      name = "Enable_Sim";
      init = /*%FSM<STATEINIT""">*/"_myAnim = getNumber(configFile >> ""CfgPatches"" >> ""dayz_anim"" >> ""isUpdated"");" \n
       ""/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "no_PlayerID">*/
        class no_PlayerID
        {
          priority = 2.000000;
          to="ERROR__No_Player_1";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"_myAnim == 0"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "player_not_null">*/
        class player_not_null
        {
          priority = 0.000000;
          to="Prepare";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"!isNull player"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Gender_Selection">*/
    class Gender_Selection
    {
      name = "Gender_Selection";
      init = /*%FSM<STATEINIT""">*/"dayz_selectGender = ""Survivor2_DZ"";" \n
       "1 cutText ["""", ""BLACK"",0];" \n
       "endLoadingScreen;" \n
       "createDialog ""RscDisplayGenderSelect"";"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Selected">*/
        class Selected
        {
          priority = 0.000000;
          to="Process";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"!dialog"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Process">*/
    class Process
    {
      name = "Process";
      init = /*%FSM<STATEINIT""">*/"_model = dayz_selectGender;"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Hive_Ok">*/
        class Hive_Ok
        {
          priority = 0.000000;
          to="Phase_One";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "ERROR__No_Player_1">*/
    class ERROR__No_Player_1
    {
      name = "ERROR__No_Player_1";
      init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
       "selectNoPlayer;" \n
       "_myTime = time;" \n
       "1 cutText [""You have an outdated version of 'dayz_anim' please download the correct version"", ""PLAIN"",15];"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Too_Long">*/
        class Too_Long
        {
          priority = 0.000000;
          to="ERROR__No_Player_1";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"(time - _myTime) > 10"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Stream">*/
    class Stream
    {
      name = "Stream";
      init = /*%FSM<STATEINIT""">*/"//stream in location" \n
       "//call stream_locationCheck;" \n
       "" \n
       "_zombies = (getPosATL player) nearEntities [""zZombie_Base"",30];" \n
       "{deleteVehicle _x} forEach _zombies;" \n
       "" \n
       "//endLoadingScreen;"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Preloaded">*/
        class Preloaded
        {
          priority = 0.000000;
          to="Load_In";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"preloadCamera _setPos"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Player_Zombie__S">*/
    class Player_Zombie__S
    {
      name = "Player_Zombie__S";
      init = /*%FSM<STATEINIT""">*/"_zssupported = [""pz_policeman"",""pz_suit1"",""pz_suit2"",""pz_worker1"",""pz_worker2"",""pz_worker3"",""pz_doctor"",""pz_teacher"",""pz_hunter"",""pz_villager1"",""pz_villager2"",""pz_villager3"",""pz_priest""];" \n
       "_model =  (_zssupported select floor(random(count _zssupported)));"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Hive_Ok">*/
        class Hive_Ok
        {
          priority = 0.000000;
          to="Phase_One";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
  };
  initState="init";
  finalStates[] =
  {
    "Finish",
  };
};
/*%FSM</COMPILE>*/
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...