Author Topic: So, how and when do the character AI scripts work (FF7)?  (Read 4514 times)

Bosola

  • Fire hazard!
  • *
  • Posts: 1749
    • View Profile
    • My YouTube Channel
I've been trying to add some functionality via character AI scripts, but I've come across a couple of barriers.

It seems that character AI scripts are only active in certain circumstances, in certain ways.

For instance, this General Counter script, that cuts a random enemy, works absolutely fine:

Code: [Select]
General Counter, Cloud:
12 2070
02 20a0
82
90
60 01
60 00
92

But if I just use

Code: [Select]
93 'Ugh!'
Nothing displays, and

Code: [Select]
Self.FlagPoison<-1
won't work either.

In what cases can I use these different counter scripts, and what can I actually do in them? When does this flag manipulation actually work?

Also, I've read that extra counter scripts can be applied to the party, for example in the Carry Armor fights. Where are these scripts? In the scenes?

Do different battle flags switch on and off certain character AI functionality?

nfitc1

  • *
  • Posts: 3008
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: So, how and when do the character AI scripts work (FF7)?
« Reply #1 on: 2011-01-09 22:02:47 »
My understanding of this is slightly limited so bear with me.

I didn't have any problem with:

93: "Script5"

on Red XIII when I was testing the timing of Physical/Magical Counters. Also, I think General Counters take a back seat to Physical/Magical Counters. If you have a Physical Counter and a General Counter, the Physical Counter will be processed first and the details of what happens next are fuzzy in my mind. The game may say "counter handled" or it may continue to the General Counter one. It's been a while since I tested.

As for the Carrier Armor fights, those extra scripts are actually scene scripts. There are only a handful of boss fights that use them and they almost all have to do with flagging certain characters as dead in certain situations. I don't have details, but I only think Carry Armor, Reno (the first fight with the pyramids), and Bottomswell use these scene scripts. Basically they apply to all player characters (though they might affect enemies too). I don't know if they TRUMP them or are addons. I really haven't experimented with these a lot.

Bosola

  • Fire hazard!
  • *
  • Posts: 1749
    • View Profile
    • My YouTube Channel
Re: So, how and when do the character AI scripts work (FF7)?
« Reply #2 on: 2011-01-09 23:26:30 »
Also, I think General Counters take a back seat to Physical/Magical Counters. If you have a Physical Counter and a General Counter, the Physical Counter will be processed first and the details of what happens next are fuzzy in my mind. The game may say "counter handled" or it may continue to the General Counter one. It's been a while since I tested.

Ah, good thinking. Looks like a counter attack materia prevented the string display.

Interestingly, though, it didn't stop my 'cut random enemy' script, which always activated, despite the materia having no AP. I'll have to look into this. Maybe the script is half-run but checked against the active counter list?

The idea of only running one counter script makes a lot of sense, though. I'll have to see if there's any hierarchy...

Quote
As for the Carrier Armor fights, those extra scripts are actually scene scripts. There are only a handful of boss fights that use them and they almost all have to do with flagging certain characters as dead in certain situations. I don't have details, but I only think Carry Armor, Reno (the first fight with the pyramids), and Bottomswell use these scene scripts. Basically they apply to all player characters (though they might affect enemies too). I don't know if they TRUMP them or are addons. I really haven't experimented with these a lot.

I'm guessing they'd trump them - they probably just change a pointer to the script location. Otherwise, I'd guess they insert themselves at the start of the 'real' script (because there'd otherwise be a 73 code half way).

I also briefly tried looking for a script Terence Fergusson mentions, giving Air Buster a x5 weakness to back attacks. Couldn't find one in the SCENE, though.

I also had an issue trying to 'recover' a H0512 battle I'd erased. A verbatim copy of data PC showed in the original scene didn't work properly - the H0512-Opt units wouldn't properly reappear. I'm guessing there's more scene specific AI?

Reflecting on this, I don't think the battle flags determine this stuff - from what I've seen, bugtesting my own scenes, they somehow seem to link the monsters to the background, or manage animations. For instance, I've noted that Super Nova + The Swirling Heavens only seems to work with battle flag FFF1. Anything else makes ePSXe spit out a 'recompile block too large' error (I'll have to do more research, though). Googling that error yielded me a post about multiple PSX games on one disc, so I assume the battle flag helps FF7 find the location and size of the animation data.

How similar is this 'scene AI' to AI I've seen? Does it follow the same rules and use the same opcodes?
« Last Edit: 2011-01-10 16:24:42 by Bosola »