FE7 "Surround" AI in FE8?

When I was looking at the AI documentation threads for FE7 and FE8, I noticed that FE7 has an extra type of targeting AI. The targeting AI in both games seems to be more applicable to enemies, but FE7 also has a type of surrounding AI where the unit will simply stay near the character, almost like Lachesis’s allies in FE4. Here is the FE7 thread for reference (the AI I’m referring to is found at 0x21 and 0x22 of the secondary AI). I’ve never really tried porting things from FE7 to FE8, so I’m unsure of how to approach this. Any advice would be appreciated!

I assume this is what you’re looking for?


I was looking for 0x21/0x22, emphasis on the “stay near target if not attacking.” Am I reading what these do incorrectly?

(FE7) 0xE Move towards Eliwood
0D00FF00010000000000000000000000	//To [unit:0x1 Eliwood]
0002FF010400000072A9030200000000	//IF [Value:0x4]==AIScriptResult Then [label:0x1]
0002FF020100000072A9030200000000	//IF [Value:0x1]==AIScriptResult Then [label:0x2]
0002FF010200000072A9030200000000	//IF [Value:0x2]==AIScriptResult Then [label:0x1]
0300FF00000000000000000000000000	//EXIT [id:0x0]
1B00FF01000000000000000000000000	//LABEL [label:0x1]
1200FF00000000000000000000000000	//Attack12
0300FF00000000000000000000000000	//EXIT [id:0x0]
1B00FF02000000000000000000000000	//LABEL [label:0x2]
1200FF00000000000000000000000000	//Attack12
0300FF02000000000000000000000000	//EXIT [id:0x2]

(FE7) "0x21 Move towards Eliwood"
0D00FF00010000000000000000000000	//To [unit:0x1 Eliwood]
0002FF010400000072A9030200000000	//IF [Value:0x4]==AIScriptResult Then [label:0x1]
0002FF020100000072A9030200000000	//IF [Value:0x1]==AIScriptResult Then [label:0x2]
0002FF010200000072A9030200000000	//IF [Value:0x2]==AIScriptResult Then [label:0x1]
0300FF00000000000000000000000000	//EXIT [id:0x0]
1B00FF01000000000000000000000000	//LABEL [label:0x1]
0E00FF00000000000000000000000000	//NOP
0300FF00000000000000000000000000	//EXIT [id:0x0]
1B00FF02000000000000000000000000	//LABEL [label:0x2]
1200FF00000000000000000000000000	//Attack12
0300FF02000000000000000000000000	//EXIT [id:0x2]

It looks like the only difference bewteen the two is a single instruction in the ai script

(FE8) Move towards Eirika
0D00FF00010000000000000000000000	//To [unit:0x1 Eirika]
0002FF01040000008AAA030200000000	//IF [Value:0x4]==AIScriptResult Then [label:0x1]
0002FF02010000008AAA030200000000	//IF [Value:0x1]==AIScriptResult Then [label:0x2]
0002FF01020000008AAA030200000000	//IF [Value:0x2]==AIScriptResult Then [label:0x1]
0300FF00000000000000000000000000	//EXIT [id:0x0]
1C00FF01000000000000000000000000	//FE8LABEL [label:0x1]
1200FF00000000000000000000000000	//Attack12
0300FF00000000000000000000000000	//EXIT [id:0x0]
1C00FF02000000000000000000000000	//FE8LABEL [label:0x2]
1200FF00000000000000000000000000	//Attack12
0300FF02000000000000000000000000	//EXIT [id:0x2]

The syntax is almost the same bewteen fe7 and fe8 so i assume you can just copy paste
this one and replace that first Attack12 with a NOP to achieve the same effect as 0x21 from fe7?

There’s already an editor for the ai scripts in febuilder so you can try messing around with it there

1 Like