Hi all, I'm working on a rewrite of the AI for FFVII and right now I'm working on the first encounter with Reno. I added a main script to the pyramid to make the fight more interesting, here it is:
local var 0100 = 0 (in header script)
0x000 If ( (LocalVar:0100 <= 3) )
0x000 {
0x00F Display String: "The pyramid is getting harder!"
0x02F LocalVar:0100 <- LocalVar:0100 + 1
0x039 If ( (LocalVar:0100 == 4) )
0x039 {
0x042 Self.Flag:PhysicalImmune <- 1
0x04C Self.Flag:MagicalImmune <- 1
0x056 LocalVar:0100 <- 5
0x05C SCRIPT END
Now the issue is that this script loops forever, but I'd like it only to be active whenever the pyramid is "active." So I tried everything I could think of, and nothing worked. This included:
1: Using the self.enabled mask as a condition (so I nested the entirety of the above loop in a "only do this when self.flag.enabled == 1 condition) which apparently caused the game to hang (so that's out)
2: Using self.death as a condition (even after modifying the pyramid's death counter script to work with it) which just didn't work as apparently the pyramid won't die.
Is there a good known trick for just outright disabling the main loop given in one of the counterscripts or something?
Thanks a ton,
Best,
QP
EDIT: So, I still haven't figured out why the above two approaches don't work (Like why using the enabled conditions causes the game to hang) but I did find a solution. Though it isn't listed on the wiki,
http://wiki.qhimm.com/view/FF7/Battle/Battle_Scenes/Battle_AI_Addresses here, 4024 appears to be a flag for whether or not the main script is active, so self.4024 ==0 fixed the problem =)