mirror of
https://github.com/Defent/DMS_Exile.git
synced 2024-08-30 16:52:12 +00:00
Progress
Created FindSafePos Initialize DMS_MissionCount Config will be loaded in preInit now Renamed skills and random skill array Removed mission_init (we will be using FSM instead)
This commit is contained in:
parent
74189269ee
commit
13eef51a31
@ -83,14 +83,19 @@ DMS_DEBUG = false;
|
||||
|
||||
// https://community.bistudio.com/wiki/AI_Sub-skills#general
|
||||
DMS_ai_static_skills = true; // Use "DMS_ai_skill_static" for AI on static guns
|
||||
DMS_ai_skill_extreme = [["aimingAccuracy",1.00],["aimingShake",1.00],["aimingSpeed",1.00],["spotDistance",1.00],["spotTime",1.00],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]]; // Extreme
|
||||
DMS_ai_skill_hard = [["aimingAccuracy",0.70],["aimingShake",0.70],["aimingSpeed",0.70],["spotDistance",0.70],["spotTime",0.80],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.70]]; // Hard
|
||||
DMS_ai_skill_medium = [["aimingAccuracy",0.60],["aimingShake",0.60],["aimingSpeed",0.60],["spotDistance",0.60],["spotTime",0.60],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.60]]; // Medium
|
||||
DMS_ai_skill_static = [["aimingAccuracy",0.20],["aimingShake",0.70],["aimingSpeed",0.75],["spotDistance",0.70],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]]; // Static AI Skills
|
||||
DMS_ai_skill_easy = [["aimingAccuracy",0.30],["aimingShake",0.50],["aimingSpeed",0.50],["spotDistance",0.50],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.50]]; // Easy
|
||||
DMS_ai_skill_static = [["aimingAccuracy",0.20],["aimingShake",0.70],["aimingSpeed",0.75],["spotDistance",0.70],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]];
|
||||
DMS_ai_skill_random = [ai_skill_extreme,ai_skill_hard,ai_skill_hard,ai_skill_hard,ai_skill_hard,ai_skill_medium,ai_skill_medium,ai_skill_medium,ai_skill_medium,ai_skill_easy];
|
||||
DMS_static_weapons = ["O_HMG_01_F","O_HMG_01_high_F"]; // Static weapons for AI
|
||||
DMS_ai_skill_moderate = [["aimingAccuracy",0.60],["aimingShake",0.60],["aimingSpeed",0.60],["spotDistance",0.60],["spotTime",0.60],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.60]]; // Moderate
|
||||
DMS_ai_skill_difficult = [["aimingAccuracy",0.70],["aimingShake",0.70],["aimingSpeed",0.70],["spotDistance",0.70],["spotTime",0.80],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",0.70]]; // Difficult
|
||||
DMS_ai_skill_hardcore = [["aimingAccuracy",1.00],["aimingShake",1.00],["aimingSpeed",1.00],["spotDistance",1.00],["spotTime",1.00],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]]; // Hardcore
|
||||
DMS_ai_skill_random = ["hardcore","difficult","difficult","difficult","moderate","moderate","moderate","moderate","easy","easy"]; // Skill frequencies for "random" AI skills | Default: 10% hardcore, 30% difficult, 40% moderate, and 20% easy
|
||||
|
||||
DMS_static_weapons = [ // Static weapons for AI
|
||||
"O_HMG_01_F",
|
||||
"O_HMG_01_high_F"
|
||||
];
|
||||
|
||||
//Assault Class
|
||||
DMS_assault_weps = [ // Assault Rifles
|
||||
"arifle_Katiba_GL_F",
|
||||
"arifle_MX_GL_Black_F",
|
||||
@ -164,6 +169,7 @@ DMS_DEBUG = false;
|
||||
"B_Bergen_blk"
|
||||
];
|
||||
|
||||
//Machine Gun Class
|
||||
DMS_MG_weps = [ // Machine Guns
|
||||
"LMG_Zafir_F",
|
||||
"LMG_Mk200_F",
|
||||
@ -235,6 +241,7 @@ DMS_DEBUG = false;
|
||||
"B_Bergen_blk"
|
||||
];
|
||||
|
||||
//Sniper Class
|
||||
DMS_sniper_weps = [ // Sniper Rifles
|
||||
"srifle_EBR_F",
|
||||
"srifle_DMR_01_F",
|
||||
|
@ -8,9 +8,6 @@
|
||||
[_delay, _function, _params, _persistance] call ExileServer_system_thread_addTask;
|
||||
*/
|
||||
|
||||
//Load config
|
||||
#include "config.sqf";
|
||||
|
||||
RESISTANCE setFriend[WEST,0];
|
||||
WEST setFriend[RESISTANCE,0];
|
||||
RESISTANCE setFriend[EAST,0];
|
||||
@ -23,6 +20,7 @@ if(DMS_StaticMission) then {
|
||||
};
|
||||
|
||||
if (DMS_DynamicMission) then {
|
||||
call compileFinal preprocessFileLineNumbers "\x\addons\dms\missions\mission_init.sqf";//<---- TODO
|
||||
// Use FSM to spawn missions instead
|
||||
//call compileFinal preprocessFileLineNumbers "\x\addons\dms\missions\mission_init.sqf";
|
||||
[1, DMS_MissionStatusCheck, [], true] call ExileServer_system_thread_addTask;
|
||||
};
|
||||
|
@ -3,8 +3,9 @@
|
||||
Written by eraser1 (trainwreckdayz.com)
|
||||
*/
|
||||
|
||||
// Initialize "DMS_Mission_Arr"
|
||||
// Initialize Variables
|
||||
DMS_Mission_Arr = [];
|
||||
DMS_MissionCount = 0;
|
||||
|
||||
/* compiles
|
||||
DMS_CreateMarker = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\DMS_CreateMarker.sqf";
|
||||
@ -27,11 +28,14 @@ load_ammo = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\loa
|
||||
//Completed
|
||||
DMS_MissionStatusCheck = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\MissionStatusCheck.sqf";
|
||||
DMS_MissionSuccessState = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\MissionSuccessState.sqf";//<--- TODO
|
||||
DMS_findSafePos = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\FindSafePos.sqf";//<--- TODO
|
||||
DMS_findSafePos = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\FindSafePos.sqf";
|
||||
DMS_BroadcastMissionStatus = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\BroadcastMissionStatus.sqf";
|
||||
DMS_CleanUp = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\CleanUp.sqf";
|
||||
DMS_isPlayerNearbyARRAY = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\IsPlayerNearbyARRAY.sqf";
|
||||
DMS_FillCrate = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\FillCrate.sqf";
|
||||
DMS_isNearWater = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\IsNearWater.sqf";
|
||||
DMS_RemoveMarkers = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\RemoveMarkers.sqf";
|
||||
DMS_selectMagazine = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\SelectMagazine.sqf";
|
||||
DMS_selectMagazine = compileFinal preprocessFileLineNumbers "\x\addons\dms\scripts\SelectMagazine.sqf";
|
||||
|
||||
//Load config
|
||||
#include "config.sqf";
|
@ -1 +0,0 @@
|
||||
/*TODO*/
|
@ -1,27 +0,0 @@
|
||||
private ["_pos","_centerPos","_fetchPos"];
|
||||
|
||||
//_centerPos = [getMarkerPos "center",4000,20000,10,0,25,0];
|
||||
_centerPos = [getMarkerPos "center",2000,4000,10,0,25,0];
|
||||
|
||||
_fetchPos = false;
|
||||
|
||||
_int = 1;
|
||||
|
||||
while {!_fetchPos} do {
|
||||
|
||||
sleep 2;
|
||||
|
||||
_pos = _centerPos call BIS_fnc_findSafePos;
|
||||
_int = _int + 1;
|
||||
_fetchPos = true;
|
||||
|
||||
if (_fetchPos) then {
|
||||
diag_log format ["DMS :: Found valid position at: (%1) in (%2) tries!",_pos,_int];
|
||||
};
|
||||
|
||||
// more if exceptions to come
|
||||
|
||||
// water if exception to be added above
|
||||
|
||||
};
|
||||
_pos
|
@ -1,47 +1,64 @@
|
||||
private ["_i","_safePosParams","_validspot","_position"];
|
||||
private ["_nearestObjectMinDistance","_maxTerrainGradient","_safePosParams","_validspot","_i","_pos","_markerName"];
|
||||
|
||||
params [["_nearestObjectMinDistance",25,[0]],["_maxTerrainGradient",10,[0]]];
|
||||
|
||||
if (worldName=="Altis") then {
|
||||
_safePosParams = [[16000,16000],0,16000,(_this select 0),0,0.5,0,DMS_findSafePosBlacklist];
|
||||
_safePosParams = [[16000,16000],0,16000,_nearestObjectMinDistance,0,_maxTerrainGradient,0,DMS_findSafePosBlacklist];
|
||||
} else {
|
||||
_safePosParams = [[],0,-1,(_this select 0),0,0.5,0,DMS_findSafePosBlacklist];
|
||||
_safePosParams = [[],0,-1,_nearestObjectMinDistance,0,_maxTerrainGradient,0,DMS_findSafePosBlacklist];
|
||||
};
|
||||
|
||||
_validspot = false;
|
||||
_i = 0;
|
||||
while{!_validspot} do {
|
||||
_position = _safePosParams call BIS_fnc_findSafePos;
|
||||
_validspot = true;
|
||||
_pos = _safePosParams call BIS_fnc_findSafePos;
|
||||
_i = _i+1;
|
||||
call {
|
||||
if ([_position,wai_near_water] call DMS_isNearWater) exitWith
|
||||
try {
|
||||
// Check for nearby water
|
||||
if ([_pos,DMS_WaterNearBlacklist] call DMS_isNearWater) exitWith
|
||||
{
|
||||
_validspot = false;
|
||||
if (DMS_DEBUG) then {diag_log "Position is too close to water!";};
|
||||
throw ("water");
|
||||
};
|
||||
|
||||
if ([_position,DMS_PlayerNearBlacklist] call ExileServer_util_position_isPlayerNearby) exitWith
|
||||
// Check for nearby players
|
||||
if ([_pos,DMS_PlayerNearBlacklist] call ExileServer_util_position_isPlayerNearby) exitWith
|
||||
{
|
||||
_validspot = false;
|
||||
if (DMS_DEBUG) then {diag_log "Position has players nearby!";};
|
||||
throw ("players");
|
||||
};
|
||||
|
||||
/*
|
||||
markertype _x=="ExileSpawnZone" || "ExileTraderZone"
|
||||
|
||||
if(DMS_DEBUG) then { diag_log("WAI DEBUG: FINDPOS: Checking nearby mission markers: " + str(wai_mission_markers)); };
|
||||
|
||||
{
|
||||
if ({getMarkerColor _x != "" && {_position distance (getMarkerPos _x) < wai_avoid_missions}}) exitWith
|
||||
// Check for nearby spawn points
|
||||
if (((markertype _x) isEqualTo "ExileSpawnZone") && {((getMarkerPos _x) distance2D _pos)<=DMS_SpawnZoneNearBlacklist}) exitWith
|
||||
{
|
||||
_validspot = false;
|
||||
if (DMS_DEBUG) then {diag_log "Position is too close to another mission!";};
|
||||
throw ("a spawn zone");
|
||||
};
|
||||
|
||||
// Check for nearby trader zones
|
||||
if (((markertype _x) isEqualTo "ExileTraderZone") && {((getMarkerPos _x) distance2D _pos)<=DMS_TraderZoneNearBlacklist}) exitWith
|
||||
{
|
||||
throw ("a trader zone");
|
||||
};
|
||||
|
||||
// Check for nearby missions
|
||||
if (((_x find "DMS_MissionMarkerDot")>-1) && {((getMarkerPos _x) distance2D _pos)<=DMS_MissionNearBlacklist}) exitWith
|
||||
{
|
||||
throw ("another mission");
|
||||
};
|
||||
false;
|
||||
} count allMapMarkers;
|
||||
*/
|
||||
};
|
||||
if(_validspot) then {
|
||||
if(DMS_DEBUG) then { diag_log format["Mission position %1 with %2 params found in %3 attempts.",_position,_safePosParams,_i]; };
|
||||
|
||||
// No exceptions found
|
||||
_validspot = true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (DMS_DEBUG) then {
|
||||
diag_log format ["DMS_DEBUG findSafePos :: Exception in attempt %1 | Position %2 is too close to %3!",_i,_pos,_exception];
|
||||
};
|
||||
};
|
||||
};
|
||||
_position set [2, 0];
|
||||
_position;
|
||||
if(DMS_DEBUG) then {
|
||||
diag_log format["DMS_DEBUG findSafePos :: Mission position %1 with %2 params found in %3 attempts.",_pos,_safePosParams,_i];
|
||||
};
|
||||
_pos set [2, 0];
|
||||
_pos;
|
Loading…
Reference in New Issue
Block a user