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
+4 -3
View File
@@ -8,7 +8,7 @@ s=s.replace('bool m_Enabled;', 'bool m_Enabled=false;').replace('bool m_Finished
s=s.replace('class ERR_ConvoyStartup', 'struct ERR_ConvoyStartup').rstrip()+';'
h=body(ROOT/'addons/core/Scripts/Game/ERR/10_AI/ERR_HQ.c','protected void AutomaticConvoy(')
h=h.replace('protected ','').replace('null','nullptr').replace('Replication.','Replication::').replace('ERR_GameMode.','ERR_GameMode::')
for name in ('m_Mode','m_ConvoyStartup'):h=h.replace(name+'.',name+'->')
for name in ('m_Mode','m_ConvoyStartup','m_SupplyConvoys','m_Convoys'):h=h.replace(name+'.',name+'->')
run(r'''
#include <cassert>
#include <cmath>
@@ -20,7 +20,8 @@ struct ERR_ForceRules {static bool Finite(float n){return std::isfinite(n);}};
struct Replication {inline static bool server=true;static bool IsServer(){return server;}};
struct ERR_GameMode {inline static ERR_GameMode* current;bool active=true;static ERR_GameMode* Get(){return current;}bool Active(){return active;}};
struct Journal {int count=0;void Write(string,string){count++;}};
struct HQ {ERR_GameMode* m_Mode;ERR_ConvoyStartup* m_ConvoyStartup;void* m_ConvoyTask=nullptr;string m_ConvoyFailure;Journal m_Journal;bool ready=true,accepted=true;int calls=0;bool ConvoyAdmissionReady(){return ready;}bool StartScenarioConvoy(){calls++;return accepted;}
struct Supply {void Tick(float,bool){}}; struct Service {int Count(){return 0;}void* At(int){return nullptr;}};
struct HQ {Supply* m_SupplyConvoys=nullptr; Service* m_Convoys=nullptr;ERR_GameMode* m_Mode;ERR_ConvoyStartup* m_ConvoyStartup;void* m_ConvoyTask=nullptr;string m_ConvoyFailure;Journal m_Journal;bool ready=true,accepted=true;int calls=0;bool ConvoyAdmissionReady(){return ready;}bool StartScenarioConvoy(){calls++;return accepted;}
'''+h+r'''
};
int main(){
@@ -31,7 +32,7 @@ int main(){
ERR_ConvoyStartup manual;manual.Initialize(true);assert(!manual.Decide(0,true,true)&&manual.Finished());assert(!manual.Decide(60000,false,true));
ERR_ConvoyStartup invalid;invalid.Initialize(true);assert(!invalid.Decide(std::numeric_limits<float>::quiet_NaN(),false,true));assert(!invalid.Decide(-1,false,true));invalid.Decide(10000,false,false);assert(!invalid.Decide(0,false,true));assert(invalid.Decide(40000,false,true));
ERR_ConvoyStartup stopped;stopped.Initialize(true);stopped.Decide(0,false,false);stopped.Stop();assert(!stopped.Decide(30000,false,true));
ERR_GameMode mode;ERR_GameMode::current=&mode;ERR_ConvoyStartup startup;startup.Initialize(true);HQ hq{&mode,&startup};
ERR_GameMode mode;ERR_GameMode::current=&mode;ERR_ConvoyStartup startup;startup.Initialize(true);HQ hq;hq.m_Mode=&mode;hq.m_ConvoyStartup=&startup;
Replication::server=false;hq.AutomaticConvoy(0);assert(hq.calls==0&&hq.m_Journal.count==0);Replication::server=true;
ERR_GameMode::current=nullptr;hq.AutomaticConvoy(0);assert(hq.m_Journal.count==0);ERR_GameMode::current=&mode;
mode.active=false;hq.AutomaticConvoy(0);assert(hq.m_Journal.count==0);mode.active=true;