Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Optimizations" #10

Merged
merged 1 commit into from
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified addons/overthrow_main.pbo
Binary file not shown.
1,789 changes: 956 additions & 833 deletions addons/overthrow_main/campaign/missions/OverthrowMpTanoa.Tanoa/mission.sqm

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions addons/overthrow_main/functions/AI/NPC/fn_initCarDealer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ _unit = _this select 0;

(group _unit) setVariable ["VCM_Disable",true];

private _firstname = selectRandom OT_firstNames_local;
private _lastname = selectRandom OT_lastNames_local;
private _firstname = OT_firstNames_local call BIS_fnc_selectRandom;
private _lastname = OT_lastNames_local call BIS_fnc_selectRandom;
private _fullname = [format["%1 %2",_firstname,_lastname],_firstname,_lastname];
[_unit,_fullname] remoteExecCall ["setName",0,_unit];

Expand All @@ -16,16 +16,13 @@ removeBackpack _unit;
removeHeadgear _unit;
removeVest _unit;

[_unit, (selectRandom OT_faces_local)] remoteExec ["setFace", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, "NoVoice"] remoteExecCall ["setSpeaker", 0, _unit];

_unit forceAddUniform (selectRandom OT_clothes_carDealers);
_unit forceAddUniform (OT_clothes_carDealers call BIS_fnc_selectRandom);

[_unit,"self"] call OT_fnc_setOwner;

_unit disableAI "ALL";
_unit enableAI "ANIM";

_unit addEventHandler ["FiredNear", {
_u = _this select 0;
_u setUnitPos "DOWN";
Expand Down
1 change: 0 additions & 1 deletion addons/overthrow_main/functions/AI/NPC/fn_initCivilian.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ _unit addEventHandler ["FiredNear", {
};
}];

_unit disableAI "FSM";
_unit addEventHandler ["Dammaged", OT_fnc_EnemyDamagedHandler];
8 changes: 4 additions & 4 deletions addons/overthrow_main/functions/AI/NPC/fn_initCrimLeader.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ _unit disableAI "PATH";
_unit setVariable ["crimleader",true,true];
_unit setVariable ["hometown",_town,true];

[_unit, (selectRandom OT_faces_local)] remoteExecCall ["setFace", 0, _unit];
[_unit, (selectRandom OT_voices_local)] remoteExecCall ["setSpeaker", 0, _unit];
_unit forceAddUniform (selectRandom OT_CRIM_Clothes);
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExecCall ["setSpeaker", 0, _unit];
_unit forceAddUniform (OT_CRIM_Clothes call BIS_fnc_selectRandom);

private _gang = OT_civilians getVariable [format["gang%1",_gangid],[]];
_unit setUnitLoadout [_gang select 5,true];
Expand All @@ -22,7 +22,7 @@ if((random 100) < 50) then {
_unit addItem "OT_Blow";
};

_unit addGoggles (selectRandom OT_CRIM_Goggles);
_unit addGoggles (OT_CRIM_Goggles call BIS_fnc_selectRandom);

_unit addEventHandler ["Dammaged", OT_fnc_EnemyDamagedHandler];
_unit addEventHandler ["FiredNear", {params ["_unit"];_unit enableAI "PATH"}];
8 changes: 4 additions & 4 deletions addons/overthrow_main/functions/AI/NPC/fn_initCriminal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ if((random 100) < 15) then {
params ["_unit"];
if((random 100) > 80) exitWith {
//This is a medic
_unit addBackpack (selectRandom OT_allBackpacks);
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
for "_i" from 1 to 10 do {_unit addItemToBackpack "ACE_fieldDressing";};
for "_i" from 1 to 3 do {_unit addItemToBackpack "ACE_morphine";};
_unit addItemToBackpack "ACE_bloodIV";
_unit addItemToBackpack "ACE_epinephrine";
};
if((random 100) > 90) exitWith {
//This is an engineer
_unit addBackpack (selectRandom OT_allBackpacks);
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
for "_i" from 1 to 2 do {_unit addItemToBackpack "DemoCharge_Remote_Mag";};
_unit addItemToBackpack "APERSBoundingMine_Range_Mag";
_unit addItemToBackpack "ClaymoreDirectionalMine_Remote_Mag";
Expand All @@ -42,10 +42,10 @@ if((random 100) < 15) then {
};
if((random 100) > 97) exitWith {
//This guy is a drug runner
_unit addBackpack (selectRandom OT_allBackpacks);
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
for "_i" from 1 to round(random 15) do {_unit addItemToBackpack "OT_Ganja";};
};
};
_unit addGoggles (selectRandom OT_CRIM_Goggles);
_unit addGoggles (OT_CRIM_Goggles call BIS_fnc_selectRandom);

_unit addEventHandler ["Dammaged", OT_fnc_EnemyDamagedHandler];
4 changes: 2 additions & 2 deletions addons/overthrow_main/functions/AI/NPC/fn_initGendarm.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
params ["_unit","_town"];

[_unit, (selectRandom OT_faces_local)] remoteExecCall ["setFace", 0, _unit];
[_unit, (selectRandom OT_voices_local)] remoteExecCall ["setSpeaker", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExecCall ["setSpeaker", 0, _unit];

_unit setVariable ["garrison",_town,false];

Expand Down
10 changes: 4 additions & 6 deletions addons/overthrow_main/functions/AI/NPC/fn_initGunDealer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ _unit = _this select 0;

(group _unit) setVariable ["VCM_Disable",true];

private _firstname = selectRandom OT_firstNames_local;
private _lastname = selectRandom OT_lastNames_local;
private _firstname = OT_firstNames_local call BIS_fnc_selectRandom;
private _lastname = OT_lastNames_local call BIS_fnc_selectRandom;
private _fullname = [format["%1 %2",_firstname,_lastname],_firstname,_lastname];
[_unit,_fullname] remoteExecCall ["setName",0,_unit];

[_unit, (selectRandom OT_faces_local)] remoteExecCall ["setFace", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _unit];
[_unit, "NoVoice"] remoteExecCall ["setSpeaker", 0, _unit];

removeAllWeapons _unit;
Expand All @@ -21,12 +21,10 @@ removeVest _unit;

_unit setVariable ["NOAI",true,false];

_unit forceAddUniform (selectRandom OT_clothes_guerilla);
_unit forceAddUniform (OT_clothes_guerilla call BIS_fnc_selectRandom);
_unit addGoggles (selectRandom OT_allGlasses);

_group = group _unit;
_unit disableAI "ALL";
_unit enableAI "ANIM";

_group setBehaviour "CARELESS";
[_unit,"self"] call OT_fnc_setOwner;
Expand Down
11 changes: 4 additions & 7 deletions addons/overthrow_main/functions/AI/NPC/fn_initHarbor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ _unit = _this select 0;

(group _unit) setVariable ["VCM_Disable",true];

private _firstname = selectRandom OT_firstNames_local;;
private _lastname = selectRandom OT_lastNames_local;
private _firstname = OT_firstNames_local call BIS_fnc_selectRandom;
private _lastname = OT_lastNames_local call BIS_fnc_selectRandom;
private _fullname = [format["%1 %2",_firstname,_lastname],_firstname,_lastname];
[_unit,_fullname] remoteExec ["setCivName",0,_unit];

[_unit, (selectRandom OT_faces_local)] remoteExecCall ["setFace", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _unit];
[_unit, "NoVoice"] remoteExecCall ["setSpeaker", 0, _unit];

removeAllWeapons _unit;
Expand All @@ -19,13 +19,10 @@ removeBackpack _unit;
removeHeadgear _unit;
removeVest _unit;

_unit forceAddUniform (selectRandom OT_clothes_harbor);
_unit forceAddUniform (OT_clothes_harbor call BIS_fnc_selectRandom);

[_unit,"self"] call OT_fnc_setOwner;

_unit disableAI "ALL";
_unit enableAI "ANIM";

_unit addEventHandler ["FiredNear", {
_u = _this select 0;
_u setUnitPos "DOWN";
Expand Down
14 changes: 7 additions & 7 deletions addons/overthrow_main/functions/AI/NPC/fn_initMobBoss.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ _unit = _this;

_unit setVariable ["mobboss",true,false];

private _firstname = selectRandom OT_firstNames_local;
private _lastname = selectRandom OT_lastNames_local;
private _firstname = OT_firstNames_local call BIS_fnc_selectRandom;
private _lastname = OT_lastNames_local call BIS_fnc_selectRandom;
private _fullname = [format["%1 %2",_firstname,_lastname],_firstname,_lastname];
[_unit,_fullname] remoteExecCall ["setName",0,_unit];

Expand All @@ -19,7 +19,7 @@ _unit addEventHandler ["HandleDamage", {
}];

[_unit, OT_face_localBoss] remoteExecCall ["setFace", 0, _unit];
[_unit, (selectRandom OT_voices_local)] remoteExecCall ["setSpeaker", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExecCall ["setSpeaker", 0, _unit];
_unit forceAddUniform OT_clothes_mob;

removeAllItems _unit;
Expand All @@ -34,7 +34,7 @@ _unit addHeadgear "H_Booniehat_khk_hs";

_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit addVest (selectRandom OT_allExpensiveVests);
_unit addVest (OT_allExpensiveVests call BIS_fnc_selectRandom);
if(OT_hasTFAR) then {
_unit linkItem "tf_fadak";
}else{
Expand All @@ -48,7 +48,7 @@ if(_hour < 8 || _hour > 15) then {
_unit linkItem "ACE_Altimeter";
_unit linkItem "ACE_Cellphone";

_weapon = selectRandom (OT_CRIM_Weapons + OT_allCheapRifles);
_weapon = (OT_CRIM_Weapons + OT_allCheapRifles) call BIS_fnc_selectRandom;
_base = [_weapon] call BIS_fnc_baseWeapon;
_magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) select 0;
_unit addMagazine _magazine;
Expand All @@ -75,13 +75,13 @@ for "_i" from 0 to (_numslots-1) do {
_items = getArray(_com);
};
if(count _items > 0) then {
_cls = selectRandom _items;
_cls = _items call BIS_fnc_selectRandom;
_unit addPrimaryWeaponItem _cls;
};
};
};

_weapon = selectRandom OT_allHandguns;
_weapon = OT_allHandguns call BIS_fnc_selectRandom;
_unit addWeaponGlobal _weapon;
_base = [_weapon] call BIS_fnc_baseWeapon;
_magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) select 0;
Expand Down
28 changes: 14 additions & 14 deletions addons/overthrow_main/functions/AI/NPC/fn_initMobster.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ _unit = _this;

_unit setVariable ["mobster",true,false];

private _firstname = selectRandom OT_firstNames_local;
private _lastname = selectRandom OT_lastNames_local;
private _firstname = OT_firstNames_local call BIS_fnc_selectRandom;
private _lastname = OT_lastNames_local call BIS_fnc_selectRandom;
private _fullname = [format["%1 %2",_firstname,_lastname],_firstname,_lastname];
[_unit,_fullname] remoteExecCall ["setName",0,_unit];

Expand All @@ -18,8 +18,8 @@ _unit addEventHandler ["HandleDamage", {
};
}];

[_unit, (selectRandom OT_faces_local)] remoteExecCall ["setFace", 0, _unit];
[_unit, (selectRandom OT_voices_local)] remoteExecCall ["setSpeaker", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExecCall ["setSpeaker", 0, _unit];
_unit forceAddUniform OT_clothes_mob;

removeAllItems _unit;
Expand All @@ -34,7 +34,7 @@ _unit addHeadgear "H_Booniehat_khk";

_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit addVest (selectRandom OT_allProtectiveVests);
_unit addVest (OT_allProtectiveVests call BIS_fnc_selectRandom);
if(OT_hasTFAR) then {
_unit linkItem "tf_fadak";
}else{
Expand All @@ -53,26 +53,26 @@ if((random 100) < 15) then {
_unit addItem "OT_Ganja";
};

_weapon = selectRandom OT_CRIM_Weapons;
_weapon = (OT_CRIM_Weapons) call BIS_fnc_selectRandom;

_unit addWeaponGlobal _weapon;

[_unit] call {
params ["_unit"];
if((random 100) > 98) exitWith {
//This guy has a launcher
_unit addBackpack (selectRandom OT_allBackpacks);
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
_launcher = OT_CRIM_Launchers select 0;
_base = [_launcher] call BIS_fnc_baseWeapon;
_magazine = selectRandom (getArray (configFile / "CfgWeapons" / _base / "magazines"));
_magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) call BIS_fnc_SelectRandom;
_unit addMagazine _magazine;
_unit addMagazine _magazine;
_unit addMagazine _magazine;
_unit addWeaponGlobal _launcher;
};
if((random 100) > 85) exitWith {
//This is a medic
_unit addBackpack (selectRandom OT_allBackpacks);
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);

for "_i" from 1 to 10 do {_unit addItemToBackpack "ACE_fieldDressing";};
for "_i" from 1 to 3 do {_unit addItemToBackpack "ACE_morphine";};
Expand All @@ -81,7 +81,7 @@ _unit addWeaponGlobal _weapon;
};
if((random 100) > 95) exitWith {
//This is an engineer
_unit addBackpack (selectRandom OT_allBackpacks);
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
for "_i" from 1 to 2 do {_unit addItemToBackpack "DemoCharge_Remote_Mag";};
_unit addItemToBackpack "APERSBoundingMine_Range_Mag";
_unit addItemToBackpack "ClaymoreDirectionalMine_Remote_Mag";
Expand All @@ -96,13 +96,13 @@ _unit addWeaponGlobal _weapon;
};
if((random 100) > 97) exitWith {
//This guy just has a shitload of weed
_unit addBackpack (selectRandom OT_allBackpacks);
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
for "_i" from 1 to round(random 30) do {_unit addItemToBackpack "OT_Ganja";};
};
};

_base = [_weapon] call BIS_fnc_baseWeapon;
_magazine = selectRandom (getArray (configFile / "CfgWeapons" / _base / "magazines"));
_magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) call BIS_fnc_SelectRandom;
_unit addMagazine _magazine;
_unit addMagazine _magazine;
_unit addMagazine _magazine;
Expand Down Expand Up @@ -138,13 +138,13 @@ for "_i" from 0 to (_numslots-1) do {
_items = getArray(_com);
};
if(count _items > 0) then {
_cls = selectRandom _items;
_cls = _items call BIS_fnc_selectRandom;
_unit addPrimaryWeaponItem _cls;
};
};
};

_weapon = selectRandom OT_allHandguns;
_weapon = OT_allHandguns call BIS_fnc_selectRandom;
_unit addWeaponGlobal _weapon;
_base = [_weapon] call BIS_fnc_baseWeapon;
_magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) select 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ while {!(isNil "_group") && count (units _group) > 0} do {\
};
if(_cls in OT_illegalItems) then {
_count = _x select 1;
if(!isNull objectParent _unit) then {
if(vehicle _unit != _unit) then {
[_unit,_cls,_count] call CBA_fnc_removeItemCargo;
}else{
for "_i" from 1 to _count do {
Expand Down
7 changes: 3 additions & 4 deletions addons/overthrow_main/functions/AI/NPC/fn_initPriest.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ private ["_unit"];

_unit = _this select 0;
_unit setskill ["courage",1];
private _firstname = selectRandom OT_firstNames_local;
private _lastname = selectRandom OT_lastNames_local;
private _firstname = OT_firstNames_local call BIS_fnc_selectRandom;
private _lastname = OT_lastNames_local call BIS_fnc_selectRandom;
private _fullname = [format["%1 %2",_firstname,_lastname],_firstname,_lastname];
[_unit,_fullname] remoteExecCall ["setName",0,_unit];

Expand All @@ -16,11 +16,10 @@ removeVest _unit;

[_unit,"self"] call OT_fnc_setOwner;

[_unit, (selectRandom OT_faces_local)] remoteExecCall ["setFace", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _unit];
[_unit, "NoVoice"] remoteExecCall ["setSpeaker", 0, _unit];

_unit forceAddUniform OT_clothes_priest;
_unit disableAI "FSM";

_unit addEventHandler ["FiredNear", {
_u = _this select 0;
Expand Down
11 changes: 5 additions & 6 deletions addons/overthrow_main/functions/AI/NPC/fn_initShopkeeper.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ _unit = _this select 0;

(group _unit) setVariable ["VCM_Disable",true];

private _firstname = selectRandom OT_firstNames_local;
private _lastname = selectRandom OT_lastNames_local;
private _firstname = OT_firstNames_local call BIS_fnc_selectRandom;
private _lastname = OT_lastNames_local call BIS_fnc_selectRandom;
private _fullname = [format["%1 %2",_firstname,_lastname],_firstname,_lastname];
[_unit,_fullname] remoteExecCall ["setName",0,_unit];
_unit allowDamage false;

[_unit, (selectRandom OT_faces_local)] remoteExecCall ["setFace", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _unit];
[_unit, "NoVoice"] remoteExecCall ["setSpeaker", 0, _unit];

removeAllWeapons _unit;
Expand All @@ -20,9 +20,8 @@ removeBackpack _unit;
removeHeadgear _unit;
removeVest _unit;

_unit forceAddUniform (selectRandom OT_clothes_shops);
_unit forceAddUniform (OT_clothes_shops call BIS_fnc_selectRandom);

[_unit,"self"] call OT_fnc_setOwner;

_unit disableAI "ALL";
_unit enableAI "ANIM";
_unit disableAI "MOVE";
2 changes: 1 addition & 1 deletion addons/overthrow_main/functions/AI/NPC/fn_initSniper.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _unit setVariable ["NOAI",true,false];
[
{
private _dir = random 360;
private _pos = _this getPos [1, _dir];
private _pos = ([_this,1,_dir] call BIS_fnc_relPos);
_this setposATL [_pos select 0,_pos select 1,((getposATL _this) select 2)+0.3];
_this setDir _dir;
_this setUnitPos "MIDDLE";
Expand Down
Loading