forked from KRDucky/Ace3Wasteland.Altis-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sqf
91 lines (72 loc) · 2.86 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
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Version: 1.2
// @file Name: init.sqf
// @file Author: [404] Deadbeat, [GoT] JoSchaap, AgentRev
// @file Description: The main init.
#define DEBUG false
enableSaving [false, false];
// block script injection exploit
inGameUISetEventHandler ["PrevAction", ""];
inGameUISetEventHandler ["Action", ""];
inGameUISetEventHandler ["NextAction", ""];
_descExtPath = str missionConfigFile;
currMissionDir = compileFinal str (_descExtPath select [0, count _descExtPath - 15]);
X_Server = false;
X_Client = false;
X_JIP = false;
// versionName = ""; // Set in STR_WL_WelcomeToWasteland in stringtable.xml
if (isServer) then { X_Server = true };
if (!isDedicated) then { X_Client = true };
if (isNull player) then { X_JIP = true };
//if(hasInterface) then{[] execVM "addons\statusBar\statusbar.sqf"};
A3W_scriptThreads = [];
[DEBUG] call compile preprocessFileLineNumbers "globalCompile.sqf";
//init Wasteland Core
[] execVM "config.sqf";
[] execVM "storeConfig.sqf"; // Separated as its now v large
[] execVM "briefing.sqf";
if (!isDedicated) then
{
[] spawn
{
if (hasInterface) then // Normal player
{
9999 cutText ["Welcome to ACE3 A3Wasteland, please wait for your client to initialize", "BLACK", 0.01];
waitUntil {!isNull player};
player setVariable ["playerSpawning", true, true];
playerSpawning = true;
removeAllWeapons player;
client_initEH = player addEventHandler ["Respawn", { removeAllWeapons (_this select 0) }];
// Reset group & side
[player] joinSilent createGroup playerSide;
execVM "client\init.sqf";
if ((vehicleVarName player) select [0,17] == "BIS_fnc_objectVar") then { player setVehicleVarName "" }; // undo useless crap added by BIS
}
else // Headless
{
waitUntil {!isNull player};
if (getText (configFile >> "CfgVehicles" >> typeOf player >> "simulation") == "headlessclient") then
{
execVM "client\headless\init.sqf";
};
};
};
};
if (isServer) then
{
diag_log format ["############################# %1 #############################", missionName];
diag_log "WASTELAND SERVER - Initializing Server";
[] execVM "server\init.sqf";
};
if (hasInterface || isServer) then
{
//init 3rd Party Scripts
[] execVM "addons\R3F_ARTY_AND_LOG\init.sqf";
[] execVM "addons\proving_ground\init.sqf";
[] execVM "addons\JumpMF\init.sqf";
//[] execVM "addons\outlw_magRepack\MagRepack_init.sqf"; ACE3 includes Mag Repack by default thus, Outlaw's script is not needed.
//[] execVM "addons\lsd_nvg\init.sqf";
if (isNil "drn_DynamicWeather_MainThread") then { drn_DynamicWeather_MainThread = [] execVM "addons\scripts\DynamicWeatherEffects.sqf" };
};