Add mission customization, HQ support and aggression-driven AI

Integrate faction and random settings menus, generated objectives, scouts, convoys, air support, mortar stations and body-intel recovery. Add identified-body aggression, finite hunter UAZ deployment, dedicated objective defence and maximum AI skill with separate reduced aim accuracy. Include policy tests, native probes, evidence and documentation.
This commit is contained in:
2026-09-23 15:07:14 +02:00
parent 04bd19327b
commit 1b1a8b5173
242 changed files with 12153 additions and 875 deletions
+5 -1
View File
@@ -5,6 +5,7 @@ p=ROOT/'addons/core/Scripts/Game/ERR/10_AI/ERR_HQ.c'
unit='\n'.join(body(p,s) for s in ('void CancelPending(', 'ERR_HQTask PlannedTask(', 'void ReleaseAssignment(', 'void Release()'))
lost='\n'.join(body(p,s) for s in ('protected void FinishWatch(', 'protected void LostOrder(')).replace('protected ', '')
def adapt(code):
code=code.replace('.IsEmpty()', '.empty()')
code=code.replace('null','nullptr').replace('Math.','Math::').replace('ERR_GameMode.Get()', 'ERR_GameMode::Get()')
code=code.replace('SCR_EntityHelper.DeleteEntityAndChildren', 'SCR_EntityHelper::DeleteEntityAndChildren')
code=code.replace('ERR_HQUnit unit', 'ERR_HQUnit* unit')
@@ -21,7 +22,7 @@ run(r'''
#include <algorithm>
#include <string>
struct Math {static float Min(float a,float b){return std::min(a,b);}};
struct ERR_HQTask {bool ReleaseOnly=false;int BeliefId=0;std::string WatchSourceId;int WatchMessageId=0,WatchRequestId=0;bool Investigation(){return !WatchSourceId.empty();}};
struct ERR_HQTask {bool ReleaseOnly=false;int BeliefId=0;std::string WatchSourceId,SecuritySite;int WatchMessageId=0,WatchRequestId=0;bool Investigation(){return !WatchSourceId.empty();}};
struct ERR_HQReport {};
struct ERR_HQRoute {};
struct AIWaypoint {int deleted=0;};
@@ -98,6 +99,9 @@ int main(){
ERR_HQTask recall;recall.ReleaseOnly=true;u.PendingTask=&recall;u.PendingOrder=&newReport;u.Downlink=&route;
hq.LostOrder(&u,5000);assert(!u.PendingTask&&u.Task==&activeWatch&&u.Waypoint==&oldWaypoint&&hq.m_Watch.calls==1);
u.Task=nullptr;u.Waypoint=nullptr;u.Assignment=nullptr;
ERR_HQTask security;security.SecuritySite="radio-1";u.PendingTask=&security;u.PendingOrder=&newReport;u.Downlink=&route;
hq.window.NextHunt=300000;hq.LostOrder(&u,5000);
assert(!u.PendingTask&&!u.Downlink&&hq.window.NextHunt==300000&&hq.m_Watch.calls==1);
// Unrelated belief cannot suppress bounded retry, and existing sooner retry remains sooner.
peer.PendingTask=&oldTask;u.PendingTask=&newTask;hq.window.NextHunt=5000;
hq.LostOrder(&u,2000);assert(hq.window.NextHunt==5000);