AI Script Commands - Basic Guide

A forum to discuss custom scenarios, campaigns and modding in general.

Moderator: Panzer Corps 2 Moderators

Post Reply
R2G2
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 89
Joined: Tue Feb 02, 2021 4:18 am
Location: Texas

AI Script Commands - Basic Guide

Post by R2G2 »

Edit Notes: Added details for Hold Position (Fire), Hold Position (Active), Guard Unit, and Harasser. See Steam for most updated guide.
Last edited by R2G2 on Fri Mar 26, 2021 5:07 am, edited 4 times in total.
R2G2
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 89
Joined: Tue Feb 02, 2021 4:18 am
Location: Texas

Re: AI Script Commands - Basic Guide

Post by R2G2 »

For those who don't need the screen shots, below is the text only. Please comment if I've left something out or if you've noticed a different AI response.

Default: Differs per unit type/class.
Attacker: Unit moves to enemy Victory Hex (VH) or revealed inferior enemy to attack. VH or enemy is chosen based on which is closer.
Defender: Unit moves to nearest friendly VH and will attack revealed inferior enemy within their movement range.
Hold Position (Passive): Unit will stay in place and never attack.
Hold Position (Fire): Unit will stay in place but will attack an inferior enemy in hex next to them. Arty and anti-air units will fire at revealed enemy within their range distance.
Hold Position (Active): Unit will stay in place until revealed inferior enemy is within their movement range then attack. Arty and anti-air units will fire at revealed enemy within their base movement plus range distance.
Guard Hex: Unit will move into selected hex they are guarding. They will attack revealed inferior enemy within the hex radius specified.
Guard Unit: Unit will move next to the selected unit they are guarding. They will attack revealed inferior enemy within the hex radius specified. Can also be used to support moving units. For example, anti-tank gun guarding an infantry set to Attacker. The infantry will lead in moving, and the AT gun will follow to support.
Move: Unit will move to specified hex. Additional Move commands can be used to create an exact path. Unit reverts to Attacker after all Move commands are completed.
Random Move: Unit will randomly move to one of the specified hexes. Unit reverts to Attacker after random move is completed.
Patrol: Unit will move the exact hex Sequence (or stay put if only 1 hex selected) for the specified Duration. They will attack revealed inferior enemy within their movement range. The Sequence will be repeated until the Duration is finished. Unit reverts to Attacker after Duration is completed Note: This command is great for keeping multiple attack waves in the backfield for a specified Duration.
Random Patrol: Unit will randomly move within selected Area for specified Duration. They will attack revealed inferior enemy within their movement range. Unit reverts to Attacker after Duration is completed.
Hunter: Unit will attack nearest revealed inferior unit. They only go after VH if it’s revealed with an inferior enemy. Therefore, this command puts high priority on attacking units and low priority on capturing VH.
Harasser: This is the only command that uses Bases. Bases are fall back points to add replacements once strength falls below specified amount. If VH is selected as Base location the AI will fall back, reinforce, and sit on VH. If Base is not a VH then the AI will fall back, repair, attack again, and repeat. If multiple hexes are selected as Bases, the AI alternates between the Bases as fall back points. Harasser also allows Recon units to attack and move away in the same turn if they have enough movement points. A Harasser will move toward nearest VH if no enemy is revealed.
Additional Notes:
- AI will attack superior units if the Aggressiveness level is set high enough.
- Turn duration set to 0 is equal to total number of turns in scenario.
- If multiple inferior enemies are revealed, the AI attacks the most expensive unit based on Prestige value.
- Multiple Commands can be stacked on a unit to create a somewhat advanced/unpredictable AI. Example: Patrol>Random Move>Hunter: Good combo for AI second wave counter attacks.(see zip file for screen shot)
- Random Move and Random Patrol allow you to play your own scenarios and still be surprised by AI positions.
- The AI’s order of operations with Default commands is the following sequence…Strat Bomber, Recon, Tac Bomber, Anti-Air, Fighter, Arty, Infantry, Tank, Anti-tank / Replacements are added for each individual unit class within the order of ops
Last edited by R2G2 on Fri Mar 12, 2021 4:45 pm, edited 4 times in total.
eddieballgame
Sergeant Major - SdKfz 234/2 8Rad
Sergeant Major - SdKfz 234/2 8Rad
Posts: 628
Joined: Mon Dec 17, 2012 2:53 am

Re: AI Script Commands - Basic Guide

Post by eddieballgame »

Thank you for this, will prove to be very helpful.
Post Reply

Return to “Panzer Corps 2 Scenario Design”