Sarge-AI/sarge/init/fn_preInit.sqf

87 lines
2.4 KiB
Plaintext
Raw Normal View History

2017-10-26 01:36:31 +00:00
/*
# Original #
Sarge AI System 1.5
Created for Arma 2: DayZ Mod
Author: Sarge
https://github.com/Swiss-Sarge
# Fork #
Sarge AI System 2.0+
Modded for Arma 3: Epoch Mod
2017-10-26 01:36:31 +00:00
Changes: Dango
https://www.hod-servers.com
Tips:
- All time formats are configured in seconds
- All distance formats are in meters
- Secondary AI skills can be decimal values i.e. 0.23
- Lower time intervals for detections require more CPU resources
*/
scopeName "Main";
// Initialize the Main Config
call compile preProcessFileLineNumbers "\addons\sarge\code\configs\main.sqf";
_SAR_supportedMods = ["dsr_code","epoch","exile"];
_modName = "";
{
_modConfigs = isClass (configFile >> "CfgMods" >> _x);
if (_modConfigs) then {
_modName = _x;
};
_modPatches = isClass (configFile >> "CfgPatches" >> _x);
if (_modPatches) then {
_modName = _x;
};
if (_modName == "dsr_code") then {_modName = "desolation"};
} forEach _SAR_supportedMods;
2017-10-26 01:36:31 +00:00
SAR_AI_friendly_side = "";
SAR_AI_unfriendly_side = "";
switch (_modName) do {
2017-12-31 18:32:01 +00:00
case "desolation": {
SAR_AI_friendly_side = INDEPENDENT;
2018-01-02 00:18:13 +00:00
SAR_AI_unfriendly_side = EAST;
2017-12-31 18:32:01 +00:00
2018-01-02 00:18:13 +00:00
EAST setFriend [CIVILIAN, 0];
};
case "exile": {
SAR_AI_friendly_side = INDEPENDENT;
AR_AI_unfriendly_side = WEST;
2018-01-20 02:43:49 +00:00
WEST setFriend [INDEPENDENT, 0];
};
case "epoch": {
2018-01-20 02:43:49 +00:00
SAR_AI_friendly_side = WEST;
SAR_AI_unfriendly_side = RESISTANCE;
2017-12-31 18:32:01 +00:00
2018-01-20 02:43:49 +00:00
RESISTANCE setFriend [WEST, 0];
};
default {
diag_log "Sarge AI System: ERROR! The mod you are loading Sarge AI for is not supported!";
breakOut "Main";
};
};
2018-01-02 00:18:13 +00:00
SAR_AI_monitor = [];
SAR_leader_number = 0;
// Initialize Vehicles arrays
call compile preProcessFileLineNumbers (format ["\addons\sarge\code\configs\vehicles\%1\%1_air.sqf",_modName]);
call compile preProcessFileLineNumbers (format ["\addons\sarge\code\configs\vehicles\%1\%1_land.sqf",_modName]);
call compile preProcessFileLineNumbers (format ["\addons\sarge\code\configs\vehicles\%1\%1_sea.sqf",_modName]);
// Initialize the AI loadout arrays
call compile preProcessFileLineNumbers (format ["\addons\sarge\code\configs\loadouts\%1\%1_bandits.sqf",_modName]);
call compile preProcessFileLineNumbers (format ["\addons\sarge\code\configs\loadouts\%1\%1_soldiers.sqf",_modName]);
call compile preProcessFileLineNumbers (format ["\addons\sarge\code\configs\loadouts\%1\%1_survivors.sqf",_modName]);
// Initialize the AI functions
call compile preProcessFileLineNumbers "\addons\sarge\code\functions\fn_functions.sqf";
2017-10-26 01:36:31 +00:00
true;