1.7.5.M1D9 + tag friend system from

This commit is contained in:
A Clark
2013-01-12 15:24:48 -06:00
parent 8c735ce9c2
commit 7e52d6ee28
21 changed files with 121 additions and 34 deletions

View File

@@ -6,6 +6,8 @@ if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
if (vehicle player != player) exitWith {cutText ["You may not drink while in a vehicle", "PLAIN DOWN"]};
if (dayz_thirst == 0) exitWith {cutText ["I am not thirsty", "PLAIN DOWN"]};
_item = _this;
_hasdrinkitem = _this in magazines player;

View File

@@ -6,6 +6,8 @@ if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
if (vehicle player != player) exitWith {cutText ["You may not eat while in a vehicle", "PLAIN DOWN"]};
if (dayz_hunger == 0) exitWith {cutText ["I am not hungry", "PLAIN DOWN"]};
_item = _this;
_hasfoodmag = _this in magazines player;
@@ -19,6 +21,8 @@ player playActionNow "PutDown";
player removeMagazine _item;
sleep 1;
_regen = round(random _regen);
r_player_blood = r_player_blood + _regen;
if (r_player_blood > r_player_bloodTotal) then {
r_player_blood = r_player_bloodTotal;

View File

@@ -0,0 +1,22 @@
private["_target", "_caller", "_action", "_callerID", "_targetID", "_friendlies", "_rfriendlies"];
_target = _this select 0;
_caller = _this select 1;
_action = _this select 2;
_caller removeAction _action;
_callerID = _caller getVariable "characterID";
_targetID = _target getVariable "characterID";
_friendlies = _caller getVariable ["friendlies", []];
_friendlies set [count _friendlies, _targetID];
_caller setVariable ["friendlies", _friendlies, true];
_rfriendlies = _target getVariable ["friendlies", []];
if (!(_callerID in _rfriendlies)) then {
// caller
titleText [format["You have tagged %1 as friendly. Waiting for %2 to accept that.",(name _target),(name _target)]];
// target
[_caller,_target,"loc",rTITLETEXT,format["%1 wants to tag you as friendly. To accept, tag %2 as friendly.", (name _caller),(name _caller)],"PLAIN DOWN"] call RE;
};

View File

@@ -542,7 +542,7 @@ class Citizen1; // External class reference
icon = "\ca\weapons_e\data\icons\mapIcon_backpack_CA.paa";
mapSize = 2;
model = "\ca\weapons_e\AmmoBoxes\backpack_us_assault.p3d";
transportMaxWeapons = 2;
transportMaxWeapons = 1;
transportMaxMagazines = 12;
};
@@ -554,7 +554,7 @@ class Citizen1; // External class reference
icon = "\ca\weapons_e\data\icons\mapIcon_backpack_CA.paa";
mapsize = 2;
model = "\ca\weapons_e\AmmoBoxes\backpack_acr_small.p3d";
transportMaxWeapons = 2;
transportMaxWeapons = 0;
transportMaxMagazines = 12;
};
@@ -602,7 +602,7 @@ class Citizen1; // External class reference
icon = "\ca\weapons_e\data\icons\mapIcon_backpack_CA.paa";
mapsize = 2;
model = "\ca\weapons_e\AmmoBoxes\backpack_acr.p3d";
transportMaxWeapons = 6;
transportMaxWeapons = 4;
transportMaxMagazines = 24;
};

View File

@@ -52,7 +52,7 @@ if (_canLoot) then {
_nearBy = {alive _x} count nearestObjects [_iPos , ["zZombie_Base"],3] > 0;
_nearByPlayer = ({isPlayer _x} count (_iPos nearEntities ["CAManBase",30])) > 0;
diag_log ("BUILDING: " + _type + " / " + str(_nearBy) + " / " + str(_nearByPlayer));
//diag_log ("BUILDING: " + _type + " / " + str(_nearBy) + " / " + str(_nearByPlayer));
if (!_nearByPlayer and !_nearBy) then {
[_iPos,_unitTypes] call zombie_generate;

View File

@@ -4,7 +4,7 @@ scriptName "Functions\misc\fn_damageActions.sqf";
- Function
- [] call fnc_usec_damageActions;
************************************************************/
private["_menClose","_unit","_unconscious","_lowBlood","_injured","_inPain","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_action1","_action2","_action","_vehClose","_hasVehicle","_vehicle","_inVehicle","_crew","_unconscious_crew","_patients"];
private["_menClose","_unit","_unconscious","_lowBlood","_injured","_inPain","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_action1","_action2","_action","_vehClose","_hasVehicle","_vehicle","_inVehicle","_crew","_unconscious_crew","_patients","_charID","_friendlies"];
_menClose = cursorTarget;
_hasPatient = alive _menClose;
@@ -50,6 +50,8 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco
_inPain = _unit getVariable ["USEC_inPain", false];
_legsBroke = _unit getVariable ["hit_legs", 0] >= 1;
_armsBroke = _unit getVariable ["hit_hands", 0] >= 1;
_charID = _unit getVariable ["characterID", "0"];
_friendlies = player getVariable ["friendlies", []];
_hasBandage = "ItemBandage" in magazines player;
_hasEpi = "ItemEpinephrine" in magazines player;
_hasMorphine = "ItemMorphine" in magazines player;
@@ -177,6 +179,13 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco
r_player_actions set [count r_player_actions,_action];
};
};
if ((isPlayer _unit) and !(_charID in _friendlies)) then {
r_action = true;
_action = _unit addAction ["Tag as friendly", "\z\addons\dayz_code\actions\player_tagFriendly.sqf", [], 0, false, true, "", "_target != player"];
r_player_actions set [count r_player_actions,_action];
};
if (r_action) then {
r_action_targets = r_action_targets + [_unit];
};

View File

@@ -4,7 +4,7 @@ _unit = _this select 0;
_distance = _this select 1;
_doRun = _this select 2;
_pos = _this select 3;
_listTalk = _pos nearEntities ["zZombie_Base",_distance * 3];
_listTalk = _pos nearEntities ["zZombie_Base",_distance * 2];
//hint str(_listTalk);

View File

@@ -84,6 +84,7 @@ terminate dayz_gui;
terminate dayz_zedCheck;
terminate dayz_locationCheck;
terminate dayz_combatCheck;
terminate dayz_friendliesCheck;
//Reset (just in case)
//deleteVehicle dayz_playerTrigger;

View File

@@ -0,0 +1,42 @@
private["_charID", "_friendlies", "_rcharID", "_rfriendlyTo", "_tag", "_player", "_newTagList"];
_charID = player getVariable ["characterID", "0"];
_friendlies = player getVariable ["friendlies", []];
_tagList = player getVariable ["tagList", []];
// create tags
{
if (isPlayer _x) then {
_rcharID = _x getVariable ["characterID", "0"];
_rfriendlies = _x getVariable ["friendlies", []];
_rfriendlyTo = _x getVariable ["friendlyTo", []];
if ((_rcharID in _friendlies) and (_charID in _rfriendlies)) then {
if (!(_charID in _rfriendlyTo)) then {
_position = [0,0,0];
_tag = "Sign_sphere10cm_EP1" createVehicleLocal _position;
_tag attachTo [_x,[0,0,2]];
_tag setVariable ["belongsTo", _rcharID];
_rfriendlyTo set [count _rfriendlyTo, _charID];
_x setVariable ["friendlyTo", _rfriendlyTo];
_tagList set [count _tagList, [_x, _tag]];
player setVariable ["tagList", _tagList];
titleText [format["You and %1 are now tagged as friendlies.", (name _x)], "PLAIN DOWN"];
};
};
};
} forEach playableUnits;
// keep track of tags created
_newTagList = [];
{
_player = _x select 0;
_tag = _x select 1;
// friendly player disconnected
if (!(isPlayer _player)) then {
deleteVehicle _tag;
} else {
_newTagList set [count _newTagList, [_player, _tag]];
};
} forEach _tagList;
player setVariable ["tagList", _newTagList];

View File

@@ -1,4 +1,4 @@
private["_updates","_playerUID","_charID","_humanity","_worldspace","_model"];
private["_updates","_playerUID","_charID","_humanity","_worldspace","_model","_friendlies"];
_playerUID = _this select 0;
_charID = _this select 1;
_model = _this select 2;
@@ -23,6 +23,8 @@ _zombieKills = player getVariable ["zombieKills",0];
_headShots = player getVariable ["headShots",0];
_humanKills = player getVariable ["humanKills",0];
_banditKills = player getVariable ["banditKills",0];
_friendlies = player getVariable ["friendlies",[]];
_tagList = player getVariable ["tagList",[]];
//Switch
_model call player_switchModel;
@@ -72,6 +74,8 @@ player setVariable["humanKills",_humanKills,true];
player setVariable["banditKills",_banditKills,true];
player setVariable["characterID",_charID,true];
player setVariable["worldspace",_worldspace,true];
player setVariable["friendlies",_friendlies,true];
player setVariable["tagList",_tagList,true];
dayzPlayerMorph = [_charID,player,_playerUID,[_zombieKills,_headShots,_humanKills,_banditKills],_humanity];
publicVariable "dayzPlayerMorph";

View File

@@ -9,13 +9,12 @@ _maxWildZombies = 3;
_age = -1;
_nearbyBuildings = [];
_radius = 200;
_maxZombies = 20;
_maxZombies = 10;
diag_log ("Type: " +str(_type));
//diag_log("SPAWN CHECKING: Starting");
_radius = 200;
_locationstypes = ["NameCityCapital","NameCity","NameVillage"];
_nearestCity = nearestLocations [getPos player, _locationstypes, _radius];
_townname = text (_nearestCity select 0);

View File

@@ -30,7 +30,8 @@ _multiplier = 1;
_entHeight = (getPosATL _x) select 2;
_delta = _pHeight - _entHeight;
if ( ((time - _last) > 1) and ((_delta < 1.5) and (_delta > -1.5)) ) then {
[_x, _type] spawn player_zombieAttack;
zedattack = [_x, _type] spawn player_zombieAttack;
waitUntil {scriptDone zedattack};
_x setVariable["lastAttack",time];
};
_attacked = true;
@@ -46,12 +47,12 @@ _multiplier = 1;
//Noise Activation
_targets = _group getVariable ["targets",[]];
if (!(_refObj in _targets)) then {
if (_dist < (DAYZ_disAudial * _multiplier)) then {
if ((DAYZ_disAudial * _multiplier) > 80) then {
if (_dist < DAYZ_disAudial) then {
if (DAYZ_disAudial > 80) then {
_targets set [count _targets, driver _refObj];
_group setVariable ["targets",_targets,true];
} else {
_chance = [_x,_dist,(DAYZ_disAudial * _multiplier)] call dayz_losChance;
_chance = [_x,_dist,DAYZ_disAudial] call dayz_losChance;
//diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance));
if ((random 1) < _chance) then {
_cantSee = [_x,_refObj] call dayz_losCheck;
@@ -59,7 +60,7 @@ _multiplier = 1;
_targets set [count _targets, driver _refObj];
_group setVariable ["targets",_targets,true];
} else {
if (_dist < ((DAYZ_disAudial * _multiplier) / 2)) then {
if (_dist < (DAYZ_disAudial / 2)) then {
_targets set [count _targets, driver _refObj];
_group setVariable ["targets",_targets,true];
};
@@ -71,8 +72,8 @@ _multiplier = 1;
//Sight Activation
_targets = _group getVariable ["targets",[]];
if (!(_refObj in _targets)) then {
if (_dist < (DAYZ_disVisual * _multiplier)) then {
_chance = [_x,_dist,(DAYZ_disVisual * _multiplier)] call dayz_losChance;
if (_dist < DAYZ_disVisual) then {
_chance = [_x,_dist,DAYZ_disVisual] call dayz_losChance;
//diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance));
if ((random 1) < _chance) then {
//diag_log ("Chance Detection");

View File

@@ -49,13 +49,7 @@ if (random 1 > 0.7) then {
//_agent setVariable["host",player,true];
if (!_doLoiter) then {
_agent setPosATL _position;
_agent setDir round(random 180);
if (_nearByPlayer) then {
deleteVehicle _agent;
};
} else {
if (_doLoiter) then {
if (_nearByPlayer) then {
_attempt = 0;
while {_nearByPlayer} do {

View File

@@ -33,7 +33,7 @@ class CfgMods
hidePicture = 0;
hideName = 0;
action = "http://www.dayzmod.com";
version = "1.7.5.M1D7";
version = "1.7.5.M1D9";
hiveVersion = 0.96; //0.93
};
};

View File

@@ -50,6 +50,7 @@ if (!isDedicated) then {
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";

View File

@@ -87,7 +87,7 @@ class RscDisplayMain : RscStandardDisplay
class DAYZ_Version : CA_Version
{
idc = -1;
text = "DayZ 1.7.5.M1D7";
text = "DayZ 1.7.5.M1D9";
y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)";
};
class CA_TitleMainMenu;

View File

@@ -1114,6 +1114,12 @@ class FSM
" sleep 2;" \n
" };" \n
"};" \n
"dayz_friendliesCheck = [] spawn {" \n
" while {true} do {" \n
" call player_friendliesCheck;" \n
" sleep 2;" \n
" };" \n
"};" \n
"// TODO: questionably" \n
"{ _x call fnc_vehicleEventHandler; } forEach vehicles;" \n
"" \n

View File

@@ -99,8 +99,8 @@ link51[] = {39,22};
link52[] = {40,28};
link53[] = {41,5};
link54[] = {42,1};
globals[] = {25.000000,1,0,0,0,640,480,1,101,6316128,1,-671.713867,363.212036,624.148865,-248.208023,713,601,1};
window[] = {2,-1,-1,-32000,-32000,777,66,1274,66,3,730};
globals[] = {25.000000,1,0,0,0,640,480,1,101,6316128,1,-671.713867,363.212036,746.075562,-126.281273,713,601,1};
window[] = {2,-1,-1,-1,-1,777,66,1274,66,3,730};
*//*%FSM</HEAD>*/
class FSM
{
@@ -349,7 +349,7 @@ class FSM
"};" \n
"" \n
"" \n
"if (_agent distance player <= 100) then {" \n
"if (_agent distance player > 15) then {" \n
" _cantSee = [_agent,_target] call dayz_losCheck;" \n
"};" \n
"" \n

View File

@@ -1,4 +1,4 @@
private["_characterID","_playerObj","_playerID","_dummy","_worldspace","_state","_doLoop","_key","_primary","_medical","_stats","_humanity","_lastinstance","_randomSpot","_position","_debug","_distance","_hit","_fractures","_score","_findSpot","_mkr","_counter","_isNear","_isZero","_pos","_isIsland","_w","_clientID"];
private["_characterID","_playerObj","_playerID","_dummy","_worldspace","_state","_doLoop","_key","_primary","_medical","_stats","_humanity","_lastinstance","_randomSpot","_position","_debug","_distance","_hit","_fractures","_score","_findSpot","_mkr","_counter","_isNear","_isZero","_pos","_isIsland","_w","_clientID","_friendlies"];
//Wait for HIVE to be free
//diag_log ("SETUP: attempted with " + str(_this));
@@ -56,6 +56,7 @@ _state = _primary select 3;
_worldspace = _primary select 4;
_humanity = _primary select 5;
_lastinstance = _primary select 6;
_friendlies = [];
//Set position
_randomSpot = false;
@@ -237,6 +238,7 @@ _playerObj setVariable["humanity_CHK",_humanity];
//_playerObj setVariable["worldspace",_worldspace,true];
//_playerObj setVariable["state",_state,true];
_playerObj setVariable["lastPos",getPosATL _playerObj];
_playerObj setVariable["friendlies",_friendlies];
dayzPlayerLogin2 = [_worldspace,_state];
_clientID = owner _playerObj;

View File

@@ -158,6 +158,6 @@ switch (_type) do {
call _object_killed;
};
case "repair": {
call _object_repair;
call _object_damage;
};
};

View File

@@ -315,10 +315,10 @@ spawn_roadblocks = {
//_isRoad = isOnRoad _position;
//_marker = createMarker [str(_position) , _position];
//_marker setMarkerShape "ICON";
//_marker setMarkerType "DOT";
//_marker setMarkerText "ON";
_marker = createMarker [str(_position) , _position];
_marker setMarkerShape "ICON";
_marker setMarkerType "DOT";
_marker setMarkerText "ON";
waitUntil{!isNil "BIS_fnc_selectRandom"};