-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathBluHQinit.sqf
More file actions
100 lines (83 loc) · 3.24 KB
/
BluHQinit.sqf
File metadata and controls
100 lines (83 loc) · 3.24 KB
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
_hqblu = _this select 0;
blu_hq_created = true;
PosOfBLUHQ = _hqblu;
publicVariable "PosOfBLUHQ";
// create the building
_hq = "Land_Cargo_HQ_V1_F" createVehicle _hqblu;
// create marker on HQ
_markername = format["%1%2",round (_hqblu select 0),round (_hqblu select 1)]; // Define marker name
blu_hq_markername = _markername;
//hint _markername;
_markerstr = createMarker [str(_markername), _hqblu];
_markerstr setMarkerShape "ICON";
str(_markername) setMarkerType "mil_flag";
str(_markername) setMarkerColor "ColorBlue";
str(_markername) setMarkerText "Main base";
// make HQ zone notification trigger
_trg5=createTrigger["EmptyDetector",_hqblu];
_trg5 triggerAttachVehicle [player];
_trg5 setTriggerArea[100,100,0,false];
_trg5 setTriggerActivation["VEHICLE","PRESENT",true];
_trg5 setTriggerStatements["this", format["[""%1"",thislist] execvm 'enterlocation.sqf'",'Main Base'], ""];
// warning trigger when an enemy approaches the camp
_trgWarning=createTrigger["EmptyDetector",_hqblu];
_trgWarning setTriggerArea[300,300,0,false];
_trgWarning setTriggerActivation["EAST","PRESENT",true];
_trgWarning setTriggerStatements["this","PAPABEAR sidechat 'This is HQ, there are enemies near our main base!'", ""];
// CREATE THE OFFICER
_group = createGroup west;
_hq = _group createUnit ["b_officer_f",(getmarkerpos str(blu_hq_markername)), [], 0, "FORM"];
hq_blu1 = _hq;
publicVariable "hq_blu1";
_hq setpos [_hqblu select 0, _hqblu select 1, 0.59];
_hq disableAI "AUTOTARGET";
_hq setdir 0;
_handle = [hq_blu1] execVM "initHQ\HQaddactions.sqf";
removeallweapons _hq;
_hq switchMove "acts_StandingSpeakingUnarmed";
_handle = [_hq] execVM "sounds\radiochatter.sqf";
//_drawicon = [] execVM "inithq\drawIcon.sqf"; // create the icon
//GUARDS
_handle = [(getpos hq_blu1), _hq] execVM "initHQ\guards.sqf";
//STATIC DEFENSES
_handle = [(getpos hq_blu1), _hq] execVM "initHQ\fortify.sqf";
// IF THE OFFICER IS DEAD -- BEGIN OF "SPAWN"
[_hq] spawn {
_hq = _this select 0;
waitUntil {sleep 1;!alive _hq};
_hq switchMove "AidlPercMstpSnonWnonDnon01";
["TaskFailed",["","Your commanding officer has been killed"]] call bis_fnc_showNotification;
sleep 6;
["officerkilled",false,true] call BIS_fnc_endMission;
};
// IF THE OFFICER IS DEAD -- End OF "SPAWN"
// TELEPORT PLAYER
player setpos _hqblu;
//////// HQ GENERATED /////
"respawn_west" setMarkerPos _hqblu;
sleep 0.1;
// BROADCAST, TELL THE HQ POS IS FOUND
HQ_pos_found_generated = true;
publicVariable "HQ_pos_found_generated";
// SHOW THE STARTUP MENU
if (!zones_created) then {
sleep 0.1;
_nill = [] execVM "dialog\startup\startup.sqf";
waitUntil {chosen_settings}; // WAIT UNTIL THE PLAYER HAS CHOSEN THE SETTINGS
};
// WEATHER INIT
if (dynamic_weather_enable) then {
_weather_script = [] execVM "dialog\startup\weather.sqf";
};
// CHECK IF ZONES ARE PLACED...
// If not execute locatorZonesV1.sqf if the user wants them randomly placed. V2 if the user wants to place zones.
if (!zones_created && !manually_chosen) then {
_zones_create = [50, 0.2] execVM "initZones\locatorZonesV1.sqf";
} else {
_zones_create = [50, 0.2] execVM "initZones\locatorZonesV2.sqf";
};
player allowDamage true;
if (debugmode) exitWith {};
if (isServer) then {
_sitrep = [player,"sitrep"] call BIS_fnc_addCommMenuItem;
};