-
Notifications
You must be signed in to change notification settings - Fork 0
/
kp_objectInits.sqf
132 lines (119 loc) · 3.99 KB
/
kp_objectInits.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
/*
Specific object init codes depending on classnames.
Format:
[
Array of classnames as strings <ARRAY>,
Code to apply <CODE>,
Allow inheritance <BOOL> (default false)
]
_this is the reference to the object with the classname
Example:
KPLIB_objectInits = [
[
["O_soldierU_F"],
{systemChat "CSAT urban soldier was spawned!"}
],
[
["CAManBase"],
{systemChat format ["Some human named '%1' was spawned!", name _this]},
true
]
];
*/
KPLIB_objectInits = [
// Set KP logo on white flag
[
["Flag_White_F"],
{_this setFlagTexture "res\flag_kp_co.paa";}
],
// Add helipads to zeus, as they can't be recycled after built
[
["Helipad_base_F", "LAND_uns_Heli_pad", "Helipad", "LAND_uns_evac_pad", "LAND_uns_Heli_H"],
{{[_x, [[_this], true]] remoteExecCall ["addCuratorEditableObjects", 2]} forEach allCurators;},
true
],
// Add ViV and build action to FOB box/truck
[
[FOB_box_typename, FOB_truck_typename],
{
[_this] spawn {
params ["_fobBox"];
waitUntil {sleep 0.1; time > 0};
[_fobBox] call KPLIB_fnc_setFobMass;
if ((typeOf _fobBox) isEqualTo FOB_box_typename) then {
[_fobBox] call KPLIB_fnc_setFobMass;
[_fobBox] remoteExecCall ["KPLIB_fnc_setLoadableViV", 0, _fobBox];
};
[_fobBox] remoteExecCall ["KPLIB_fnc_addActionsFob", 0, _fobBox];
};
}
],
// Add FOB building damage handler override and repack action
[
[FOB_typename],
{
_this addEventHandler ["HandleDamage", {0}];
[_this] spawn {
params ["_fob"];
waitUntil {sleep 0.1; time > 0};
[_fob] remoteExecCall ["KPLIB_fnc_addActionsFob", 0, _fob];
};
}
],
// Add ViV action to Arsenal crate
[
[Arsenal_typename],
{
[_this] spawn {
params ["_arsenal"];
waitUntil {sleep 0.1; time > 0};
[_arsenal] remoteExecCall ["KPLIB_fnc_setLoadableViV", 0, _arsenal];
};
}
],
// Add storage type variable to built storage areas (only for FOB built/loaded ones)
[
[KP_liberation_small_storage_building, KP_liberation_large_storage_building],
{_this setVariable ["KP_liberation_storage_type", 0, true];}
],
// Add ACE variables to corresponding building types
[
[KP_liberation_recycle_building],
{_this setVariable ["ace_isRepairFacility", 1, true];}
],
[
KP_liberation_medical_facilities,
{_this setVariable ["ace_medical_isMedicalFacility", true, true];}
],
[
KP_liberation_medical_vehicles,
{_this setVariable ["ace_medical_isMedicalVehicle", true, true];}
],
// Hide Cover on big GM trucks
[
["gm_ge_army_kat1_454_cargo", "gm_ge_army_kat1_454_cargo_win"],
{_this animateSource ["cover_unhide", 0, true];}
],
// Make sure a slingloaded object is local to the helicopter pilot (avoid desync and rope break)
[
["Helicopter"],
{if (isServer) then {[_this] call KPLIB_fnc_addRopeAttachEh;} else {[_this] remoteExecCall ["KPLIB_fnc_addRopeAttachEh", 2];};},
true
],
// Add valid vehicles to support module, if system is enabled
[
KP_liberation_suppMod_artyVeh,
{if (KP_liberation_suppMod > 0) then {KPLIB_suppMod_arty synchronizeObjectsAdd [_this];};}
],
// Disable autocombat (if set in parameters) and fleeing
[
["Man"],
{
if (!(GRLIB_autodanger) && {(side _this) isEqualTo GRLIB_side_friendly}) then {
_this disableAI "AUTOCOMBAT";
};
_this allowFleeing 0;
},
true
]
];