Battlescript variables... - Printable Version +- FF6 Hacking (https://www.ff6hacking.com/forums) +-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html) +--- Forum: Magitek Research Facility (https://www.ff6hacking.com/forums/forum-9.html) +--- Thread: Battlescript variables... (/thread-2778.html) |
RE: Battlescript variables... - Tenkarider - 12-26-2015 Quote:You probably mean "in the SNES memory", not "in the ROM file" right?I can't say to know how exactly SNES handles stuff, clearly the ram is not inside the rom, but now i understood that ram variables are in 7E0000 area of the rom, anyway... Quote:You could probably get away with using VAR004 - Brave New World used it for a few fights up until 1.7, and we never had any problems. That said, Four global variables plus one local variable should be plenty for anything you want to do. If you find you need more, try simplifying your logic.What i'm actually using the other variables for is something completely different, using them for enemy AI is the most trivial use... Too bad anyway, var 36 is bounded to slots, so i lost the chance to use them for something way more useful RE: Battlescript variables... - madsiur - 12-26-2015 (12-26-2015, 12:22 PM)Tenkarider Wrote: I can't say to know how exactly SNES handles stuff, clearly the ram is not inside the rom, but now i understood that ram variables are in 7E0000 area of the rom, anyway... You're using the wrong terminology. The SNES has a 128kb WRAM (banks $7E and $7F). It's not because the WRAM has a bank mapping that it is "in the ROM". If fact, the ROM image is limited to banks $C0-$FF and 40$-6F (and their shadows). SNES memory has offsets too! See: http://www.emulatronia.com/doctec/consolas/snes/SNESMem.txt and last post here: http://stackoverflow.com/questions/18970177/if-a-snes-has-128k-memory-and-in-assembly-you-can-reference-ffffff-addresses Edit: I knew some of this already but I had to google this to be able to understand it fully also... There's no shame! Edit2: One thing I'm not sure is when to specify or not the bank when writing to memory. Writing to $1132 (ex: STA $1132) will be equal to writing to $7E1132 (STA $7E1132) but in the game both formulations are used so the register (DB register?) holding the bank number must be set somewhere prior to one/multiple RAM writing. RE: Battlescript variables... - assassin - 12-26-2015 Quote:See: http://www.emulatronia.com/doctec/consolas/snes/SNESMem.txt more up-to-date version: http://www.romhacking.net/documents/173/ RE: Battlescript variables... - Tenkarider - 03-17-2016 @Everything: I'd PM this post if it was another thing, but since it involves battle variables it might be a good idea to leave here a better explaination on this argument... So, i was scrolling battle RAM map until i reached this area: Code: --------------------------------- I'm pretty sure you did an excellent job with RAM map new details posted in our wiki, so i'll assume that it's all correct and even updated info there's some extra or even different info, compared to previous information available in the site, so i'd like you answer some question to explain better the differences and new info: 1) Code: +$3EB9 abcdefgh Conditional Battle Flags (same as +$1DCE) Those new info say that var 09 and 0A are both used for the same thing and M-tek armor stuff is the same done with Sr.Behemoth? What is exactly battle index? i saw that you refered to var 36 in the same way... just a coincidence or it's really var 36 the battle index? anyway it's a very nice feature, i also verified values in CF3780,X and CF3782,X and they match with the 2 formations used in Sr.Behemoth fight Still i didn't find anything about M-tek armor... the point is also that i don't even know what's the X value, i mean from which value the game gets the X? how the bits of those variables are used for that feature... could you explain better this stuff, please? 2) Code: $3EBC ztrbemsg (same as $1DD1) I'm pretty sure the thing about emperor's banquet was never mentioned until now... so those 2 bits are used ONLY here? 3) Code: +$3ED4 Battle index well, aside what i mentioned before about this one... (var 36) some previous quote: Quote:Hmm, var 36 is stored at 7E/3DAC.so i searched that value on your RAM map and i found this: Code: +$3DAC Character/Monster Variable (bit 7 set after using seize) RE: Battlescript variables... - Everything - 03-21-2016 Great questions. I'm glad to see the RAM map is coming in handy. 1) From my notes, the MMMMMagic cutscene is controlled by bit 1 (0x02) of $3EBC / $1DD1. I don't think it has anything to do with $3EB9. $3EB9 is different. The "X" is the bit index. Check out the code at C2/30E8-C2/310D for more details. "Battle index" is just the battle number. I think FF3usME calls it the "Formation" Index. 2) The emperor's banquet thing is a little weird, and I think I remember that it doesn't really work correctly. I think it's supposed to work like this: After a battle with one of the soldiers, the screen is supposed to flash a different color depending on the outcome of the battle. Red if you died, blue if you ran out of time, green if you ran away. I didn't test this, but you can take a look at the event script at CC/886C for an example. 3) Yes, the monster variable is stored separately from the other variables. $3ED4 is the battle index and is not accessible as a battle variable. Also, the program sets bit 7 of the monster variable when a monster uses seize. This is hardcoded into the code for seize. If you look at the AI script for the tentacle battle, it checks bit 7 of the monster variable to determine if a character has been seized. RE: Battlescript variables... - Tenkarider - 03-22-2016 questions to your answers incoming: Quote:1) From my notes, the MMMMMagic cutscene is controlled by bit 1 (0x02) of $3EBC / $1DD1. I don't think it has anything From M-tek armor battlescript: Code: [script #-1] ; orig idx=66, "M-TekArmor", nb. bytes=24 M-tek armor deals with var 009, bit 1(3EB9) as well, i read somewhere that even bit 0 had something to do with it, but i can't remember exactly where, in the case. in any case in your RAM you consider both 3EB9 and 3EBA as a single variable that is composed from 2 bytes... about Sr.Behemoth: Code: [script #-1] ; orig idx=281, "SrBehemoth", nb. bytes=194 enough, so i wonder how the code at C2/30E8-C2/310D is called during the battle... besides those 2 var's values don't look like any formation number involved, probably they tell which element the program has to check in "Formations to Change From" list(yet i don't know where 3EB9 comes in play) considering all what i said above, the only thing that M-tek armor and Sr.Behemoth have in common is that they both call a battle event(not exactly, Sr.Behemoth calls an FA command instead) and since i don't get where C2/30E8 is called, i'm starting to think that it's called inside the event/FA command itself. I remember that there are certain battle commands that can be called only in some specific battle formation like final battle against kefka that makes scroll BG vertically; they also told me that FA command that makes move the party on the left side of the screen can be used only in Sr.Behemoth formation, otherwise the game will glitch... could that depend on var 3EB9-3EBA and the matching formation? Understanding how this thing actually works is very difficult but it would be a great discovery! if we collaborate here, we might find the answer. Quote:2) The emperor's banquet thing is a little weird, and I think I remember that it doesn't really work correctly. I saw the code, yeah it works in the way you said, but it's actually not a matter, as far those battle variable bits values are changed according to the outcome of the battle: even if they are used before the banquet, they can still be used anywhere. Quote:3) Yes, the monster variable is stored separately from the other variables. $3ED4 is the battle index and is not well, this is a nice discovery! i didn't knew there was a way to know if seize was used in battle! just saying... if i set bit 7 manually even if i never use Seize, it's not like it might happen something weird, right? RE: Battlescript variables... - Everything - 03-22-2016 The subroutine at C2/30E8 gets called at the beginning of a battle, and then again if the battle changes (like SrBehemoth or final Kefka). Maybe if you kill the SrBehemoth and then die during the GtBehemoth, it will save your progress so that you will only face the GtBehemoth the second time around. That's my guess anyway. I've never tried it. Or maybe the whole $3EB9 thing is redundant. You're right, the M-TekArmor battle does also set one of the bits in $3EB9. I don't know why. It seems like it wouldn't have any effect. I don't think you will have any problems if you use bit 7 of the monster variable, as long as you are not using Seize. RE: Battlescript variables... - Tenkarider - 03-23-2016 100% sure that won't be that the case in case of lose against Sr.Behemoth(both the monsters are Sr.Behemoth) that would make sense if it was something like the final battle, despite it's totally hardcoded that thing(after you defeat face and the 2 arms there will be a BG shift and formation change as well, but there's no formation change command in any script of the battle) One way to solve this damn mistery would be knowing where's the code which describes what happens when you use FA ai command that makes move the whole party on the left side of the screen, in that location it might be possible to discover why the game crushes when it's used outside Sr.Behemoth fight |