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

  • Thread starter Thread starter Roden
  • Start date Start date
Status
Not open for further replies.
That'd be useful, would be able to coordinate with other mods better and see what's 'safe' too. Would it be like a spreadsheet or something?
 
I'll sort something.  A lot of people have started mods without fully realizing the implications of the shared bytes.  The Nightmare mod I think escaped an issue through pure luck.
 
In fact, maybe this thread needs stickying somewhere under "Read this before attempting to edit field script vars"  or something.
Good idea, but may I suggest a more simpler title? Rename the thread to something like "variables safe to use in your savemap, read before editing" or something. I tried searching google but couldn't find anything so I made this thread. :)
 
@ Roden what DLPB said!

@DLBP thanks for answering that when i was unable to get it done :D
 
5/6 are temporary vars in game and not saved.  They reset to 0 every time you enter new field.
Actually this one seems very handy for certain rooms - do you know which ones are unused (or if someone has documented it?)? It seems a better alternative than trying to set a variable from other banks to 0 whenever you exit a room :P
 
They are all unused... since they reset to 0 every time.  To avoid conflicts you should check the script with Makou.
 
Haha, ah right.. they're field-only vars, that's cool! I just wasn't sure if something else was writing to it outside the script. Good to know :)
 
I'm not sure...  it could and probably should be that world map can use it too.  But it wouldn't matter since vars are returned to zero every time you enter a new field.
 
They are all unused... since they reset to 0 every time.  To avoid conflicts you should check the script with Makou.
Bank 5 gets used in basically every question in the game to short-store the answer. You obviously can't leave the field while you're answering a question dialogue.
I don't remember if I've seen bank 6 used but I believe so, again, for temporary stuff just for that field.
 
That's not a bank.  A field var ID is what you mean.  5 and 6 are both the same temporary bank (or let's just say using same 256 bytes). See the previous posts.

Whenever you enter a new field, the entire bank is reset to 0 (256 bytes are reset to 0).

If you look at the savemap, banks 1-5 are listed there since they are the only ones saved.  As you noted, [5] is usually used for questions, since it is a one-byte write var (and no option cursor in the game requires over 256 responses. If it did, you'd see the 2-byte [6] location used as well).  One-byte writes are far more frequent than two, hence the frequency of [5].

Hopefully, Mystere will agree with my solution to this nonsense, and in the future, we'll have BANKS 0-6 referenced in Makou Reactor only.
 
Last edited:
Technically I meant that Bank 5 is used since Var 5:10 (usually 5:10 or 5:8 or something like that, you know what I mean) is used in questions.
 
I know what you mean, but Bank 5 isn't the temporary bank.  Bank 5 is Field [7] and [15].  Temp bank (Field [5] and [6]) doesn't have an ID on the savemap (which we named anyway, let's face it).  Temp bank should probably be called Bank 0 or Bank 6 for clarity (or just Temp Bank).
 
Last edited:
DLPB: Do you think it would be possible to set a variable in the field that's used in a battle? For example, the next enemy's HP or something. Probably a long shot, but you never know :)
 
The battle script can set bytes in Bank 1.  NFITC knows about battle script. :)
 
@Roden
This thread might be handy: https://www.ff7catalog.com/threads/10579/

Sithlord and NFITC1 recommended using Battle Love Points, which function but aren't actually used for anything (it's used by character AI which can be edited/removed in Wall Market). If they can't store a big number for an enemy's HP value, then you could instead have the HP values/HP multiplier stored in pre-battle AI with the variable triggering which value gets pushed into the monster's actual HP before the fight starts.
 
@Roden
This thread might be handy: https://www.ff7catalog.com/threads/10579/

Sithlord and NFITC1 recommended using Battle Love Points, which function but aren't actually used for anything (it's used by character AI which can be edited/removed in Wall Market). If they can't store a big number for an enemy's HP value, then you could instead have the HP values/HP multiplier stored in pre-battle AI with the variable triggering which value gets pushed into the monster's actual HP before the fight starts.
Very interesting, thanks. Battle love points, hey, never knew that.. kind of shows how ambitious FF7 developers were about this dating game. I'm with you about not editing scene.bin (especially since I'm developing only for PSX), did you find a way to effectively have any affect on the battles through field vars only?

Is pre-battle/post-battle AI editable in Makou Reactor/field? Or only Proud Clod? I don't really like using Proud Clod as its not 100% compatible with Japanese versions of game :(
 
Makou Reactor is for field edits.  Proud Clod is for battle.  There's no way around that :)
 
Like Dan says, I'm afraid you might be stuck; as far as I know, Proud Clod is the only tool capable of editing enemy AI (the other editor, Hojo, can't do it) and it can't be done through Makou.

Is editing the Kernel, as in the character AI, an option? There might be a round-about way to make this work by having a routine where the player character pre-battle AI checks for a specific enemy ID instead and, if true, adjusts that enemy's HP based on the aforementioned variables. Cloud would be the best bet as he's usually in the party. You could also put in several checks if it needs to happen with a few different enemies, but I'm not sure how size affects the kernel and how strict it is for PSX.

I have a working prototype for using these variables in fights, I'll dig it up if you want to have a look? It could be copied out and placed in the PSX kernel (Wall Market doesn't have a copy-paste function for it's AI editing if I remember right). But I'd maybe get some opinions about Kernel size first if you haven't already; I've not worked with the PS1 files but what I know about it is that changes in file size can derail the game. Also, if the kernel falls 'out of synch' with the scene.bin then problems like wrong encounters being referenced will start to appear.
 
Like Dan says, I'm afraid you might be stuck; as far as I know, Proud Clod is the only tool capable of editing enemy AI (the other editor, Hojo, can't do it) and it can't be done through Makou.

Is editing the Kernel, as in the character AI, an option? There might be a round-about way to make this work by having a routine where the player character pre-battle AI checks for a specific enemy ID instead and, if true, adjusts that enemy's HP based on the aforementioned variables. Cloud would be the best bet as he's usually in the party. You could also put in several checks if it needs to happen with a few different enemies, but I'm not sure how size affects the kernel and how strict it is for PSX.

I have a working prototype for using these variables in fights, I'll dig it up if you want to have a look? It could be copied out and placed in the PSX kernel (Wall Market doesn't have a copy-paste function for it's AI editing if I remember right). But I'd maybe get some opinions about Kernel size first if you haven't already; I've not worked with the PS1 files but what I know about it is that changes in file size can derail the game. Also, if the kernel falls 'out of synch' with the scene.bin then problems like wrong encounters being referenced will start to appear.
Actually, editing the Kernel might be fine, good that you remembered - Wallmarket works somewhat so far with my Japanese versions, so I'd definitely be interested in that prototype. Though just having a look at the character AI tab in Wall Market now (under Initial Data), it appears only Barret, Tifa, Yuffie have any data for "pre-battle", Cloud has none, and if you double click it (even in the US version) it just gives me "System.ArgumentOutOfRangeException: Index was out of range. ", though Barret's pre-battle AI seems perfectly editable (not that I understand whats it doing yet). How did you add stuff to Cloud's pre-battle without crashing it?
 
Actually, I take that back, even the other character's AI is extremely buggy (typing anything brings up .net framework error - even though I've verified .net is perfectly fine with microsoft developer tool). Is it problem with PSX kernel?
 
Status
Not open for further replies.
Back
Top