-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.sqf
67 lines (51 loc) · 2.4 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
KPLIB_init = false;
// Version of the KP Liberation framework
KP_liberation_version = [0, 96, "7a"];
enableSaving [ false, false ];
if (isDedicated) then {debug_source = "Server";} else {debug_source = name player;};
[] call KPLIB_fnc_initSectors;
if (!isServer) then {waitUntil {!isNil "KPLIB_initServer"};};
[] call compileFinal preprocessFileLineNumbers "scripts\shared\fetch_params.sqf";
[] call compileFinal preprocessFileLineNumbers "kp_liberation_config.sqf";
[] call compileFinal preprocessFileLineNumbers "presets\init_presets.sqf";
[] call compileFinal preprocessFileLineNumbers "kp_objectInits.sqf";
// Activate selected player menu. If CBA isn't loaded -> fallback to GREUH
if (KPPLM_CBA && KP_liberation_playermenu) then {
[] call KPPLM_fnc_postInit;
} else {
[] execVM "GREUH\scripts\GREUH_activate.sqf";
};
[] call compileFinal preprocessFileLineNumbers "scripts\shared\init_shared.sqf";
if (isServer) then {
[] call compileFinal preprocessFileLineNumbers "scripts\server\init_server.sqf";
};
if (!isDedicated && !hasInterface && isMultiplayer) then {
execVM "scripts\server\offloading\hc_manager.sqf";
};
if (!isDedicated && hasInterface) then {
// Get mission version and readable world name for Discord rich presence
[
["UpdateDetails", [localize "STR_MISSION_VERSION", "on", getText (configfile >> "CfgWorlds" >> worldName >> "description")] joinString " "]
] call (missionNamespace getVariable ["DiscordRichPresence_fnc_update", {}]);
// Add EH for curator to add kill manager and object init recognition for zeus spawned units/vehicles
{
_x addEventHandler ["CuratorObjectPlaced", {[_this select 1] call KPLIB_fnc_handlePlacedZeusObject;}];
} forEach allCurators;
waitUntil {alive player};
if (debug_source != name player) then {debug_source = name player};
[] call compileFinal preprocessFileLineNumbers "scripts\client\init_client.sqf";
} else {
setViewDistance 1600;
};
// Execute fnc_reviveInit again (by default it executes in postInit)
if ((isNil {player getVariable "bis_revive_ehHandleHeal"} || isDedicated) && !(bis_reviveParam_mode == 0)) then {
[] call bis_fnc_reviveInit;
};
KPLIB_init = true;
[] execVM "functions\fn_advancedTowingInit.sqf";
[] execVM "functions\fn_advancedSlingLoadingInit.sqf";
// Notify clients that server is ready
if (isServer) then {
KPLIB_initServer = true;
publicVariable "KPLIB_initServer";
};