-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sqf
89 lines (71 loc) · 2.45 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
#define OOP_DEBUG
#define OOP_INFO
#define OOP_WARNING
#define OOP_ERROR
#include "OOP_Light\OOP_Light.h"
// #define LOG_SCOPE "Main"
call compile preprocessFileLineNumbers "OOP_Light\OOP_Light_init.sqf";
call compile preprocessFileLineNumbers "WarStatistics\initVariables.sqf";
call compile preprocessFileLineNumbers "WarStatistics\initFunctions.sqf";
call compile preprocessFileLineNumbers "WarStatistics\initVariablesServer.sqf";
side_opf = "ColorEAST";
side_guer = "ColorGUER";
side_none = "ColorYellow";
type_spawn = "mil_flag";
type_outpost = "mil_circle";
type_garrison = "mil_box";
order_types = [];
paused = false;
simtime = time;
call compile preprocessFileLineNumbers "Scripts\Garrison.sqf";
call compile preprocessFileLineNumbers "Scripts\Outpost.sqf";
call compile preprocessFileLineNumbers "Scripts\Orders.sqf";
call compile preprocessFileLineNumbers "Scripts\Action.sqf";
//call compile preprocessFileLineNumbers "Scripts\AttackAction.sqf";
call compile preprocessFileLineNumbers "Scripts\TakeOutpostAction.sqf";
call compile preprocessFileLineNumbers "Scripts\ReinforceAction.sqf";
call compile preprocessFileLineNumbers "Scripts\State.sqf";
call compile preprocessFileLineNumbers "Scripts\Cmdr.sqf";
OOP_INFO_0("Initializing state...");
State = NEW("State", []);
testing = true;
if (testing) then {
private _newMarker = createMarker ["us", [0, 0, 0]];
OOP_INFO_1("_newMarker %1", _newMarker);
_newMarker setMarkerType type_outpost;
_newMarker setMarkerShape "ICON";
_newMarker setMarkerColor side_opf;
_newMarker setMarkerText "10/4";
private _newMarker2 = createMarker ["them", [2000, 0, 0]];
_newMarker2 setMarkerType type_outpost;
_newMarker2 setMarkerShape "ICON";
_newMarker2 setMarkerColor side_guer;
_newMarker2 setMarkerText "4/2";
};
CALLM1(State, "initFromMarkers", allMapMarkers);
OpforCommander = NEW("Cmdr", [side_opf]);
#define PLAN_INTERVAL 30
player addAction ["toggle pause", { paused = !paused }];
OOP_INFO_0("Spawning AI thread...");
[] spawn {
OOP_INFO_0("In AI thread...");
private _itr = 0;
while {true} do {
private _startt = time;
sleep 0.1;
if(!paused) then {
if(_itr == PLAN_INTERVAL) then {
OOP_INFO_0("Planning...");
// Commander AI plan update
CALLM1(OpforCommander, "plan", State);
_itr = 0;
};
//OOP_INFO_0("Updating state...");
CALLM0(State, "update");
// Update commander AIs
CALLM1(OpforCommander, "update", State);
_itr = _itr + 1;
simtime = simtime + (time - _startt);
};
};
};