Users browsing this thread: 1 Guest(s)
Gaining a greater health from Potions?

#11
Posts: 149
Threads: 21
Thanks Received: 40
Thanks Given: 3
Joined: Dec 2013
Reputation: 9
Status
Auto-life
For items, the value of healing is based on the “max out” flag with the “affects HP” or “affects MP” flags.

If the “max out” flag is set, the value will be a fraction of max HP or max MP defined by the item power. The formula is X/16, where X is between 1 and 16. The value of 16 is 16/16 or 100%, the value of 8 is 8/16 or 50%, the value of 4 is 4/16 or 25%, etc.

If “max out” flag isn't set, it will use the value defined by the item power. Unfortunately, it is only one byte and can't store values beyond 255. If you want fixed values beyond 255 which aren't related to max HP or max MP, you will need to change the code, assembly style.
  Find
Quote  

#12
Posts: 378
Threads: 94
Thanks Received: 17
Thanks Given: 26
Joined: Jul 2013
Reputation: 11
Status
Charmed
Thanks for the info. So I want to do the second option of changing the code, assembly style. Assuming it's not a work of genious to make it work, of course. I just need instructions on how to do it, and I'll be all set.


Step forward, spriters! We are also responsible to make hacks look new and fresh, we are no less important than code or ASM hackers! CHARGE!!
Quote  

#13
Posts: 149
Threads: 21
Thanks Received: 40
Thanks Given: 3
Joined: Dec 2013
Reputation: 9
Status
Auto-life
The item action is internally considered an attack and it has the special effect variable $11A9. The relatively easy way is to recycle one of the items special effects for a damage multiplier.

I made a patch that exchanges the super ball special effect for the multiplier. In ff3usme, choose the super ball effect and the damage is multiplied by 40. Please, make sure that the “max out” flag isn't set. You also need a rom with a header. You can download the patch here .

For reference, the code is:
Code:
== pointers ==

C2/4375 2C 40           Super Ball pointer
C2/3E61 8C 38           Super Ball pointer (null)

== super ball: piece 1 ==
available: C2/402C - C2/4036

C2/402C 08              PHP
C2/402D E2 20           SEP #$20        set A as 8-bit
C2/402F AD A6 11        LDA $11A6       spell power
C2/4032 EB              XBA
C2/4033 4C B8 3D        JMP $3DB8

== super ball: piece 2 ==
available: C2/3DB8 - C2/3DC4

C2/3DB8 A9 28           LDA #$28        number to multiply (40 em decimal)
C2/3DBA 20 81 47        JSR $4781       multiply A * B
C2/3DBD C2 20           REP #$20        set A as 16-bit
C2/3DBF 8D B0 11        STA $11B0       store multiplied number
C2/3DC2 28              PLP
C2/3DC3 60              RTS

If you want to preserve the super ball special effect, you need to relocate the code and find a new pointer for it in the C2/42E1 or C2/3DCD table of pointers. To be honest, I don't understand why there are two tables of pointers for special effects. I generally choose one of the tables and nullify the pointer of the other table with an alone RTS pointer.
  Find
Quote  

#14
Posts: 378
Threads: 94
Thanks Received: 17
Thanks Given: 26
Joined: Jul 2013
Reputation: 11
Status
Charmed
Thanks, I guess that'll do. I couldn't care less about the superball thingy Tongue so anyway, say I want the multiplier to be 10 instead of 40. How could I do that?

Is no problem if you can't, because 1000hp from the hi-potion is a bit excessive but it'll do.


Step forward, spriters! We are also responsible to make hacks look new and fresh, we are no less important than code or ASM hackers! CHARGE!!
Quote  

#15
Posts: 3,966
Threads: 279
Thanks Received: 233
Thanks Given: 56
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(06-05-2014, 10:56 AM)Kugawattan Wrote: say I want the multiplier to be 10 instead of 40. How could I do that?

Change this line of code:

Code:
C2/3DB8 A9 0A           LDA #$0A        number to multiply (10 em decimal)
  Find
Quote  

#16
Posts: 378
Threads: 94
Thanks Received: 17
Thanks Given: 26
Joined: Jul 2013
Reputation: 11
Status
Charmed
Thank you very much, but either I'm going blind or I've lost total understanding on this thing, but I can't find the A9 28 to change to A9 0A, I mean, C2/3DB8 translates to 0023FB8 on the search thingy right? Because this is what I get.

[Image: damnit_by_kugawattan-d7l4w71.png]


...no sign of A9 or 0A.


Step forward, spriters! We are also responsible to make hacks look new and fresh, we are no less important than code or ASM hackers! CHARGE!!
Quote  

#17
Posts: 149
Threads: 21
Thanks Received: 40
Thanks Given: 3
Joined: Dec 2013
Reputation: 9
Status
Auto-life
You can customize the final value with ff3usme. You only need to change the item power and select the super ball effect. The final value will be the item power * 40. If the item power is 25, the final value will be 25 * 40 = 1000. If the item power is 15, the final value is 15 * 40 = 600, etc.

You can change the multiplier as Madsiur said. I don't know your hex editor but probably the issue may be a wrong address conversion. I use the SNES address convention and you editor may use the absolute byte offset of the file. You can try a tool (like Lunar Address) to do the conversion. Or you can search for the patch bytes with the hex editor search.
  Find
Quote  

#18
Posts: 378
Threads: 94
Thanks Received: 17
Thanks Given: 26
Joined: Jul 2013
Reputation: 11
Status
Charmed
I use WindHex32, and to make sure I hadn't done anything to it, like somehow changing its properties or something, I re-downloaded the thing, and I still can't find the offset :/

Also by the way, I think I found some kinda glitch, if you use the hi-potion with the modded superball effect to a target that's dead (by selecting it when target was alive but is killed after that), it apparently forgets its function and instead does the superball animation against a enemy who is then healed for an absurd amount for early game (I had it heal 4000hp in the Vargas Battle). I wonder how could I fix this as well.


Step forward, spriters! We are also responsible to make hacks look new and fresh, we are no less important than code or ASM hackers! CHARGE!!
Quote  

#19
Posts: 149
Threads: 21
Thanks Received: 40
Thanks Given: 3
Joined: Dec 2013
Reputation: 9
Status
Auto-life
I tested the patch and I couldn't recreate the error. If the target is alive, it does the correct healing. If the target is dead, it doesn't heal but it doesn't trigger the super ball animation or another bug. If the target is alive when the item is selected but dies before the item is used, it doesn't heal but doesn't trigger a bug either. Can you give more information?

The patch is for a rom with a header, english, version 1.0. Please, check if your rom is the correct one. The version 1.1 has smaller code differences and may not work correctly.
  Find
Quote  

#20
Posts: 378
Threads: 94
Thanks Received: 17
Thanks Given: 26
Joined: Jul 2013
Reputation: 11
Status
Charmed
Life 2!

So after I got my clean rom applied the patch and noticed it worked correctly, thank you very much, I've found later a small (big) issue: It only heals you the multiplied value IN battle. If you use the potion in the menus, it doesn't give you the multiplied value, which is a measly amount making the items rather useless outside of a battle.

I've no idea how to work around this D:


Step forward, spriters! We are also responsible to make hacks look new and fresh, we are no less important than code or ASM hackers! CHARGE!!
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite