Author Topic: HP bonus  (Read 249 times)

IHBP

  • Architect of Kajar
  • Guardian (+100)
  • *
  • Posts: 158
    • View Profile
HP bonus
« on: March 21, 2019, 10:20:20 am »
Tried adding 100 HP to Crono through an event following the template for adding the other stats, I enclosed a picture of  the setup I used.

It added something like ~92 HP and changed his accessory,  what would the proper setup look like?

Mauron

  • Guru of Reason
  • Magical Dreamer (+1250)
  • *
  • Posts: 1332
  • Nu-chan
    • View Profile
    • Maurtopia
Re: HP bonus
« Reply #1 on: March 21, 2019, 03:17:11 pm »
I'll have to look into the exact details of HP storing later, but 2A of character data is definitely the accessory. You'll also want to make sure all copied values of HP are done with two bytes. MP is stored as two byte, but because of the 99 cap, it never uses the second byte.

IHBP

  • Architect of Kajar
  • Guardian (+100)
  • *
  • Posts: 158
    • View Profile
Re: HP bonus
« Reply #2 on: March 21, 2019, 05:02:10 pm »
So any command that allows for two bytes would need to be switched to two bytes I assume.

For the line that says if >64 =64 it should be 03E7 right?

Mauron

  • Guru of Reason
  • Magical Dreamer (+1250)
  • *
  • Posts: 1332
  • Nu-chan
    • View Profile
    • Maurtopia
Re: HP bonus
« Reply #3 on: March 21, 2019, 05:17:18 pm »
Yeah, that's the magic number. You can also give an equivalent bonus to current HP.

There should be two byte versions of each command you need.

IHBP

  • Architect of Kajar
  • Guardian (+100)
  • *
  • Posts: 158
    • View Profile
Re: HP bonus
« Reply #4 on: March 21, 2019, 07:33:15 pm »
Ok looks better, does HP have a second address that needs to be adjusted like all the other states do? I don't actually understand why the other stats have the second address.

Mauron

  • Guru of Reason
  • Magical Dreamer (+1250)
  • *
  • Posts: 1332
  • Nu-chan
    • View Profile
    • Maurtopia
Re: HP bonus
« Reply #5 on: March 22, 2019, 02:30:24 am »
I'm not sure if HP does or not, but I'd lean towards yes because of the earrings.

Speed doesn't really need a second address, maybe at one point early on they were considering having speed grow on a 1-99 scale. As for the rest, the stats are recalculated every time you level. You know that formula I've got listed in Warrior Workshop? Growth * Previous Level + Growth 2. The growth 2 value is what you write to for permanent stat changes.

HP and MP have a simpler system, where you get a fixed amount in up to four level ranges. They wouldn't need fresh calculations, but I need to see how the game gives bonus HP from the earrings. More importantly, I need to see how the game removes bonus HP from the earrings.

I made a mess of my files recently, so I won't be able to get to this until that's sorted. For a quick test, give yourself bonus HP at level 1, then level up and equip/unequip an earring. If your HP stays correct through the process, it's good, but if something screws up there's another address I need to find.

IHBP

  • Architect of Kajar
  • Guardian (+100)
  • *
  • Posts: 158
    • View Profile
Re: HP bonus
« Reply #6 on: March 23, 2019, 12:10:56 am »
Altering only the address 7E2605 I ran a thorough test, added 100 HP by event (successful) equipped a Gold Earring (worked) gained a level and unequipped  the earring and it all worked exactly as it should.

Mauron

  • Guru of Reason
  • Magical Dreamer (+1250)
  • *
  • Posts: 1332
  • Nu-chan
    • View Profile
    • Maurtopia
Re: HP bonus
« Reply #7 on: March 23, 2019, 01:42:43 pm »
Then it sounds like you don't need a second address for HP or MP.