Skip to content
Open

Fixes #108

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
50 changes: 26 additions & 24 deletions source/INIT.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,16 @@ else /// JIP for the client
if (isNil "Array_of_FOBname") then {
Array_of_FOBname = [];
};


game_master = ["player1"];
player allowDamage false;

#include "dialog\supports_init.hpp"
#include "dialog\squad_number_init.hpp"

execVM "misc\gps_marker.sqf";
if (!isMultiplayer) then {
getsize_script = [player] execVM "mapsize.sqf";
};

getsize_script = [player] execVM "mapsize.sqf";

// IF MP
if (isMultiplayer) then {
Expand Down Expand Up @@ -221,29 +221,37 @@ if (isMultiplayer) then {
"finishedMissionsNumber" addPublicVariableEventHandler {[] execVM "persistent\persistent_stats_missions_total.sqf";}; // change the shown CP for request dialog
};

if (isServer) then { // SERVER INIT
sleep 5;

if (((vehiclevarname player) in game_master)) then {
DUWS_host_start = false;
publicVariable "DUWS_host_start";
waitUntil {time > 0.1};
getsize_script = [player] execVM "mapsize.sqf";
DUWS_host_start = true;
publicVariable "DUWS_host_start";

// init High Command
_handle = [] execVM "dialog\hc_init.sqf";
waitUntil {scriptDone getsize_script};
};
};

if (isServer) then {
_null = [] execVM "dialog\startup\hq_placement\placement.sqf";
waitUntil {chosen_hq_placement};
_null = [] execVM "dialog\startup\hq_placement\placement.sqf";
waitUntil {chosen_hq_placement};

// create random HQ
if (!hq_manually_placed && !player_is_choosing_hqpos) then {
hq_create = [20, 0.015] execVM "initHQ\locatorHQ.sqf";
waitUntil {scriptDone hq_create};
};
// create random HQ
if (!hq_manually_placed && !player_is_choosing_hqpos) then {
hq_create = [20, 0.015] execVM "initHQ\locatorHQ.sqf";
waitUntil {scriptDone hq_create};
};

if (hasinterface) then {
_grplogic = createGroup sideLogic;
_hc_module = _grplogic createUnit ["HighCommand",[0,0,0] , [], 0, ""];
_hc_module synchronizeObjectsAdd [game_master];
// done,

// make 1 HC subordinate so that the player will not control all blufor forces
_grplogic = createGroup sideLogic;
_sub_module = _grplogic createUnit ["HighCommandsubordinate",[0,0,0] , [], 0, ""];
_sub_module synchronizeObjectsAdd [_hc_module];
};

/*
Expand Down Expand Up @@ -286,16 +294,10 @@ if (!isServer) then {
player setdamage 0;
player allowDamage true;
hintsilent format["Joined game, welcome to %1, %2",worldName,profileName];

// init High Command
_handle = [] execVM "dialog\hc_init.sqf";

[] execVM "dialog\startup\weather_client.sqf";
};

if (!isMultiplayer) then {
_handle = [] execVM "dialog\hc_init.sqf";
};

if (isServer) then {
// initialise the ressources per zone bonus
_basepoint = [] execVM "zonesundercontrol.sqf";
Expand Down
11 changes: 11 additions & 0 deletions source/dialog/UAV1.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
_pos = getpos player;

_plane1 = createVehicle ["B_UAV_02_F", _pos,[], 0, "FLY"];
_plane1 setpos [_pos select 0, _pos select 1, (_pos select 2) + 1000];
_planegroup1 = createvehiclecrew _plane1;

sleep 2;

_wp1 = _planegroup1 addWaypoint [_pos,0];
_wp1 setWaypointType "GUARD";
[_planegroup1, 1] setWaypointCombatMode "BLUE";
11 changes: 11 additions & 0 deletions source/dialog/UAV2.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
_pos = getpos player;

_plane1 = createVehicle ["B_UAV_02_CAS_F", _pos,[], 0, "FLY"];
_plane1 setpos [_pos select 0, _pos select 1, (_pos select 2) + 1000];
_planegroup1 = createvehiclecrew _plane1;

sleep 2;

_wp1 = _planegroup1 addWaypoint [_pos,0];
_wp1 setWaypointType "GUARD";
[_planegroup1, 1] setWaypointCombatMode "BLUE";
11 changes: 11 additions & 0 deletions source/dialog/UAV3.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
_pos = getpos player;

_plane1 = createVehicle ["B_UAV_01_F", _pos,[], 0, "FLY"];
_plane1 setpos [_pos select 0, _pos select 1, (_pos select 2) + 1000];
_planegroup1 = createvehiclecrew _plane1;

sleep 2;

_wp1 = _planegroup1 addWaypoint [_pos,0];
_wp1 setWaypointType "GUARD";
[_planegroup1, 1] setWaypointCombatMode "BLUE";
35 changes: 35 additions & 0 deletions source/dialog/casspawn.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
_pos = getpos player;

_plane = createVehicle ["B_Plane_CAS_01_F", _pos,[], 0, "FLY"];
_plane setpos [_pos select 0, _pos select 1, (_pos select 2) + 1000];
_planegroup = createGroup west;

_pilot = _planegroup createUnit ["B_Pilot_F", [5,5,5], [], 0, "NONE"];
_pilot setcaptive true;
_pilot allowfleeing 0;
_pilot disableAI "Target";
_pilot moveindriver _plane;
_plane land "LAND";

waituntil {(istouchingground _plane)};
_plane engineOn false;
_plane setFuel 0;

waitUntil {(speed _plane) <= 0};
_plane setDamage 0;
deletevehicle _pilot;
_plane setfuel 1;

waitUntil {(speed _plane) <= 0};
if (!alive _plane) then {hint "Your A-164 CAS has crashed"} else {
_pos2 = getPos _plane;
_marker = format["plane",_pos2]; // Define marker name
_markerstr = createMarker [str(_marker), _pos2];
_markerstr setMarkerShape "ICON";
str(_marker) setMarkerType "hd_end";
str(_marker) setMarkerColor "ColorGreen";
str(_marker) setMarkerText "A-164 CAS Lands Here";
};

waituntil {(speed _plane) > 0};
deleteMarker str(_marker);
2 changes: 1 addition & 1 deletion source/dialog/request.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ _index1 = lbAdd [2102, "SF SUV(2CP)"]; // 19
_index1 = lbAdd [2102, "MLRS Artillary (75CP)"]; // 20
_index1 = lbAdd [2102, "Scorcher Artillary (75CP)"]; // 21
_index1 = lbAdd [2102, "Fuel Truck (10CP)"]; // 22
_index1 = lbAdd [2102, "BUY ONLY AT AIRPORTS A-164 CAS(45CP)"]; // 23
_index1 = lbAdd [2102, "A-164 CAS(45CP)"]; // 23
_index1 = lbAdd [2102, "M2A4 SlammerUP(40CP)"]; // 24
_index1 = lbAdd [2102, "Stomper RCWS Autonomous(20CP)"]; // 25
_index1 = lbAdd [2102, "Stomper Autonomous Recon(10CP)"]; // 26
Expand Down
8 changes: 4 additions & 4 deletions source/dialog/request_vehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ switch (_index) do {
hint "Vehicle ready !";
commandpointsblu1 = commandpointsblu1 - 45;
ctrlSetText [1000, format["%1",commandpointsblu1]];
_vehic = "B_Plane_CAS_01_F" createVehicle _spawnPos;
_vehic = execVM "dialog\casspawn.sqf";
} else {
hint "Not enough command points";
};
Expand Down Expand Up @@ -294,7 +294,7 @@ switch (_index) do {
hint "Vehicle ready !";
commandpointsblu1 = commandpointsblu1 - 15;
ctrlSetText [1000, format["%1",commandpointsblu1]];
_vehic = "B_UAV_02_F" createVehicle _spawnPos; createVehicleCrew _vehic;
_vehic = execVM "dialog\UAV1.sqf";
} else {
hint "Not enough command points";
};
Expand All @@ -304,7 +304,7 @@ switch (_index) do {
hint "Vehicle ready !";
commandpointsblu1 = commandpointsblu1 - 15;
ctrlSetText [1000, format["%1",commandpointsblu1]];
_vehic = "B_UAV_02_CAS_F" createVehicle _spawnPos; createVehicleCrew _vehic;
_vehic = execVM "dialog\UAV2.sqf";
} else {
hint "Not enough command points";
};
Expand All @@ -314,7 +314,7 @@ switch (_index) do {
hint "Vehicle ready !";
commandpointsblu1 = commandpointsblu1 - 5;
ctrlSetText [1000, format["%1",commandpointsblu1]];
_vehic = "B_UAV_01_F" createVehicle _spawnPos; createVehicleCrew _vehic;
_vehic = execVM "dialog\UAV3.sqf";
} else {
hint "Not enough command points";
};
Expand Down
42 changes: 18 additions & 24 deletions source/initHQ/BluHQinit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -72,30 +72,24 @@ sleep 0.1;
HQ_pos_found_generated = true;
publicVariable "HQ_pos_found_generated";

if (!zones_manually_placed) then {

// SHOW THE STARTUP MENU
if (!zones_created) then {
sleep 0.1;
_nill = [] execVM "dialog\startup\startup.sqf";
waitUntil {chosen_settings}; // WAIT UNTIL THE PLAYER HAS CHOSEN THE SETTINGS
};

// WEATHER INIT
if (dynamic_weather_enable) then {
_weather_script = [] execVM "dialog\startup\weather.sqf";
};

// CALL ZONES GENERATION
waitUntil {!isNil {getsize_script}}; // WAIT UNTIL THE MAPSIZE SCRIPT IS DONE

// CHECK IF ZONES ARE PLACED...
// If not execute locatorZonesV1.sqf if the user wants them randomly placed. V2 if the user wants to place zones.
if (!zones_created && !manually_chosen) then {
_zones_create = [50, 0.2] execVM "initZones\locatorZonesV1.sqf";
} else {
_zones_create = [50, 0.2] execVM "initZones\locatorZonesV2.sqf";
};
// SHOW THE STARTUP MENU
if (!zones_created) then {
sleep 0.1;
_nill = [] execVM "dialog\startup\startup.sqf";
waitUntil {chosen_settings}; // WAIT UNTIL THE PLAYER HAS CHOSEN THE SETTINGS
};

// WEATHER INIT
if (dynamic_weather_enable) then {
_weather_script = [] execVM "dialog\startup\weather.sqf";
};

// CHECK IF ZONES ARE PLACED...
// If not execute locatorZonesV1.sqf if the user wants them randomly placed. V2 if the user wants to place zones.
if (!zones_created && !manually_chosen) then {
_zones_create = [50, 0.2] execVM "initZones\locatorZonesV1.sqf";
} else {
_zones_create = [50, 0.2] execVM "initZones\locatorZonesV2.sqf";
};

player allowDamage true;
Expand Down
1 change: 1 addition & 0 deletions source/initHQ/HQaddactions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ _hq addaction ["<t color='#ff00ff'>Player stats</t>","dialog\info\info.sqf", "",
_hq addaction ["<t color='#15ff00'>Request units</t>","dialog\request.sqf", "", 0, true, true, "", "_this == player"];
_hq addaction ["<t color='#ffb700'>Squad manager</t>","dialog\squad\squadmng.sqf", "", 0, true, true, "", "_this == player"];
_hq addaction ["<t color='#ffb700'>FOB manager</t>","dialog\fob\FOBmanageropen.sqf", "", 0, true, true, "", "_this == player"];
_hq addaction ["<t color='#15ff00'>Sell resource</t>","support\sell.sqf", "", 0, true, true, "", "_this == player"];
if (isServer) then {
_hq addaction ["<t color='#00b7ff'>Rest (wait/save)</t>","savegame.sqf", "", 0, true, true, "", "_this == player"];
};
Expand Down
2 changes: 1 addition & 1 deletion source/initZones/locatorzonesV1.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ while {!_found} do
_posDeMeilleurTruc = [center_of_map, 0,half_of_map,5,0,0.1,0,[],[[0,0],[0,0]]] call BIS_fnc_findSafePos;
if (_posDeMeilleurTruc select 0 != 0 && _posDeMeilleurTruc select 1 != 0) then {_Posfound=true;};
};
_playerDistance = _posDeMeilleurTruc distance player;
_playerDistance = _posDeMeilleurTruc distance hq_blu1;



Expand Down
4 changes: 3 additions & 1 deletion source/mapsize.sqf
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
_unit = _this select 0;
_debug = _this select 1;

sleep 3;

private ["_grid_size"];
disableserialization;

openMap [true, false];
WaitUntil {visibleMap};
WaitUntil {(visibleMap)};

x_mapsize = 0;
y_mapsize = 0;
Expand Down
6 changes: 2 additions & 4 deletions source/missions/missions/destroy/mission.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ _tower setdamage 0.85;
_tower setVectorUp [0,0,1];

// TASK AND NOTIFICATION
_taskhandle = player createSimpleTask ["taskDestroy"];
_taskhandle setSimpleTaskDescription ["We have detected a large amount of enemy trasmissions coming from this area. This is probably caused by a radio tower used by the enemy forces on the island. Destroy the tower. Be sure to take some satchels, which you can find in the armory. Armory can be unlocked at the HQ.",_mission_name,""];
_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername));
[west, "_taskhandle", ["taskDestroy.", "We have detected a large amount of enemy trasmissions coming from this area. This is probably caused by a radio tower used by the enemy forces on the island. Destroy the tower. Be sure to take some satchels, which you can find in the armory. Armory can be unlocked at the HQ.", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate;

if (!ismultiplayer) then {
execVM "utilities\autoSave.sqf";
Expand All @@ -52,7 +50,7 @@ waitUntil {sleep 1; !alive _tower};
deleteMarker str(_markername2);
deleteMarker str(_markername);

player removeSimpleTask _taskhandle;
[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;

// Give cookies (bonus & notifications)
reward = (30 * cp_reward_multiplier);
Expand Down
10 changes: 4 additions & 6 deletions source/missions/missions/pilot/mission.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ _pilot setcaptive true;
_pilot switchMove "acts_CrouchingIdleRifle01";

// TASK AND NOTIFICATION
_taskhandle = player createSimpleTask ["taskPilot"];
_taskhandle setSimpleTaskDescription ["One of our AH-99 helicopters has been downed somewhere around this area. We have reports that the pilot is still alive. You must find him and bring him back to base.",_mission_name,""];
_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername));
[west, "_taskhandle", ["taskDestroy.", "One of our AH-99 helicopters has been downed somewhere around this area. We have reports that the pilot is still alive. You must find him and bring him back to base.", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate;

if (!ismultiplayer) then {
execVM "utilities\autoSave.sqf";
Expand All @@ -59,7 +57,7 @@ if (!(alive _pilot)) exitWith {
deleteMarker str(_markername2);
deleteMarker str(_markername);

player removeSimpleTask _taskhandle;
[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;
["TaskFailed",["","The pilot is dead"]] call bis_fnc_showNotification;
};

Expand All @@ -76,15 +74,15 @@ if (!(alive _pilot)) exitWith {
deleteMarker str(_markername2);
deleteMarker str(_markername);

player removeSimpleTask _taskhandle;
[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;
["TaskFailed",["","The pilot is dead"]] call bis_fnc_showNotification;
};

// remove markers
deleteMarker str(_markername2);
deleteMarker str(_markername);

player removeSimpleTask _taskhandle;
[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;

sleep 1;

Expand Down
4 changes: 1 addition & 3 deletions source/missions/missions/rescue/mission.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ _group = createGroup west;
// TASK AND NOTIFICATION
_VARtaskgeneratedName = format ["rescue%1%2",round(_MissionPos select 0),round(_Missionpos select 1)]; // generate variable name for task

_taskhandle = player createSimpleTask ["taskRescue"];
_taskhandle setSimpleTaskDescription ["One of our patrols has been ambushed and requires immediate assistance",_mission_name,""];
_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername));
[west, "_taskhandle", ["taskDestroy.", "RECOVER THE TPH<br/>Transport Helicopter<br/><br/>", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate;

if (!ismultiplayer) then {
execVM "utilities\autoSave.sqf";
Expand Down
2 changes: 1 addition & 1 deletion source/missions/missions/rescue/success.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ private "_task";
_taskgeneratedName = format ["rescue%1%2",round(_MissionPos select 0),round(_Missionpos select 1)]; // generate taskname/variable name
call compile format["_task = %1",_taskgeneratedname]; // recall variable and inject it into handle

player removeSimpleTask _task;
[["_task", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;

// IF SOLDIERS DEAD
if (!(alive _sol1) && !(alive _sol2) && !(alive _sol3)) exitWith {
Expand Down
4 changes: 1 addition & 3 deletions source/missions/missions/sabotage/mission.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ _tower addaction ["Sabotage", "missions\missions\sabotage\success.sqf",[_mission
// TASK AND NOTIFICATION
_VARtaskgeneratedName = format["tsksabot%1%2",round(_MissionPos select 0),round(_Missionpos select 1)]; // generate variable name for task

_taskhandle = player createSimpleTask ["taskSabot"];
_taskhandle setSimpleTaskDescription ["The enemy is using a power supply somewhere in this area. We need you to find it and sabotage it. It will allow us to have a bit of better intel on our enemies.",_mission_name,""];
_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername));
[west, "_taskhandle", ["taskDestroy.", "The enemy is using a power supply somewhere in this area. We need you to find it, walk up to it and 'sabotage' it USING YOUR ACTION MENU (DO NOT DESTROY IT WITH WEAPONS!). It will allow us to have a bit of better intel on our enemies.", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate;

if (!ismultiplayer) then {
execVM "utilities\autoSave.sqf";
Expand Down
2 changes: 1 addition & 1 deletion source/missions/missions/sabotage/success.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ call compile format["_taskhandle = %1",_VARtaskgeneratedName]; // recall variabl

_object removeAction _action;

player removeSimpleTask _taskhandle;
[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP;

deleteMarker str(_markername2);
deleteMarker str(_markername);
Expand Down
Loading