This repository has been archived by the owner on Jul 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.sqf
259 lines (198 loc) · 8.46 KB
/
init.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
_isDebug = "debugMode" call BIS_fnc_getParamValue;
if (_isDebug == 0) then {
DEBUG = false;
} else {
DEBUG = true;
};
//
// customizable variables
//
if (hasInterface) then {
cutText ["", "BLACK FADED",1000];
};
setViewDistance 3500;
enableSentences false;
enableRadio false;
// 0 fadeRadio 0;
showChat false;
// functional variables - do not change!
// player_respawned = 0;
waitUntil {!isNil "DEBUG"};
diag_log format ["DEBUG IS %1"];
if (DEBUG) then {
checkObjectives = false; // false is debug for playing without pilot
} else {
checkObjectives = true;
};
jipTime = 60000;
{_x setMarkerAlphaLocal 0;} forEach allMapMarkers;
0 = [] execVM "grad_buymenu\buymenu_init.sqf";
call compile preprocessfile "Engima\Traffic\Custom_GruppeAdler\createVehicle.sqf";
call compile preprocessfile "civilianOutrage\randomCivilian.sqf";
[] execVM "Engima\Traffic\Init.sqf";
If(isNil "spawn_help_fnc_compiled")then{call compile preprocessFileLineNumbers "helpers\findPos.sqf"};
call compile preprocessfile "SHK_pos\shk_pos_init.sqf";
call compile preprocessfile "helpers\spf_createRelPos.sqf";
call compile preprocessFileLineNumbers "loadouts\getUnitLoadout\blufor.sqf";
call compile preprocessFileLineNumbers "loadouts\getUnitLoadout\opfor.sqf";
call compile preprocessFileLineNumbers "loadouts\getUnitLoadout\independent.sqf";
[]execVM "helpers\findSpawnPos.sqf";
[]execVM "helpers\addActionMP.sqf";
[] spawn {
#define MAKEFIRE_TREERADIUS 40 //distance player-->trees in order to be able to start fire (this is not exact)
#define MAKEFIRE_CANBUILD (player getVariable ["GRAD_isCrashPilot",false]) //condition to be able to build fires
#define MAKEFIRE_BUILDTIME 10 //time it takes to make the fire
#define MAKEFIRE_UPGRADETIME 10 //time it takes to upgrade fire
#define MAKEFIRE_ADDLVSTIME 10 //time it takes to add leaves to the fire
#define MAKEFIRE_PLAYERDIST 2 //distance to player that the fire object will be spawned
#define MAKEFIRE_CLASS_SMALL "FirePlace_burning_F" //small fire classname
#define MAKEFIRE_CLASS_BIG "Campfire_burning_F" //big fire classname
#define MAKEFIRE_ACTOFFSET [0,0,0.2] //interaction point offset from model center
#define MAKEFIRE_ACTDIST 2.5 //distance from which interaction point can be accessed
#define MAKEFIRE_BURNTIMESMALL 60 //time that a small fire will burn
#define MAKEFIRE_BURNTIMEBIG 90 //time that a big fire will burn
#define MAKEFIRE_BURNTIMELVS 20 //time that adding leaves will add to total burntime
C9J_fnc_createSmokeColumn = compile preprocessFileLineNumbers "helpers\fn_createSmokeColumn.sqf";
#include "node_modules\GRAD_makeFire\initMakeFire.sqf";
};
[] spawn {
#define LEAVENOTES_CANWRITENOTES (player getVariable ["GRAD_isCrashPilot",false]) //condition to be able to write notes
#define LEAVENOTES_UNLIMITED true //can write unlimited amount of notes
#define LEAVENOTES_AMOUNT 2 //amount of notes per player (irrelevant if LEAVENOTES_UNLIMITED)
#define LEAVENOTES_PLAYERDIST 1 //distance to player that notes will be dropped
#define LEAVENOTES_CLASS "Land_Notepad_F" //note object class name
#define LEAVENOTES_ACTOFFSET [0,0,0.1] //interaction point offset to notepad object
#define LEAVENOTES_ACTDIST 2 //interaction distance
#define LEAVENOTES_SLEEPTIME 0.1 //sleeptime between interaction and creation of dialog (ACE-interact-menu would stay open sometimes)
#include "node_modules\GRAD_leaveNotes\initLeaveNotes.sqf";
};
if (isServer) then {
possibleCrashPositions = [
"mrk_crash_site_01",
"mrk_crash_site_02",
"mrk_crash_site_03",
"mrk_crash_site_04",
"mrk_crash_site_05",
"mrk_crash_site_06",
"mrk_crash_site_07"
];
PILOTS_DEAD = false;
publicVariable "PILOTS_DEAD";
PILOTS_RESCUED = false;
publicVariable "PILOTS_RESCUED";
LAST_PILOTS_POSITION = ["irgendwo",[0,0],0]; // name of nearest location, position of pilot, distance to location (becomes radius of marker)
publicVariable "LAST_PILOTS_POSITION";
CURRENT_PILOTS_POSITION = ["irgendwo",[0,0],0]; // name of nearest location, position of pilot, distance to location (becomes radius of marker)
publicVariable "CURRENT_PILOTS_POSITION";
CRASH_SITE_SELECTED = false;
publicVariable "CRASH_SITE_SELECTED";
CRASH_SITE = [0,0];
publicVariable "CRASH_SITE";
REBEL_SPAWN = [0,0];
publicVariable "REBEL_SPAWN";
US_SPAWN = [0,0];
publicVariable "US_SPAWN";
BLUFOR_WINS = false;
publicVariable "BLUFOR_WINS";
OPFOR_WINS = false;
publicVariable "OPFOR_WINS";
SETUP_DONE = false;
publicVariable "SETUP_DONE";
SIGHTING_DELAY = 60;
CHANCE_TO_REVEAL_BLUFOR = 0.2; // value from 0 - 1 giving the general chance of civilians to reveal something when questioned
publicVariable "CHANCE_TO_REVEAL_BLUFOR";
CHANCE_TO_REVEAL_OPFOR = 0.2; // value from 0 - 1 giving the general chance of civilians to reveal something when questioned
publicVariable "CHANCE_TO_REVEAL_OPFOR";
0 = [] execVM "server\serverTeleportListener.sqf";
0 = [] execVM "server\selectSpawnPosition.sqf";
[] spawn {
waitUntil {(REBEL_SPAWN select 0 != 0) && (US_SPAWN select 0 != 0)}; // wait until everything is neatly set up
SETUP_DONE = true;
publicVariable "SETUP_DONE";
};
// loadout for AI units
/*
if (!isMultiplayer) then {
[] spawn {
sleep 10; // dont equip player multiple times
{if (!isPlayer _x) then {0 = [_x] execVM "loadouts\_client.sqf"};} forEach allUnits;
};
} else {
{if (!isPlayer _x) then {sleep 0.5; 0 = [_x] execVM "loadouts\_client.sqf"};} forEach allUnits;
};*/
if (isMultiplayer) then {
{
_loadout = _x getVariable ["GRAD_loadout","none"];
if (_loadout != "none") then {
_stringLoadout = "GRAD_getUnitLoadout_" + _loadout;
_x setUnitLoadout [(missionNamespace getVariable [_stringLoadout, []]),true];
};
_x addMPEventHandler ["MPKilled", {
//Only on the server
if (isServer) then {
diag_log format ["%1 killed by %2, ace says %3",
name (_this select 0),
name (_this select 1),
(_this select 0) getVariable ["ACE_medical_lastDamageSource",(_this select 0)]
];
};
}];
} forEach playableUnits;
} else {
{
_loadout = _x getVariable ["GRAD_loadout","none"];
if (_loadout != "none") then {
_stringLoadout = "GRAD_getUnitLoadout_" + _loadout;
_x setUnitLoadout [(missionNamespace getVariable [_stringLoadout, []]),true];
};
} forEach switchableUnits;
};
CRASH_PILOTS = [];
{
if (_x getVariable ["GRAD_isCrashPilot",false]) then {
// add unit to crash pilots
CRASH_PILOTS = CRASH_PILOTS + [_x];
publicVariable "CRASH_PILOTS";
};
}
forEach allUnits;
};
if (hasInterface) then {
0 = [] execVM "player\createWeaponOnCivilianPointer.sqf";
// JIP handling
checkJIP = {
if ((CRASH_SITE select 0 != 0) && didJIP && time > jipTime) then {
player setDamage 1;
} else {
[] call callIntro;
_loadout = player getVariable ["GRAD_loadout","none"];
if (_loadout != "none") then {
_stringLoadout = "GRAD_getUnitLoadout_" + _loadout;
diag_log format ["calling loadout %1",_stringLoadout];
player setUnitLoadout [(missionNamespace getVariable [_stringLoadout, []]),true];
};
};
};
callIntro = {
waitUntil {CRASH_SITE select 0 != 0};
0 = [CRASH_SITE,"",1000] execVM "helpers\establishingShot.sqf";
};
sleep 5;
// WEST is US
if (playerSide == west) then {
[] execVM "player\USTeleportListener.sqf";
[] spawn checkJIP;
// [] execVM "player\createPilotVehicleTracker.sqf";
};
// EAST is rebels
if (playerSide == east) then {
[] execVM "player\rebelsTeleportListener.sqf";
[] spawn checkJIP;
[] execVM "player\createPilotVehicleTracker.sqf";
};
if (playerSide == independent) then {
[] execVM "player\pilotTeleportListener.sqf";
[] execVM "player\addSignalPistolEH.sqf";
[] spawn checkJIP;
};
};