Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
armazac committed May 1, 2017
1 parent 1aea537 commit d23df4b
Show file tree
Hide file tree
Showing 22 changed files with 113 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@ openMap true;
if([_pos,"Misc"] call OT_fnc_canPlace) then {
_handled = true;
};

_ob = _pos call OT_fnc_nearestLocation;

_ob params ["_obpos","_obtype","_data"];
if (_obtype == "Business") then {
_p = _data select 0;
if(_pos distance _p < 50) then {
_name = _data select 1;
if(_name in (server getvariable ["GEURowned",[]])) then {
_handled = true;
};
};
};
};


Expand All @@ -53,9 +40,11 @@ openMap true;
_validob = (_obpos distance _pos < 50) and (_obname in OT_allAirports);
if !(_validob) then {
if (!OT_adminMode and !(_pos inArea _region)) then {
_valid = false;
"You cannot fast travel between islands unless your destination is a controlled airfield" call notify_minor;
openMap false;
if !([_region,_pos] call OT_fnc_regionIsConnected) then {
_valid = false;
"You cannot fast travel between islands unless there is a bridge or your destination is a controlled airfield" call notify_minor;
openMap false;
};
};
};
if(!_valid) exitWith {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ if(_cost > 0) then {
if(_typecls == "Camp") then {
_mrkid = format["%1-camp",getplayeruid player];
createMarker [_mrkid,getpos modeTarget];
_mrkid setMarkerPos (getpos modeTarget);
_camp = player getVariable["camp",[]];
if(count _camp > 0) then {
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ _sorted = [_objects,[],{_x distance player},"ASCEND"] call BIS_fnc_SortBy;
_target = _sorted select 0;

_doTransfer = {
private _veh = vehicle player;
private _target = _this;
private _toname = (typeof _target) call ISSE_Cfg_Vehicle_GetName;
private _iswarehouse = (_target isKindOf "OT_warehouse");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ OT_economicData = [
[[11921.1,10206.5,0],"Red Spring Surface Mine","","OT_Steel"],
[[12383,14135.3,0],"Ravi-ta Island Resort"],
[[4687.63,3590.75,0],"Katkoula Sugar Plantations","","OT_Sugarcane"],
[[8026.38,8946.16,0],"Lifou Sugar Plantations","","OT_Sugarcane"]
[[8026.38,8946.16,0],"Lifou Sugar Plantations","","OT_Sugarcane"],
[[12445.6,3982.46,0],"Saioko Lumberyard","","OT_Wood"]
];
OT_factoryPos = [4226.49,8370.82,0];
OT_factoryVehicleSpawn = [4265.64,8400.65,0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ overviewPicture = "\ot\campaign\missions\Overthrow.Tanoa\overthrow_tanoa.jpg";
author="ARMAzac";
briefingName = "Overthrow Tanoa";
OnLoadName = "Overthrow Tanoa";
OnLoadMission = "v0.7.3.4";
OnLoadMission = "v0.7.3.5";
loadScreen = "\ot\campaign\missions\Overthrow.Tanoa\pic.jpg";
onLoadMissionTime = 1;
allowSubordinatesTakeWeapons= 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ while {true} do {
{
if(side _x == west) then {
_lead = (units _x) select 0;
if(_lead getVariable ["garrison",""] == "HQ") then {
if(vehicle _lead != _lead) then {
if((_lead getVariable ["garrison",""]) == "HQ") then {
if((vehicle _lead) != _lead) then {
[vehicle _lead] spawn OT_fnc_cleanup;
};
[_x] spawn OT_fnc_cleanup;
Expand Down Expand Up @@ -446,14 +446,17 @@ while {true} do {
_pos = _x select 0;
_name = _x select 1;
if !(_name in _abandoned) then {
_garrison = server getvariable format["garrison%1",_name];
if(_garrison < 2) then {
_abandoned pushback _name;
server setVariable ["NATOabandoned",_abandoned,true];
_name setMarkerColor "ColorGUER";
_t = _pos call OT_fnc_nearestTown;
format["We have captured the %1 tower",_name] remoteExec ["notify_good",0,false];
_resources = _resources - 100;
if(_pos call OT_fnc_inSpawnDistance) then {
_nummil = {side _x == west} count (_pos nearObjects ["CAManBase",300]);
_numres = {side _x == resistance or captive _x} count (_pos nearObjects ["CAManBase",100]);
if(_nummil < 3 and _numres > 0) then {
_abandoned pushback _name;
server setVariable ["NATOabandoned",_abandoned,true];
_name setMarkerColor "ColorGUER";
_t = _pos call OT_fnc_nearestTown;
format["Resistance has captured the %1 tower",_name] remoteExec ["notify_good",0,false];
_resources = _resources - 100;
};
};
};
}foreach(OT_NATOcomms);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,13 @@ OT_fnc_regionIsConnected = {
private _region = "";
if((typename _f) == "ARRAY") then {
_por = _f call OT_fnc_getRegion;
}else{
_por = _f;
};
if((typename _t) == "ARRAY") then {
_region = _t call OT_fnc_getRegion;
}else{
_region = _t;
};
if(_por == _region) exitWith {true};
private _ret = false;
Expand Down Expand Up @@ -497,6 +501,7 @@ OT_fnc_initRecruit = {

_civ setSkill 1.0;
_civ setRank "PRIVATE";
_civ setVariable ["NOAI",false,true];

_civ spawn wantedSystem;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,14 @@ if(isMultiplayer or _startup == "LOAD") then {
_civ = group player createUnit [_type,_civ,[],0,"NONE"];
_civ setVariable ["owner",getplayeruid player,true];
_civ setVariable ["OT_xp",_xp,true];
_civ setVariable ["NOAI",true,true];
_civ setRank _rank;
[_civ, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _civ];
[_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExecCall ["setSpeaker", 0, _civ];
_civ setUnitLoadout _loadout;
_civ spawn wantedSystem;
_civ setName _name;

[_civ] joinSilent grpNull;
[_civ] joinSilent (group player);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ OT_currentMissionFaction = "";
OT_rankXP = [100,250,500,1000,4000,10000,100000];

//Used to control updates and persistent save compatability. When these numbers go up, that section will be reinitialized on load if required. (ie leave them alone)
OT_economyVersion = 11;
OT_economyVersion = 12;
OT_NATOversion = 7;
OT_CRIMversion = 1;
OT_adminMode = false;
Expand Down Expand Up @@ -55,10 +55,10 @@ OT_flag_CRIM = "Flag_Syndikat_F";

OT_item_wrecks = ["Land_Wreck_HMMWV_F","Land_Wreck_Skodovka_F","Land_Wreck_Truck_F","Land_Wreck_Car2_F","Land_Wreck_Car_F","Land_Wreck_Hunter_F","Land_Wreck_Offroad_F","Land_Wreck_Offroad2_F","Land_Wreck_UAZ_F","Land_Wreck_Truck_dropside_F"]; //rekt

OT_spawnTowns = ["Rautake","Tavu","Balavu","Muaceba","Katkoula","Savaka"]; //Towns where new players will spawn
OT_spawnTowns = ["Balavu","Katkoula","Savaka","Namuvaka","Katkoula","Lailai","Taga","Bua Bua","Blerick","Moddergat","Tobakoro"]; //Towns where new players will spawn
OT_spawnHouses = ["Land_Slum_01_F","Land_Slum_02_F","Land_House_Native_02_F"]; //Houses where new players will spawn

OT_NATOwait = 300; //Half the Average time between NATO orders
OT_NATOwait = 30; //Half the Average time between NATO orders
OT_CRIMwait = 500; //Half the Average time between crim changes

//Interactable items that spawn in your house
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ class EditorData
};
class LayerIndexProvider
{
nextID=239;
nextID=244;
};
class Camera
{
pos[]={12818.754,4.0914273,1638.0454};
dir[]={0.59407037,0.033020224,0.80378884};
up[]={-0.019614713,0.99946028,-0.026539376};
aside[]={0.80424064,1.7185812e-007,-0.59440583};
pos[]={4243.1357,213.96484,8514.3701};
dir[]={-0.18939824,-0.81224841,-0.55183423};
up[]={-0.26368478,0.58325732,-0.7682761};
aside[]={-0.94591063,4.8257789e-007,0.3246502};
};
};
binarizationWanted=0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ private _title = "";

//Here is where we might randomize the parameters a bit
private _abandoned = server getVariable ["NATOabandoned",[]];
_destinationName = selectRandom (OT_allTowns - _abandoned);
_destinationName = selectRandom (OT_allTowns - _abandoned - [player call OT_fnc_nearestTown]);
private _posTown = server getVariable [_destinationName,[]];

_building = [_posTown,OT_gunDealerHouses] call OT_fnc_getRandomBuilding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ private _title = "";

//Here is where we might randomize the parameters a bit
private _abandoned = server getVariable ["NATOabandoned",[]];
_destinationName = selectRandom (OT_allTowns - _abandoned);
_destinationName = selectRandom (OT_allTowns - _abandoned - [player call OT_fnc_nearestTown]);
private _posTown = server getVariable [_destinationName,[]];

_building = [_posTown,OT_gunDealerHouses] call OT_fnc_getRandomBuilding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ if((random 100) > 50) then { // 50/50 chance of either
_pickup = [[[getMarkerPos format["port_%1", ceil(random 2)],80]]] call BIS_fnc_randomPos;
_pickupTown = _pickup call OT_fnc_nearestTown;

//Destination is the town closest to the player right now
_destinationTown = (getpos player) call OT_fnc_nearestTown;
//Destination is a random town
_destinationTown = selectRandom (OT_allTowns - _abandoned - [player call OT_fnc_nearestTown]);
_posTown = server getVariable _destinationTown;

//Pick a random small house as the dropoff
Expand All @@ -27,8 +27,8 @@ if((random 100) > 50) then { // 50/50 chance of either
_type = "insertion";
}else{
//Extraction
//Pickup will be the closest town to the player right now
_pickupTown = (getpos player) call OT_fnc_nearestTown;
//Pickup will be a random town
_pickupTown = selectRandom (OT_allTowns - _abandoned - [player call OT_fnc_nearestTown]);
_posTown = server getVariable _pickupTown;
_pickup = [[[_posTown,200]]] call BIS_fnc_randomPos;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ while {(_count < _numVeh)} do {

_region = server getVariable format["region_%1",_town];
_dest = (server getVariable format["towns_%1",_region]) call BIS_fnc_selectRandom;
_moveto = getpos([server getvariable _dest,OT_allHouses + OT_allShops + OT_offices] call OT_fnc_getRandomBuilding);
_bdg = [server getvariable _dest,OT_allHouses + OT_allShops + OT_offices] call OT_fnc_getRandomBuilding;
if(typename _bdg == "BOOL") then {
_moveto = server getvariable _dest;
}else{
_moveto = getpos(_bdg);
};
_wp = _group addWaypoint [_moveto,0];

_wp setWaypointType "MOVE";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ private _town = _this;
private _townPos = server getVariable _town;

private _stability = server getVariable format["stability%1",_town];
private _region = server getVariable format["region_%1",_town];
private _region = server getVariable [format["region_%1",_town],"fake_region"];

private _police = [];
private _support = [];
Expand Down Expand Up @@ -30,6 +30,14 @@ private _attacking = server getVariable["NATOattacking",""];
}foreach(OT_NATOobjectives);

if(!isNil "_close") then {
if((_close distance _townPos) > 2000) then {
_closestTown = [_townPos,true] call OT_fnc_nearestTown;
if !(_closestTown in _abandoned) then {
_close = server getVariable _closestTown;
_closest = _closestTown;
};
};

_current = server getVariable [format ["garrison%1",_town],0];
server setVariable [format ["garrison%1",_town],_current+4,true];
if !(_townPos call OT_fnc_inSpawnDistance) exitWith {};
Expand Down Expand Up @@ -65,7 +73,7 @@ if(!isNil "_close") then {
[_civ,_town] call OT_fnc_initGendarm;
_civ setBehaviour "SAFE";

sleep 5;
sleep 1;

_group call OT_fnc_initGendarmPatrol;
_group call distributeAILoad;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
private _group = _this;

private _garrison = ((units _group) select 0) getvariable ["garrison",""];
private _start = position ((units _group) select 0);
private _start = server getVariable [_garrison,position ((units _group) select 0)];

if(isNil "_start") exitWith {};

Expand Down
14 changes: 7 additions & 7 deletions addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicl
_unit doMove getpos _t;

_timeout = time + 120;
waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 5) or (_timeOut < time) or (unitReady _unit)};
waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 10) or (_timeOut < time) or (unitReady _unit)};
if(!alive _unit or (isNull _t) or (_timeOut < time)) exitWith {};

if !([_unit,_t] call dumpStuff) then {
Expand All @@ -70,7 +70,7 @@ format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicl
_unit doMove getpos _deadguy;
[_unit,1] call OT_fnc_experience;

waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _deadguy < 5) or (_timeOut < time)};
waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _deadguy < 10) or (_timeOut < time)};
if((!alive _unit) or (_timeOut < time)) exitWith {};

[_deadguy,_unit] call takeStuff;
Expand All @@ -92,7 +92,7 @@ format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicl
}foreach(_unit nearentities ["WeaponHolderSimulated",10]);
if !(isNull _weapon) then {
_unit doMove getpos _weapon;
waitUntil {sleep 1; (!alive _unit) or (_unit distance _weapon < 5) or (_timeOut < time)};
waitUntil {sleep 1; (!alive _unit) or (_unit distance _weapon < 10) or (_timeOut < time)};
if(alive _unit and (_timeOut > time)) then {
_s = (weaponsItems _weapon) select 0;

Expand All @@ -111,7 +111,7 @@ format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicl
if(!alive _unit) exitWith {};
_timeout = time + 120;
_unit doMove getpos _t;
waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 5) or (_timeOut < time)};
waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 10) or (_timeOut < time)};
if((!alive _unit) or (_timeOut < time)) exitWith {};

if !([_unit,_t] call dumpStuff) exitWith {
Expand All @@ -136,7 +136,7 @@ format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicl

_timeout = time + 120;
_unit doMove getpos _weapon;
waitUntil {sleep 1; (!alive _unit) or (_unit distance _weapon < 5) or (_timeOut < time) or (unitReady _unit)};
waitUntil {sleep 1; (!alive _unit) or (_unit distance _weapon < 10) or (_timeOut < time) or (unitReady _unit)};
if(alive _unit and (_timeOut > time)) then {
_s = (weaponsItems _weapon) select 0;
_cls = (_s select 0);
Expand All @@ -153,12 +153,12 @@ format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicl
if(!alive _unit) exitWith {};
_timeout = time + 120;
_unit doMove getpos _t;
waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 5) or (_timeOut < time) or (unitReady _unit)};
waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 10) or (_timeOut < time) or (unitReady _unit)};
if((!alive _unit) or (_timeOut < time)) exitWith {};

[_unit,_t] call dumpStuff;
};
_unit setVariable ["NOAI",false,true];
_unit setVariable ["NOAI",true,true];
if(_wasincar) then {
_unit assignAsCargo _car;
[_unit] orderGetIn true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if(((vehicle _unit) != _unit) and (vehicle _unit) != _target) then {
};
if(vehicle _unit != _target) then {
_unit doMove position _target;
waitUntil {sleep 1;!alive _unit or (_unit distance _target < 5)};
waitUntil {sleep 1;!alive _unit or (_unit distance _target < 10)};
};

if(alive _unit) then {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ _success = {
_abandoned deleteAt (_abandoned find _objective);
_count = {(_x getVariable ["garrison",""]) == _objective} count (allunits);
server setVariable [format["garrison%1",_objective],_count,true];
_objective setMarkerType "flag_NATO";
};
[_posObjective,_strength,_success,_fail,[_tskid,_objective],_objective] spawn OT_fnc_NATOQRF;
5 changes: 3 additions & 2 deletions addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ waitUntil {
(_numalive < 4) or (time > _timeout) or (_numin > 4)
};

private _force = spawner getVariable["NATOattackforce",[]];
{
_target = leader _x;
{
Expand Down Expand Up @@ -267,8 +268,8 @@ while {sleep 5;time < _timeout and !_won} do {
if(side _x == west) then {
if(count (units _x) > 0) then {
_lead = (units _x) select 0;
if(_lead getVariable ["garrison",""] == "HQ") then {
if(vehicle _lead != _lead) then {
if((_lead getVariable ["garrison",""]) == "HQ") then {
if((vehicle _lead) != _lead) then {
[vehicle _lead] spawn OT_fnc_cleanup;
}else{
if((getpos _lead) call OT_fnc_inSpawnDistance) then {
Expand Down
Loading

0 comments on commit d23df4b

Please sign in to comment.