Users browsing this thread: 1 Guest(s)
Espers teaching Stat gains

#1
Posts: 19
Threads: 9
Thanks Received: 4
Thanks Given: 15
Joined: May 2019
Reputation: 2
Status
None
Hi again everyone! I've got a live one for you here. Been staring at it for a couple of days, but my coding level is too low to get there. I know just enough about hacking this game to dive headfirst into the wrong thing for a few hours and get nowhere. Lol. 

I'm working on a hack in which I'd like Espers to do something new. Instead of teaching magic, I'd like for them to permanently increase a given stat, i.e. Ramuh teaches Stamina+1....x10, Stamina+3....x2, etc. No magic. Just stat gains. Everything else about the process can stay the same: Growth rate, AP gain from battles, etc. Physically increasing the stat shouldn't be too difficult. Espers already give you stat boosts at level-up (at C26198, with pointers from C2614E). I can hijack that code to do all of the math for me. The issue is getting the game to recognize this new set of instructions. How can I accomplish this? 

First, I looked at C2 in the code where we progress towards learning spells taught by Espers (C2602A-C2606C), but nothing there looked particularly useful. Then, I looked at the Esper data, but they just have one byte of info for each spell slot corresponding to the spell index. I thought about creating my own index of stat gains similar to the spell index where 00 would be Stamina+1 instead of Fire, etc. and this seems promising, but how can I get the game to recognize that list as the target? I can't find any pointers that associate Espers with spells. I tell ya, it's tricky!

Any suggestions? All help is appreciated.
  Find
Quote  

#2
Posts: 89
Threads: 11
Thanks Received: 17
Thanks Given: 55
Joined: Dec 2015
Reputation: 3
Status
Debrave
(09-09-2020, 04:28 PM)Morendo Wrote: Hi again everyone! I've got a live one for you here. Been staring at it for a couple of days, but my coding level is too low to get there. I know just enough about hacking this game to dive headfirst into the wrong thing for a few hours and get nowhere. Lol. 

I'm working on a hack in which I'd like Espers to do something new. Instead of teaching magic, I'd like for them to permanently increase a given stat, i.e. Ramuh teaches Stamina+1....x10, Stamina+3....x2, etc. No magic. Just stat gains. Everything else about the process can stay the same: Growth rate, AP gain from battles, etc. Physically increasing the stat shouldn't be too difficult. Espers already give you stat boosts at level-up (at C26198, with pointers from C2614E). I can hijack that code to do all of the math for me. The issue is getting the game to recognize this new set of instructions. How can I accomplish this? 

First, I looked at C2 in the code where we progress towards learning spells taught by Espers (C2602A-C2606C), but nothing there looked particularly useful. Then, I looked at the Esper data, but they just have one byte of info for each spell slot corresponding to the spell index. I thought about creating my own index of stat gains similar to the spell index where 00 would be Stamina+1 instead of Fire, etc. and this seems promising, but how can I get the game to recognize that list as the target? I can't find any pointers that associate Espers with spells. I tell ya, it's tricky!

Any suggestions? All help is appreciated.

I'm surprised no one has replied to this thread until now.

Unfortunately, you won't be able to hijack the existing code in order to do what you seek. Stat gains are limited to one at a time and although they can stack, the code is designed to increase one attribute per character upon levelling up. By contrast the varying nested subroutines concerning learning a spell are designed to work with the spell index to first skip a spell if it is learned, then mark a spell as just learned and to mark the spell as unhidden/accessible. There is no mechanism for learning a spell over and over again, so the subroutine you would eventually create would have to be completely new.

Creating your own stat gain index is an interesting work around but you would have to reconfigure every single loop concerning learning magic from Espers to account for that index. At the bare minimum you would have to replace the called subroutine at C2/6020. That still doesn't address certain problems such as how to apply gains of multiple types.

Thinking about this made my head hurt. That's probably because I'm at too low of a coding level myself to explain.
  Find
Quote  

#3
Posts: 19
Threads: 9
Thanks Received: 4
Thanks Given: 15
Joined: May 2019
Reputation: 2
Status
None
Cool! I was hoping somebody would respond. Thanks! I think what might be happening is that I know just barely enough about romhacking this game to misunderstand everything about romhacking this game. LOL.

Quote:Stat gains are limited to one at a time and although they can stack, the code is designed to increase one attribute per character upon levelling up. By contrast the varying nested subroutines concerning learning a spell are designed to work with the spell index to first skip a spell if it is learned, then mark a spell as just learned and to mark the spell as unhidden/accessible. There is no mechanism for learning a spell over and over again, so the subroutine you would eventually create would have to be completely new.

Oh, I didn't have any interest in increasing an attribute multiple times or learning the attribute over and over again. It would work exactly the same as learning spells. Once you've gotten Shiva's "Speed+2...x4" or whatever the skill is to 100%, that's it. It's at 100%. You'd get Speed+2 permanently, but it wouldn't start over.
Regardless, you're still totally right that I'd need to build a new subroutine. The tantalizing part is that so much of the existing code is already doing what I want! The only part I'm looking to change is the result. If I better understood the moment the code says: "Alright. They got to 100%. Go flick the on/off switch in the RAM to make that spell available", I could potentially intercept it and push it to a new subroutine that goes to the stat gain formula instead. At the moment, I don't understand how to do that. I mean, aren't the percentage points just a value stored in the RAM that's counting to 100? How "tied-in" is that number to the spell index?

To put it in FF terms, my coding level is also "too weak to be worthwhile". I suppose I'm not doing a great job of explaining my confusion.

Quote:Creating your own stat gain index is an interesting work around but you would have to reconfigure every single loop concerning learning magic from Espers to account for that index. 

This was my idea for a second option if the above "intercept the moment of spell learning" was functionally impossible or just straight-up dumb. We know the Espers have spell index values in the Esper data at $D86E00. I thought maybe creating a new index for stat gains (a ton of additional work) might be a good Plan B.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite