Unused/useless variables safe to use in savemap? (PSX)

  • Thread starter Thread starter Roden
  • Start date Start date
Status
Not open for further replies.
Usually to start editing, I click once on the group and then hit 'Enter'. I try to avoid double-clicks because things can go wrong from that sometimes. That said, I tried double-clicking on Cloud's pre-battle but there was no error message so it might be the way your tool is set up or the kernel itself (more likely it's the kernel itself). Try single-click and then hitting Enter to start a new AI in there, though; see if that works (a 73 should appear).
 
Usually to start editing, I click once on the group and then hit 'Enter'. I try to avoid double-clicks because things can go wrong from that sometimes. That said, I tried double-clicking on Cloud's pre-battle but there was no error message so it might be the way your tool is set up or the kernel itself (more likely it's the kernel itself). Try single-click and then hitting Enter to start a new AI in there, though; see if that works (a 73 should appear).
Alright, thanks - I just tested on an unmodfied and modified kernel on two Windows 7 PCs, I can get the 73 to appear by hitting ENTER on both of them. I imagine there is some sort of trick to inputting the data in the correct format it needs? I managed to create a bunch of white boxes, and get 0000 to appear in some of them, and then when I click on another option and come back it just gives an index error (doesn't crash) and all the white boxes are gone and its just 73 again.
 
Edit: It's not as easy to show this visually as I thought it would be. Here's how I generally do it:

I single-click the empty AI group and hit Enter twice. That gets the 73 and an empty block (it behaves slightly differently in older builds of ProudClod though). I then click on the empty block and enter the value before hitting the Down-Arrow key to move to the next cell. As a general rule, I try to write it out all in the one go, copying from a Notepad, and avoid clicking away until it's all in. Then I can save it and make adjustments without risking lost time.

And one thing to try and avoid is actually highlighting the numbers themselves; you want to have the whole cell itself highlighted when you start typing. It usually tricks out otherwise, especially if you try to move to the next cell. And sometimes, when you enter numbers in wrong, it can bug out then too so try to avoid mistakes.

Try this to start with; it's the first part of the test AI I had:
Code: [Select]
Code:
01 01C060 004070 000911 000060 509073
It should look like this in the decompiler when it's done:
If ( (LocalVar:01C0 == 0) )
{
   LocalVar:0000 <- 80
 
Last edited:
Thanks! Kind of strange but I got it inputted eventually! After I click disassemble it says:

If ( (LocalVar:01C0 == 0) )
{
   LocalVar:0000 <- 80
}
SCRIPT END

Which is great as it matches what you said, but what does this code do (i.e. how do I use/modify it?)? Localvar 01C0 refers to which variable in Makou?
 
It doesn't do much on it's own, it was just a practice to get used to inputting AI without problems popping up. The whole code was:

Code: [Select]
Code:
01 01C060 004070 00##*11 000060 509060 0001 00009511 201801 20109001 201060 324470 00##*11 01A003 205002 42E0809011 01C003 205002 42E0809011 205003 42E08001 01A060 02329011 01C060 009093: **73
*: Set this to the current cell value of 73/End Script; it auto-updates as the script gets shorter/longer, at least in simple scripts like this.
**: The 93 here is optional, I use it to check if something is triggering. In the ** cell you'd enter a bit of text, like 'test' or something.

Which in the decompiler looks like:

If ( (LocalVar:01C0 == 0) )
{
   LocalVar:0000 <- 80
   TempGlobal <- &GlobalVar(0000)
   Unknown(2018) <- GlobalAddress
   If ( (GlobalAddress > 50) )
   {
      LocalVar:01A0 <- ActiveMask.Exp
      LocalVar:01C0 <- ActiveMask.Exp
      ActiveMask.Exp <- LocalVar:01A0 * 2
      LocalVar:01C0 <- 0
      Display String: ""EXP sum triggered""
   }
   SCRIPT END

One thing to note is that while this script did appear to trigger in battle, it was a half-finished prototype where I essentially gave up on the EXP thing and was just trying random combinations to get it working so don't worry about that bit where it says Active Mask or EXP. The '0' at [LocalVar:01C0 <- 0] was supposed to be a 1 too, can't remember why I wanted the script running every time I attacked.

I'll get yelled at again for being hazy on the actual details, but here's what the things in this script sort of are:

LocalVar: 0000, 0020, ..., 01C0
These are like temporary variables the battle engine uses. They're not related to the field variables, I don't think. Most of the enemies of the game use these to determine their attacks. They go up in 20's but I've seen Gjoerulv use 0010, 0030, etc. for his AIs so y'know. I generally use high numbers to avoid conflicts, so I'm using that 01C0 up there to shut it down after it's been run once (or at least, it would if that 0 toward the end was a 1).

GlobalVar: These are the ones that access field variables. Only Bank 1 is accessed, so first we need to specify which variable we want to read in this bank and we can use the battle engine's temporary variables to carry the numbers about. We want [80] in Bank 1, so:
LocalVar:0000 <- 80

My memory is very hazy at this point, but I most likely copied this from Jenova SYNTHESIS or Zombie Dragon who both use Global variables:

   TempGlobal <- &GlobalVar(0000)
   Unknown(2018) <- GlobalAddress

I'm not sure what that does, I'm afraid. But it seems to enable the If string that follows, and I think it didn't trigger whenever the value of [1][80] was set below 50; it's been a while since I used the script:
   If ( (GlobalAddress > 50) )

So with the IF string triggering based on the value loaded from the variable, you can now adjust things like HP for enemies and other things. Now if you'll excuse me, I'm going to go hide before certain scary people find this post.
 
I've already explained this. Battle script can only write (and read from?) to the first 256 bytes of the save map.  That's what we are calling Bank 1 (which in the field script is [1] / [2].  0000-00FF (0-255).

A battle write to Byte 0 is equal to [1][0] in Makou.

A battle write to Byte 255 is equal to [1][255] in Makou.

That's its whole range.  In battle there is no "field var".  In fact, there is no "field var" full stop.  In reality there is one lump of data that can be written /read at 0000-04FF  (the 5 "banks").  And battle can only write from 0000 to 00FF.
 
Last edited:
It doesn't do much on it's own, it was just a practice to get used to inputting AI without problems popping up. The whole code was:

Code: [Select]
Code:
01 01C060 004070 00##*11 000060 509060 0001 00009511 201801 20109001 201060 324470 00##*11 01A003 205002 42E0809011 01C003 205002 42E0809011 205003 42E08001 01A060 02329011 01C060 009093: **73
*: Set this to the current cell value of 73/End Script; it auto-updates as the script gets shorter/longer, at least in simple scripts like this.
**: The 93 here is optional, I use it to check if something is triggering. In the ** cell you'd enter a bit of text, like 'test' or something.

Which in the decompiler looks like:

If ( (LocalVar:01C0 == 0) )
{
   LocalVar:0000 <- 80
   TempGlobal <- &GlobalVar(0000)
   Unknown(2018) <- GlobalAddress
   If ( (GlobalAddress > 50) )
   {
      LocalVar:01A0 <- ActiveMask.Exp
      LocalVar:01C0 <- ActiveMask.Exp
      ActiveMask.Exp <- LocalVar:01A0 * 2
      LocalVar:01C0 <- 0
      Display String: ""EXP sum triggered""
   }
   SCRIPT END

One thing to note is that while this script did appear to trigger in battle, it was a half-finished prototype where I essentially gave up on the EXP thing and was just trying random combinations to get it working so don't worry about that bit where it says Active Mask or EXP. The '0' at [LocalVar:01C0 <- 0] was supposed to be a 1 too, can't remember why I wanted the script running every time I attacked.

I'll get yelled at again for being hazy on the actual details, but here's what the things in this script sort of are:

LocalVar: 0000, 0020, ..., 01C0
These are like temporary variables the battle engine uses. They're not related to the field variables, I don't think. Most of the enemies of the game use these to determine their attacks. They go up in 20's but I've seen Gjoerulv use 0010, 0030, etc. for his AIs so y'know. I generally use high numbers to avoid conflicts, so I'm using that 01C0 up there to shut it down after it's been run once (or at least, it would if that 0 toward the end was a 1).

GlobalVar: These are the ones that access field variables. Only Bank 1 is accessed, so first we need to specify which variable we want to read in this bank and we can use the battle engine's temporary variables to carry the numbers about. We want [80] in Bank 1, so:
LocalVar:0000 <- 80

My memory is very hazy at this point, but I most likely copied this from Jenova SYNTHESIS or Zombie Dragon who both use Global variables:

   TempGlobal <- &GlobalVar(0000)
   Unknown(2018) <- GlobalAddress

I'm not sure what that does, I'm afraid. But it seems to enable the If string that follows, and I think it didn't trigger whenever the value of [1][80] was set below 50; it's been a while since I used the script:
   If ( (GlobalAddress > 50) )

So with the IF string triggering based on the value loaded from the variable, you can now adjust things like HP for enemies and other things. Now if you'll excuse me, I'm going to go hide before certain scary people find this post.
Not sure what surprises me more - that you actually came up with that code or that it works on FF-J original version :P Great job! I assigned one high 16-bit number and one low in init of two rooms and walked between each and it worked as expected. I noticed the string didn't appear for enemies that say stuff though such as "intruders" in the first reactor. Also by default it seems to be over 50..

Just a few more questions - if its OK!  :D

1. So Bank [1] 80 is the battle points love variable? Is this the only one we can use? Or is there a few like 81, 82? Also, is it overwritten (or increased?) when the battle is finished (so we need to overwrite it to 0 again?)
2. How would I begin experimenting and adjusting HP values? I'm not familiar (at all) with the opcodes FF7 uses.. I think basically I would want it to read if the variable is higher than 50 (or whatever to trigger it), and then have another variable act as the HP value (i.e. so it doesn't set the HP variable everytime, only when I tell it).
3. If Cloud is not in the party, does it all fall apart, or can I add it to all party members somehow?
4. Could you pass a string "variable" to say different things? I think the string function is kind of cool as well.
 
Not sure what surprises me more - that you actually came up with that code or that it works on FF-J original version :P Great job! I assigned one high 16-bit number and one low in init of two rooms and walked between each and it worked as expected. I noticed the string didn't appear for enemies that say stuff though such as "intruders" in the first reactor. Also by default it seems to be over 50..
I had a bunch of help from NFITC1 and Sithlord getting that together (well, that and the code already in the game). I was told that there's four variables used for B. Love Points: 80, 81, 82, 83 and that they're set to start at 100. In Makou I set it to 0 and tried it at above 50; I remember testing it and I think it worked (triggers above 50, doesn't trigger below 50), but I can't commit to that because it was a while ago. Not sure about the text string interference either, you might need to test it at different points of the game to make sure.

1. So Bank [1] 80 is the battle points love variable? Is this the only one we can use? Or is there a few like 81, 82? Also, is it overwritten (or increased?) when the battle is finished (so we need to overwrite it to 0 again?)
2. How would I begin experimenting and adjusting HP values? I'm not familiar (at all) with the opcodes FF7 uses.. I think basically I would want it to read if the variable is higher than 50 (or whatever to trigger it), and then have another variable act as the HP value (i.e. so it doesn't set the HP variable everytime, only when I tell it).
3. If Cloud is not in the party, does it all fall apart, or can I add it to all party members somehow?
4. Could you pass a string "variable" to say different things? I think the string function is kind of cool as well.
1. Sith told me that 80, 81, 82, and 83 are used and that they're set to 100 by default. You can set them lower through Makou; I usually give random NPCs on the Highwind codes like this in their talk script to quickly trigger it. As far as using others go, I guess any can be used so long as they're not already in use (I'm still trying to clean that up in my mod).

2. There's an OPCode list but I think the one I snagged is out of date by now. As far as adjusting HP goes, it depends on what you want to do; what is it specifically you're after? Because the HP value will generally be bigger than 255, it needs to be stored in the actual AI somewhere and pushed into the enemy from there (unless we're multiplying Enemy HP, but I've never had much luck with multiplying and multiplying enemy HP tends to go south eventually). I'll upload that OPCode file in any case.

3. There are scripts in there that 'link with scripts on character 0' (Cloud being Character 0) that should have other characters run his scripts whether he's in the current party or not. NFITC1 warned me that I'd need to find a way to make this only run once, but there might be ways to make it so that it doesn't matter if the script is run 2-3 times in one battle. You'd want:
60 00
75
73
In Barret, Tifa, Cid, and Yuffie pre-battle AI. I think that covers everyone. Also, I'm not sure if pre-battle runs if a character starts a fight dead; assuming there's no kernel mishaps, if you can put that small code into all 9 characters then I guess that'd completely cover it.

4. Dunno what you mean, it's just for making text appear. If you want the string to have a pause after it displays, then enter it like this:
93 TEXT
60 24
60 00
92
Seems to do the trick. To have a character's name appear, it's {EA000#H} where the # replaces the character's ID (Cloud is 0, Barret is 1, etc.) So it'd be written as: '{EA0000H}: "{EA0001H}! Attack while it's tail's up!"' However, using EAs makes a bunch of 60 00s appear for some reason. Probably to handle space or something. Not sure how the character AI will react to it either, it handles differently from the older Proud Clod versions I use.
 
I had a bunch of help from NFITC1 and Sithlord getting that together (well, that and the code already in the game). I was told that there's four variables used for B. Love Points: 80, 81, 82, 83 and that they're set to start at 100. In Makou I set it to 0 and tried it at above 50; I remember testing it and I think it worked (triggers above 50, doesn't trigger below 50), but I can't commit to that because it was a while ago. Not sure about the text string interference either, you might need to test it at different points of the game to make sure.

1. Sith told me that 80, 81, 82, and 83 are used and that they're set to 100 by default. You can set them lower through Makou; I usually give random NPCs on the Highwind codes like this in their talk script to quickly trigger it. As far as using others go, I guess any can be used so long as they're not already in use (I'm still trying to clean that up in my mod).

2. There's an OPCode list but I think the one I snagged is out of date by now. As far as adjusting HP goes, it depends on what you want to do; what is it specifically you're after? Because the HP value will generally be bigger than 255, it needs to be stored in the actual AI somewhere and pushed into the enemy from there (unless we're multiplying Enemy HP, but I've never had much luck with multiplying and multiplying enemy HP tends to go south eventually). I'll upload that OPCode file in any case.

3. There are scripts in there that 'link with scripts on character 0' (Cloud being Character 0) that should have other characters run his scripts whether he's in the current party or not. NFITC1 warned me that I'd need to find a way to make this only run once, but there might be ways to make it so that it doesn't matter if the script is run 2-3 times in one battle. You'd want:
60 00
75
73
In Barret, Tifa, Cid, and Yuffie pre-battle AI. I think that covers everyone. Also, I'm not sure if pre-battle runs if a character starts a fight dead; assuming there's no kernel mishaps, if you can put that small code into all 9 characters then I guess that'd completely cover it.

4. Dunno what you mean, it's just for making text appear. If you want the string to have a pause after it displays, then enter it like this:
93 TEXT
60 24
60 00
92
Seems to do the trick. To have a character's name appear, it's {EA000#H} where the # replaces the character's ID (Cloud is 0, Barret is 1, etc.) So it'd be written as: '{EA0000H}: "{EA0001H}! Attack while it's tail's up!"' However, using EAs makes a bunch of 60 00s appear for some reason. Probably to handle space or something. Not sure how the character AI will react to it either, it handles differently from the older Proud Clod versions I use.
Thanks for the detailed reply.
2. Use case would be to set certain enemies HP higher, thats all really. If it can't be set to a certain value, then I guess I could take a shot at multiplying it somehow as I don't want to edit enemy stats directly..
3. Understood, that's handy. I noticed they're linked to character 3 at the moment, so it would just be a one digit change.
 
If you're just setting HP to a certain amount for specific enemies then that's probably the easiest thing. If Enemy ID = #### would probably do the trick; actually, if that works then you might not even need the globalvar thing after all (unless they're only to get more HP after a certain criteria is fulfilled on the field).

Here's that OpCode list: http://www.mediafire.com/view/umiqacyau66u9c9/opcode_list.txt
 
If you're just setting HP to a certain amount for specific enemies then that's probably the easiest thing. If Enemy ID = #### would probably do the trick; actually, if that works then you might not even need the globalvar thing after all (unless they're only to get more HP after a certain criteria is fulfilled on the field).

Here's that OpCode list: http://www.mediafire.com/view/umiqacyau66u9c9/opcode_list.txt
Thanks, that list is awesome. Yeah it would definitely be via field criteria so I need the variable.

I've been trying to code it  (while looking at Proud Clod AI to get some ideas), but having some problems:

For example, if I set this command at the top of the If statement:  "AllOpponentMask.HP <- 82"  like so:

AllOpponentMask.HP <- 82
If ( (LocalVar:01C0 == 0) )
{
   LocalVar:0000 <- 80
   TempGlobal <- &GlobalVar(0000)
   Unknown(2018) <- GlobalAddress
   If ( (GlobalAddress > 50) )
   {
      Self.HP <- 82     //just ignore this test one obviously
      LocalVar:01C0 <- 0
   }
   SCRIPT END

It works fine and guard scorpion dies quickly. But if its inside the If statement it doesn't work, only the display message works. If I put self.hp = 255, for example, works fine outside if statement, but inside it doesn't work. Is it something to do with Unknown(2018)? Or have I screwed up a line somewhere? Seems odd only the display message works..

Of course this script is just for testing, I will want to use a global variable not hardcoded value, I assume that will let me drop in a higher value 16 bit number rather than 255?
 
I will want to use a global variable not hardcoded value, I assume that will let me drop in a higher value 16 bit number rather than 255?
then you better put two bytes together to make it 16 bit in size. ;)
 
then you better put two bytes together to make it 16 bit in size. ;)
Well I haven't got to that part yet, I'm just trying to get the If statement working for that assignment statement first. Maybe I screwed up something in-between the lines or something, as when I was removing the multiplication symbol from Sega Chief's code, I might of took something necessary out, even though the decompiler still reads it OK. That might explain why the display message part works OK as its just one line (93) hard to screw that up :P
 
It might be the method being used to adjust HP. One thing you should do is have an English scene.bin you can open up and have a look at the AI in; I learned a lot from looking at the default game's enemy AI and how they work. So for HP, I looked at how Bizarro and Safer determine and adjust their HP before the battle starts (because it rises/drops depending on previous battles, player level, etc.)

This is a portion from a test group I had for adjusting enemy stats; I can confirm this works in the scene.bin, but the enemy is applying this to itself (which is why it uses Self.) so you'd need to use a different mask.

Code: [Select]
Code:
13 01A061 27109012 206013 41808003 01A09012 206013 41608002 206003 41808090
Which looks like this:
LocalVar:01A0 <- 10000
Self.MHP <- LocalVar:01A0
Self.HP <- Self.MHP

Thing to note there is that we're using 61 instead of 60 for the number being pushed into 01A0. We can't put a number like that into [1][80] because it's a one-byte address (and we can't get battle to read [2], which is where 2-byte stuff is read from). For stats like Strength and Magic Attack, you can apparently just push a value in directly but enemies I've seen do it this way for HP. What we need to do now is change the mask so that it applies to the enemy. There's two ways to try, but one I've not tested yet:

Code: [Select]
Code:
Enemy ID12 010002 205002 41208060 16 [Scorp's Enemy ID]4090By Bit (untested)12 010060 038790
With that loaded into the 0100 variable, you'd then replace the 2060s in this code with 0100 for:
LocalVar:01A0 <- 10000
LocalVar:0100.MHP <- LocalVar:01A0
LocalVar:0100.HP <- LocalVar:0100.MHP

Ideally, if the second one works (Bit) then it could be applied to any single enemy. Give it a whirl and see what happens; but if it doesn't work inside the IF thing then there must be something wrong with the way I set it up originally. You could perhaps get rid of the top IF bit because pre-battle only runs once so that part is now obsolete.
 
It might be the method being used to adjust HP. One thing you should do is have an English scene.bin you can open up and have a look at the AI in; I learned a lot from looking at the default game's enemy AI and how they work. So for HP, I looked at how Bizarro and Safer determine and adjust their HP before the battle starts (because it rises/drops depending on previous battles, player level, etc.)

This is a portion from a test group I had for adjusting enemy stats; I can confirm this works in the scene.bin, but the enemy is applying this to itself (which is why it uses Self.) so you'd need to use a different mask.

Code: [Select]
Code:
13 01A061 27109012 206013 41808003 01A09012 206013 41608002 206003 41808090
Which looks like this:
LocalVar:01A0 <- 10000
Self.MHP <- LocalVar:01A0
Self.HP <- Self.MHP

Thing to note there is that we're using 61 instead of 60 for the number being pushed into 01A0. We can't put a number like that into [1][80] because it's a one-byte address (and we can't get battle to read [2], which is where 2-byte stuff is read from). For stats like Strength and Magic Attack, you can apparently just push a value in directly but enemies I've seen do it this way for HP. What we need to do now is change the mask so that it applies to the enemy. There's two ways to try, but one I've not tested yet:

Code: [Select]
Code:
Enemy ID12 010002 205002 41208060 16 [Scorp's Enemy ID]4090By Bit (untested)12 010060 038790
With that loaded into the 0100 variable, you'd then replace the 2060s in this code with 0100 for:
LocalVar:01A0 <- 10000
LocalVar:0100.MHP <- LocalVar:01A0
LocalVar:0100.HP <- LocalVar:0100.MHP

Ideally, if the second one works (Bit) then it could be applied to any single enemy. Give it a whirl and see what happens; but if it doesn't work inside the IF thing then there must be something wrong with the way I set it up originally. You could perhaps get rid of the top IF bit because pre-battle only runs once so that part is now obsolete.
Thanks for the code, many cool things to learn from trying this out! I'll do it shortly.

And yes, I'm already looking through scene.bin. I'll also just mention again that the Guard Scorpion's HP WAS lowered when I didn't use your If statement, does this still fall under "It might be the method being used to adjust HP?" would it need to be different method just because its in that if statement?
 
I'm not sure. I usually copy the game's layout for doing things to avoid potential issues popping up so it's worth a shot (but it's probably something to do with the If). It's also handy for learning how to put values into variables and then pushing the variable into different things; gives you more control over what happens. You also want to adjust MaxHP which is treated as a separate value from CurrentHP, otherwise things like General Counters (a lot of which operate based on what % of HP a boss has left) will be out of whack. And you especially want to do it if you're setting CurrentHP higher than it was originally.
 
Yep, I was just playing with HP only and not MaxHP so I could get the basics down first.

I can report gladly that all the code above works (as I thought it would). Excellent! While I understand Enemy ID, I'm not sure I quite understand what is Bit 3? Is it monsters from the area you are fighting in or something? How does it only affect Guard Scorpion?

This is my code (setting HP to 5):

LocalVar:01A0 <- 5
LocalVar:0100 <- FlagBit(3)
LocalVar:0100.HP <- LocalVar:01A0
SCRIPT END

Now for the big test, throw it into an if statement haha. I haven't had any luck with this at all previously. Maybe with the enemy ID located in a variable it can work this time :)
 
There are 8 bits in a byte.

Any one of those 8 bits, numbered 0-7 can be turned on.  Bit 3 is the 4th bit.  0000X000
Before you tackle this stuff you will need to understand the basics of programming.
 
Last edited:
I forgot to say about the bit thing. For Jenova BIRTH's AI, she puts Flagbit 0, 1, and 2 into three separate variables and these have her attack each separate party member during a 'wave' of laser or w-laser. Later, I saw something in another AI where it targeted other enemies using bit 3, 4, etc. My hunch is that from 3 onwards it's enemies, problem is there can be 6 enemies on the field which is one too many for a byte. I'm trying to track down that enemy again so I can have a closer look at it.

Edit: Found it, was in Elena's Death Script

Code: [Select]
Code:
02 21A060 004070 00C612 21A060 019093 Reno “Let's call it a day.”12 207002 20609060 2061 01649212 000060 04879012 000010 40208060 009012 000010 40238060 009012 000010 40228060 009012 000010 40248060 009012 000060 05879012 000010 40208060 009012 000010 40238060 009012 000010 40228060 009012 000010 40248060 009012 000060 06879012 000010 40208060 009012 000010 40238060 009012 000010 40228060 009012 000010 40248060 00900x000 If ( (Unknown(21A0) == 0) )0x000 {0x009 Unknown(21A0) <- 10x00F Display String: "Reno “Let's call it a day.”"0x02C TargetMask <- Self0x033 Perform("(Report)"[0164], EnemyAttack)0x039 LocalVar:0000 <- FlagBit(4)0x040 LocalVar:0000.Flag:Unknown(00000001) <- 0 (Cure)0x04A LocalVar:0000.Flag:Enabled? <- 0 (Cure)0x054 LocalVar:0000.Flag:Unknown(00000004) <- 0 (Cure)0x05E LocalVar:0000.Flag:MainScriptActive <- 0 (Cure)0x068 LocalVar:0000 <- FlagBit(5)0x06F LocalVar:0000.Flag:Unknown(00000001) <- 0 (Cure)0x079 LocalVar:0000.Flag:Enabled? <- 0 (Cure)0x083 LocalVar:0000.Flag:Unknown(00000004) <- 0 (Cure)0x08D LocalVar:0000.Flag:MainScriptActive <- 0 (Cure)0x097 LocalVar:0000 <- FlagBit(6)0x09E LocalVar:0000.Flag:Unknown(00000001) <- 0 (Cure)0x0A8 LocalVar:0000.Flag:Enabled? <- 0 (Cure)0x0B2 LocalVar:0000.Flag:Unknown(00000004) <- 0 (Cure)0x0BC LocalVar:0000.Flag:MainScriptActive <- 0 (Cure)0x0C6SCRIPT END
From the look of it, it pushes FlagBits into the variable and then uses that to target them for disabling their Main script so that the battle ends when one 'dies'. Thing is, it looks like it starts from 4 and not 3. Not sure why, but I do know that player characters are 0, 1, and 2. I assumed 3 would be next. Try replacing the 3 with a 4 if it doesn't work. I remember reading that there's another actor, something to handle camera, but that's just a guess for why it jumps from 2 to 4 here (although Elena did originally have two placements on the field to handle her Row jumping; maybe it's a left-over?)
 
Last edited:
I'm using bit flags in my mods already (said it in my first post here), just asking how it relates to this battle script.

Actually, I may have made a mistake in testing "by bit" by using wrong ISO, it doesn't seem to function now. But the enemy ID one works fine though, I'll see if I can retune it by checking out what Safer Sephiroth does.

Edit: Ah, right, I'll try using bit 4 in a moment to see if that has any affect.

Edit 2: Excellent, I got the If statement working with this code (modified from Sega Chief's original code)

LocalVar:01A0 <- 5
LocalVar:0000 <- 80
TempGlobal <- &GlobalVar(0000)
If ( (GlobalAddress > 50) )
{
   LocalVar:0100 <-  (ActiveMask.EnemyID == 22)
   LocalVar:0100.HP <- LocalVar:01A0
   Display String: "test"
}
SCRIPT END
 
Last edited:
Status
Not open for further replies.
Back
Top