Skip to content

Commit

Permalink
bugs and tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
armazac committed Aug 13, 2016
1 parent 09a182c commit 168bd46
Show file tree
Hide file tree
Showing 11 changed files with 221 additions and 54 deletions.
14 changes: 14 additions & 0 deletions AI/civilian.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ _unit addEventHandler ["FiredNear", {
_u disableAI "fsm";
}];

_unit addEventHandler ["HandleDamage", {
_me = _this select 0;
_dmg = _this select 2;
_src = _this select 3;
_proj = _this select 4;
_veh = vehicle _src;
if(_veh != _src) then {
if((driver _veh) == _src) then {
_dmg = 0;
};
};
_dmg;
}];

while {alive _unit} do {
_s = _unit getVariable ["scared",-1];
if(_s > -1) then {
Expand Down
17 changes: 16 additions & 1 deletion AI/criminal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,19 @@ _unit = _this select 0;
_town = _this select 1;

_unit setVariable ["criminal",true,false];
_unit setVariable ["town",_town,false];
_unit setVariable ["town",_town,false];

_unit addEventHandler ["HandleDamage", {
_me = _this select 0;
_src = _this select 3;
if(isPlayer _src) then {
if((vehicle _src) != _src or (_src call unitSeenCRIM)) then {
_src setCaptive false;
{
if(side _x == east) then {
_x reveal [_src,1.5];
};
}foreach(_src nearentities ["Man",50]);
};
};
}];
17 changes: 16 additions & 1 deletion AI/military.sqf
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
_unit = _this select 0;
_unit = _this select 0;

_unit addEventHandler ["HandleDamage", {
_me = _this select 0;
_src = _this select 3;
if(isPlayer _src) then {
if((vehicle _src) != _src or (_src call unitSeenNATO)) then {
_src setCaptive false;
{
if(side _x == west) then {
_x reveal [_src,1.5];
};
}foreach(_src nearentities ["Man",50]);
};
};
}];
15 changes: 15 additions & 0 deletions AI/police.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ _unit setVariable ["garrison",_town,false];

_stability = server getVariable format["stability%1",_town];

_unit addEventHandler ["HandleDamage", {
_me = _this select 0;
_src = _this select 3;
if(isPlayer _src) then {
if((vehicle _src) != _src or (_src call unitSeenNATO)) then {
_src setCaptive false;
{
if(side _x == west) then {
_x reveal [_src,1.5];
};
}foreach(_src nearentities ["Man",50]);
};
};
}];

_skill = 0.5;
if(_stability < 60) then {
_skill = 0.6;
Expand Down
23 changes: 0 additions & 23 deletions VCOMAI/functions/VCOMAI_ClosestAllyWarn.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,6 @@ private ["_Unit","_Wall","_Direction","_Killer","_UnitSide","_NoFlanking","_Grab

_Unit = _this select 0;

_Unit spawn
{
sleep 8;
private ["_Wall"];
_Direction = 0;
for "_i" from 0 to 1 step 1 do
{
_Wall = "Land_InvisibleBarrier_F" createvehiclelocal (getpos _this);
_Wall disableCollisionWith _this;
_Wall setDir _Direction;
_Wall setposATL (getposATL _this);


//[[_Wall],"DisableCollisionALL"] call BIS_fnc_MP;
[_Wall] remoteExec ["DisableCollisionALL",0];
_Wall disableCollisionWith player;

_Wall spawn {sleep 120;deletevehicle _this;};
_Direction = 90;
};
};


if !(side _unit in VCOM_SideBasedMovement) exitWith {};


Expand Down
24 changes: 12 additions & 12 deletions VCOMAI/functions/VCOMAI_DefaultSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ArtilleryArray = [];
AccuracyFunctionRank6 = {
_Unit = _this select 0;

_Unit setSkill ["aimingAccuracy",(0.6 + (random 0.1))];
_Unit setSkill ["aimingAccuracy",(0.4 + (random 0.3))];
_Unit setSkill ["aimingShake",(0.6 + (random 0.1))];
_Unit setSkill ["spotDistance",1];
_Unit setSkill ["spotTime",1];
Expand All @@ -62,8 +62,8 @@ _Unit setSkill ["reloadSpeed",(0.2 + (random 0.3))];
AccuracyFunctionRank5 = {
_Unit = _this select 0;

_Unit setSkill ["aimingAccuracy",(0.6 + (random 0.1))];
_Unit setSkill ["aimingShake",(0.6 + (random 0.1))];
_Unit setSkill ["aimingAccuracy",(0.4 + (random 0.2))];
_Unit setSkill ["aimingShake",(0.5 + (random 0.1))];
_Unit setSkill ["spotDistance",1];
_Unit setSkill ["spotTime",1];
_Unit setSkill ["courage",(0.6 + (random 0.3))];
Expand All @@ -77,8 +77,8 @@ _Unit setSkill ["reloadSpeed",(0.3 + (random 0.3))];
AccuracyFunctionRank4 = {
_Unit = _this select 0;

_Unit setSkill ["aimingAccuracy",(0.6 + (random 0.1))];
_Unit setSkill ["aimingShake",(0.6 + (random 0.1))];
_Unit setSkill ["aimingAccuracy",(0.3 + (random 0.3))];
_Unit setSkill ["aimingShake",(0.4 + (random 0.1))];
_Unit setSkill ["spotDistance",0.9];
_Unit setSkill ["spotTime",1];
_Unit setSkill ["courage",(0.5 + (random 0.3))];
Expand All @@ -92,8 +92,8 @@ _Unit setSkill ["reloadSpeed",(0.4 + (random 0.3))];
AccuracyFunctionRank3 = {
_Unit = _this select 0;

_Unit setSkill ["aimingAccuracy",(0.5 + (random 0.1))];
_Unit setSkill ["aimingShake",(0.5 + (random 0.1))];
_Unit setSkill ["aimingAccuracy",(0.3 + (random 0.2))];
_Unit setSkill ["aimingShake",(0.3 + (random 0.1))];
_Unit setSkill ["spotDistance",0.8];
_Unit setSkill ["spotTime",1];
_Unit setSkill ["courage",(0.4 + (random 0.3))];
Expand All @@ -107,8 +107,8 @@ _Unit setSkill ["reloadSpeed",(0.5 + (random 0.3))];
AccuracyFunctionRank2 = {
_Unit = _this select 0;

_Unit setSkill ["aimingAccuracy",(0.4 + (random 0.1))];
_Unit setSkill ["aimingShake",(0.4 + (random 0.1))];
_Unit setSkill ["aimingAccuracy",(0.2 + (random 0.3))];
_Unit setSkill ["aimingShake",(0.2 + (random 0.1))];
_Unit setSkill ["spotDistance",0.7];
_Unit setSkill ["spotTime",1];
_Unit setSkill ["courage",(0.3 + (random 0.3))];
Expand All @@ -122,8 +122,8 @@ _Unit setSkill ["reloadSpeed",(0.6 + (random 0.3))];
AccuracyFunctionRank1 = {
_Unit = _this select 0;

_Unit setSkill ["aimingAccuracy",(0.3 + (random 0.1))];
_Unit setSkill ["aimingShake",(0.3 + (random 0.1))];
_Unit setSkill ["aimingAccuracy",(0.2 + (random 0.2))];
_Unit setSkill ["aimingShake",(0.1 + (random 0.1))];
_Unit setSkill ["spotDistance",0.6];
_Unit setSkill ["spotTime",1];
_Unit setSkill ["courage",(0.2 + (random 0.3))];
Expand All @@ -138,7 +138,7 @@ AccuracyFunctionRank0 = {
_Unit = _this select 0;

_Unit setSkill ["aimingAccuracy",(0.2 + (random 0.1))];
_Unit setSkill ["aimingShake",(0.2 + (random 0.1))];
_Unit setSkill ["aimingShake",(random 0.1)];
_Unit setSkill ["spotDistance",0.5];
_Unit setSkill ["spotTime",1];
_Unit setSkill ["courage",(0.2 + (random 0.3))];
Expand Down
6 changes: 3 additions & 3 deletions dialogs/stats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ class RscTitles {
x = safezoneX + (0.8 * safezoneW);
y = safezoneY + (0.15 * safezoneH);
w = 0.19 * safezoneW;
h = 0.0660106 * safezoneH;
h = 0.1 * safezoneH;
size = 0.055;//0.020
colorBackground[] = {0,0,0,0};
colorText[] = {0.34,0.33,0.33,0};//{1,1,1,1}
text = "";
font = "PuristaSemiBold";
font = "PuristaLight";
class Attributes {
font = "PuristaSemiBold";
font = "PuristaLight";
color = "#C1C0BB";//"#FFFFFF";
align = "RIGHT";
valign = "top";
Expand Down
20 changes: 17 additions & 3 deletions initPlayerLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ removeVest player;
player linkItem "ItemMap";



if(isMultiplayer and (!isServer)) then {
call compile preprocessFileLineNumbers "initFuncs.sqf";
call compile preprocessFileLineNumbers "initVar.sqf";
};

player forceAddUniform (AIT_clothes_locals call BIS_fnc_selectRandom);

if(player == bigboss) then {
waitUntil {!(isnull (findDisplay 46))};
sleep 1;
Expand All @@ -26,15 +29,26 @@ if(player == bigboss) then {
};
waitUntil {sleep 1;server getVariable ["StartupType",""] != ""};


player forceAddUniform (AIT_clothes_locals call BIS_fnc_selectRandom);

_newplayer = true;
_furniture = [];
_town = "";
_pos = [];
_housepos = [];

player addEventHandler ["HandleDamage", {
_me = _this select 0;
_dmg = _this select 2;
_src = _this select 3;
_proj = _this select 4;
_veh = vehicle _src;
if(_veh != _src) then {
if((driver _veh) == _src) then {
_dmg = _dmg * 0.01;
};
};
_dmg;
}];

if(isMultiplayer || (server getVariable "StartupType") == "LOAD") then {
_data = server getvariable (getplayeruid player);
if !(isNil "_data") then {
Expand Down
Loading

0 comments on commit 168bd46

Please sign in to comment.