ChangeAI Functionality - Guard -> Aggressive

@Agro suggested I share/document this. Credit to the discovery of how to actually pull it off goes to @dancer_A though.

Normally, the ChangeAI command only affects the first 3 bytes of AI data. Because of this, using ChangeAI on a unit set to Guard ([0x00,0x03,0x00,0x20] or GuardTile ([0x03,0x03,0x09,0x20]), when changed to something like PursueWithoutHeed, will cause it to move but not attack.

Unless, instead of Guard, you use the following byte combination as unit’s starting AI: [0x03,0x03,0x09,0x00]

Thereafter, when you do something like this…

CHAI [9,4] PursueWithoutHeed

The unit should move and attack normally.

6 Likes