Tomas45 wrote: ↑Thu Oct 30, 2025 7:20 pm
Hi — for example, I’d like to know what the menu in the editor is where the scripts are: what each option does and how/where it works.
For example, I place infantry and I want them to move somewhere or capture a town or barracks. What units should the AI buy and where should it move them. Something long‑term about how things are written (how to script it). I don’t really know how it works myself — the idea just came to me.
 
Ah, let's say there are "scenario scripts" that apply for the whole scenario and "units scripts" that are just about units.
They are not in the same place.
To give a particular stance of an unit don't requiere any script (unless you want to change it during the scenario ; but its more complex and I don't advise you to try it now). 
Left click on the unit while pressing shift button.
This command will open the unit screen :
Here, you change its name, transport, experience level, etc...
What interest you is at the bottom : "AI Behavior", and possibly "AI zone".
DON'T READ IF YOU ARE A PLAYER AND WANT TO KEEP THE MAGIC ABOUT THE COMPUTER MOVES  
 
AI behavior change what the selected unit will do.
Some explanations about the choices :
- 
Hold Position (Passive) is the easiest to understand. The unit will do nothing other that shooting back when attacked. It is rarely used.
- 
Hold Position (fire) means that the unit will not move at all but fire on targets at range. Useful when you want to make a static defense somewhere, like a line of trenches that the ennemy computer want to hold at all cost. Important in scenarios that requieres the player to attack against the AI.
- 
Hold Position (active) is misleading. The unit will in fact move as soon as an ennemy it can damage is within reach. The unit will consequently leave its position, but will hinder the attacking player. A purely static defense is generally boring, so I advise you to put some units with this stance a few tiles behind or next to units with hold position (fire) during scenario where the AI have to defend. It often gives the feeling that the AI try to disrupt your moves.
- 
Default means the the unit will go to the nearest victory point, either to attack it or defend it. You can manipulate its moves with smart victory point placement. If you place 2 close victory points, the AI unit will attack one, then move to the other once the first is captured and cleared. However, it will not bother to move if the next victory point is too far. 
- 
Attacker and 
Defender are supposed to be a bit more precises stances than "Default", making the unit prefere to attack or defend nearest victory points... but I never see any changes during my tests. "Defender" units also join an assault if the closest VP is controlled by the player, and "attackers" defend if the closest is controlled by their side... It can be capricious  
 
The 5 remaining requieres you to change the AI zone, just under this setting.
- 
Move to will make the unit move to the zone you specify in "AI zone". It could attack the opponent player unit en route, but will not actively try to kill them. It will try to move to bypass the opponent units and reach its destination as a priority instead. Useful when you want to set a unit to attack a specific location far from its starting point ; it's more reliable than the "attacker" stance, at the cost of having the unit move more than necessarly. It could also represent a desperate assault, with the unit rushing to reach its goal despite the danger.
- 
Random move to ... never used  
 
- 
Patrol : place several points (the "zone" setting), the AI unit will move at each of them. The AI will stop its patrol if an ennemy is spotted close to it. When that happen, the unit will move to engage immediately. I often use it in several situations. It allows to have reinforcement that can suddenly arrive in a position that the player attack ; or are ideal in my "infiltration" missions, for example. I like "patrol" setting, it makes feel that the computer is more alive than it really is  
 
- 
Disembark : If a unit is in a transport plance or helicopter, the unit will move to the zone specified and unload there. It certainly also work with sea transports, but I never tried that  yet  
 
Tomas45 wrote: ↑Thu Oct 30, 2025 7:20 pm
What units should the AI buy
 
That is among the few things we can't tell the AI to do  
 
HOWEVER (and that is one of the first thing I learned to do), you can simulate reinforcements easily with the "unit script".
In the "unit screen", you can see "edit trigger" at the bottom.
A new window will open.
This screen allows you to make the unit appear when you want.
You should start with just the easier to experiment, that is : "add time condition"
It is simple : it means that the unit will appear as soon as possible when the left condition is checked.
For example, if you write "turn between "3" and "-1" ", the unit will appear at the start of turn 3.
Leave -1 at the right, it means that the condition will stay active until the last turn of the scenario. Consequently, if the unit can't appear at turn 3 (if for example another unit is on his hexagon during turn 3), it will appear as soon as the hexagon is free during the following turns.
Just an advice : you should always make sure that the player can't see the AI units appear (it feels very unrealistic otherwise, it looks more as reserve units deployed if the player can't see them appear). you can :
a) make them appear in places that the player can't reach at this point of the scenario, even if he is excellent (always consider that he is) ;
b) it requieres more time and more understanding of the scenario editor : but you can add a "map condition" to make sure that no player units are around where the unit will be deployed.
That's enough for today, and I think it is enough for you to experiment for some time. 
Once you are familiar with those settings, I advise you to try the other "unit scripts", to make units appear in other situations.