Skip to content

Commit 79f460e

Browse files
committed
Added documentation and cleaned up format and comments for fob.sqf
1 parent 4eb576e commit 79f460e

File tree

1 file changed

+36
-26
lines changed

1 file changed

+36
-26
lines changed

source/support/fob.sqf

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
1+
/*
2+
File: fob.sqf
3+
4+
Author: Kibot
5+
6+
Description:
7+
Searches for a position and setups up Forward Operating Base
8+
9+
Parameter(s):
10+
_this select 0 - OBJECT - A non-nil object with a physical location.
11+
12+
Usage:
13+
_scriptHandle = [player] execVM 'fob.sqf';
14+
15+
Returns:
16+
- Nil -
17+
*/
18+
119
_position = _this select 0;
220
_size = _this select 1;
321

422
if (commandpointsblu1 < 10) exitWith {
5-
["info",["Not enough command points","Not enough Command Points (10CP required)"]] call bis_fnc_showNotification;
6-
sleep 15;
7-
_art = [player1,"fob_support"] call BIS_fnc_addCommMenuItem;
23+
["info",["Not enough command points","Not enough Command Points (10CP required)"]] call bis_fnc_showNotification;
24+
sleep 15;
25+
_art = [player,"fob_support"] call BIS_fnc_addCommMenuItem;
826
};
927

10-
// REGARDE SI LA ZONE EST OK
11-
Hint "Requesting a FOB...";
1228
player sidechat "Requesting a FOB on my position...";
1329

1430
_trg=createTrigger["EmptyDetector",_position];
@@ -21,17 +37,20 @@ _amountOPFOR = count list _trg;
2137
deleteVehicle _trg;
2238

2339
if (_amountOPFOR > 0) exitWith {
24-
Hint "This position is not clear from enemies";
25-
PAPABEAR sidechat "Request denied. Enemies are too close to this position.";
26-
sleep 15;
27-
_art = [player1,"fob_support"] call BIS_fnc_addCommMenuItem;
40+
Hint "This position is not clear from enemies";
41+
PAPABEAR sidechat "Request denied. Enemies are too close to this position.";
42+
sleep 15;
43+
_art = [player1,"fob_support"] call BIS_fnc_addCommMenuItem;
2844
};
2945

30-
// try to find a pos, if no pos is found exit the script
46+
// Attempt to find a safe position
3147
_foundPickupPos = [_position, 0,50,10,0,0.2,0,[],[[0,0],[0,0]]] call BIS_fnc_findSafePos; // find a valid pos
32-
if (0 == _foundPickupPos select 0 && 0 == _foundPickupPos select 1) exitWith {hint "No valid FOB pos nearby\nTry to go near a flat, object free zone."; sleep 5; _art = [player1,"fob_support"] call BIS_fnc_addCommMenuItem;};
48+
if (0 == _foundPickupPos select 0 && 0 == _foundPickupPos select 1) exitWith {
49+
hint "No valid FOB pos nearby\nTry to go near a flat, object free zone.";
50+
sleep 5;
51+
_art = [player1,"fob_support"] call BIS_fnc_addCommMenuItem;
52+
};
3353

34-
// LA ZONE EST OK
3554

3655
commandpointsblu1 = commandpointsblu1 - 10;
3756
publicVariable "commandpointsblu1";
@@ -49,18 +68,17 @@ str(_markername) setMarkerText format["FOB %1",_fobname];
4968
str(_markername) setMarkerSize [2.5, 2.5];
5069

5170

52-
5371
sleep 5;
5472

5573

5674
_fob = "Land_Cargo_HQ_V1_F" createVehicle _foundPickupPos;
5775

5876
DUWS_fnc_fob = {
59-
_this addaction ["<t color='#ff00ff'>Player stats</t>","dialog\info\info.sqf", "", 0, true, true, "", "_this == player"];
60-
_this addaction ["<t color='#15ff00'>Request ammobox drop(2CP)</t>","support\fob_ammobox.sqf", "", 0, true, true, "", "_this == player"];
61-
_this addaction ["<t color='#ffb700'>Squad manager</t>","dialog\squad\squadmng.sqf", "", 0, true, true, "", "_this == player"];
62-
_this addaction ["<t color='#ffb700'>FOB manager</t>","dialog\fob\FOBmanageropen.sqf", "", 0, true, true, "", "_this == player"];
63-
if (support_armory_available) then {
77+
_this addaction ["<t color='#ff00ff'>Player stats</t>","dialog\info\info.sqf", "", 0, true, true, "", "_this == player"];
78+
_this addaction ["<t color='#15ff00'>Request ammobox drop(2CP)</t>","support\fob_ammobox.sqf", "", 0, true, true, "", "_this == player"];
79+
_this addaction ["<t color='#ffb700'>Squad manager</t>","dialog\squad\squadmng.sqf", "", 0, true, true, "", "_this == player"];
80+
_this addaction ["<t color='#ffb700'>FOB manager</t>","dialog\fob\FOBmanageropen.sqf", "", 0, true, true, "", "_this == player"];
81+
if (support_armory_available) then {
6482
_this addaction ["<t color='#ff0066'>Armory (VA)</t>","bisArsenal.sqf", "", 0, true, true, "", "_this == player"];
6583
};
6684
if (isServer) then {
@@ -105,15 +123,7 @@ publicVariable "Array_of_FOBS";
105123
Array_of_FOBname = Array_of_FOBname + [_fobname];
106124
publicVariable "Array_of_FOBname";
107125

108-
109-
110-
sleep 1;
111-
112126
saveGame;
113127

114-
sleep 1;
115-
116128
sleep 600;
117129
_art = [player1,"fob_support"] call BIS_fnc_addCommMenuItem;
118-
119-
// Land_Cargo_HQ_V1_F

0 commit comments

Comments
 (0)