Is it currently possible to add to the "AIEvents" table?

chillbaka1

Chieftain
Joined
Nov 13, 2016
Messages
46
I am trying to make my own AI improvement mod and my current project is to create a new behavior tree that should do the following.
-This tree runs every turn at war, and goes though every unit and checks for 3 things
1. Is the unit already part of an operation? (city assault, city defense, settle city op, ect.) If no, then move towards the front lines, or if there is either a city defense or a city assault op then move to that area.
2. Is this area close to the frontlines? If yes then stay. If no AND the unit is able to move there AND it is within a reasonable distance then move there. If no AND the unit has no path back OR if it is too far away, delete the unit.
3. Is the unit outdated? Either upgrade or delete based on gold and based on checks in the previous step.


I am hoping that this will help get rid of the problem with these powerful civs with like 20 units by the cap but either let a nearby city get taken or fail a city siege because they only had like 4 units there.

The problem I am having is that i want it to trigger when war is declared. There are other behavior trees that have triggers like this one.

"<Row TriggerType="TRIGGER_SETTLE_SPOT" TreeName="Settle City Op" OperationName="Settle New City" AIEvent="AI_EVENT_DESIRE_SETTLE" Priority="4"/>"

I want to add a trigger type called "AI_EVENT_WAR_DACLARED" but I cannot find where to do this, or find the code that describes these events. Can anyone help?
 
Top Bottom