Users browsing this thread: 1 Guest(s)
Conditional Battle Palettes
05-30-2013, 10:06 PM
Per the request of Gi Nattak, here is how to add a condition to setting your battle palettes (in this case, Kefka in the WoR and Edgar as Gerad).
All you need is 35 free bytes of code.
Then you just have to call this instead of simply calling the battle palette data from the table.
Replace:
with this:
That's all there is to it. You can set as many conditionals as you want, based on any data in the RAM, create a separate table for your characters to look from, or statically set each one with only minor changes to the code. If anyone wants a specific condition, let me know, but I would encourage you to try tweaking the code first yourself.
It's good to be ASM-ing again.
All you need is 35 free bytes of code.
Code:
XX/0000: AD941E LDA $1E94 (load event bits)
XX/0003: 2910 AND #$10 (in WoR?)
XX/0005: F017 BEQ $001E (Branch if it isn't)
XX/0007: E01500 CPX #$0015 (is this Kefka?)
XX/000A: F00F BEQ $001C (Branch if it is)
XX/000C: E00400 CPX #$0004 (is this Edgar?)
XX/000F: D00D BNE $001E (Branch if it isn't)
XX/0012: AD981E LDA $1E94 (load event bits)
XX/0014: 2940 AND #$40 (have we recruited Edgar?)
XX/0016: D006 BNE $000E (Branch if not)
XX/0018: A901 LDA #$04 (Set palette ID to 01)
XX/001A: 6B RTL
XX/001B: A901 LDA #$01 (Set palette ID to 01)
XX/001D: 6B RTL
XX/001E: BF2BCEC2 LDA $C2CE2B,X (Pull palette ID from table in C2 for sprite X)
XX/0022: 6B RTL
Then you just have to call this instead of simply calling the battle palette data from the table.
Replace:
Code:
C1/3E20: BF2BCEC2 LDA $C2CE2B,X (Pull palette ID from table in C2 for sprite X)
with this:
Code:
C1/3E20: 22XXXXXX JSR $XXXXXX (Where $XX/XXXX is the location of the code we just entered)
That's all there is to it. You can set as many conditionals as you want, based on any data in the RAM, create a separate table for your characters to look from, or statically set each one with only minor changes to the code. If anyone wants a specific condition, let me know, but I would encourage you to try tweaking the code first yourself.
It's good to be ASM-ing again.
Let's Hack FF6 Stream: https://www.twitch.tv/b_run_
FFVI - Children of Vector: http://www.ff6hacking.com/forums/showthr...p?tid=2386
Monster AI Upgrade Patch: http://www.ff6hacking.com/forums/showthr...p?tid=2673
MMMMMagic 2.0: http://www.ff6hacking.com/forums/showthr...p?tid=3330
Woo-hoo! Thank you very much Edrin! I will be trying this out tonight. =)
One other place I wanted a sprite battle palette change, would be for Edgar in the battle with the tentacles in the WoR, so he would remain in his 'Gerad' palette for the battle then afterwords switched back to his original one. Seems like using this code but for Edgar and using different event bits would work for that as well eh?
One other place I wanted a sprite battle palette change, would be for Edgar in the battle with the tentacles in the WoR, so he would remain in his 'Gerad' palette for the battle then afterwords switched back to his original one. Seems like using this code but for Edgar and using different event bits would work for that as well eh?
We are born, live, die and then do the same thing over again.
I would assume it would be trickier for edgar...on second thought, no...as long as you find an event bit related an event with Gerad in it, it should be fine and adding a couple more lines of code.
Great job, Edrin :p
Great job, Edrin :p
05-31-2013, 09:59 AM
updated for Kefka and Gerad.
Let's Hack FF6 Stream: https://www.twitch.tv/b_run_
FFVI - Children of Vector: http://www.ff6hacking.com/forums/showthr...p?tid=2386
Monster AI Upgrade Patch: http://www.ff6hacking.com/forums/showthr...p?tid=2673
MMMMMagic 2.0: http://www.ff6hacking.com/forums/showthr...p?tid=3330
I finally got around to testing this out in my hack, and I realize I must have forgotten to say that I need Kefka to be on palette 1 and Gerad palette 4. >_< I see it has them using the same palette here for the conditional. I hope there is an easy tweak to the code that can be done to have it like that instead? I tried adding an A901 under the 'is this kefka' line, but it still read the palette code after it which I changed to A904 for Gerad. If it matters any, Kefka's palette change happens before Gerads.
Besides that it works like a charm!
Besides that it works like a charm!
We are born, live, die and then do the same thing over again.
06-29-2013, 02:58 AM
nice job
that'll be really interesting especially with kefka man hell yeah its gonna be great
that'll be really interesting especially with kefka man hell yeah its gonna be great
"Sometimes ninjas do wrong to each other, and in dat way the force of tha earf' comes around da moon - and at that presence, da dirt, it overshadows the grass, so you're like, I can't cut dis grass, there's no sun comin' through. So in order to enable each other the two fruits have to look each other in da eye and understand we can only be right, as da ripe is wrong, you know what I mean?"
-HNIC
06-29-2013, 07:30 AM
Fixed, I just did it by logic, I didn't plug it back in and test but it should work. If not let me know.
Let's Hack FF6 Stream: https://www.twitch.tv/b_run_
FFVI - Children of Vector: http://www.ff6hacking.com/forums/showthr...p?tid=2386
Monster AI Upgrade Patch: http://www.ff6hacking.com/forums/showthr...p?tid=2673
MMMMMagic 2.0: http://www.ff6hacking.com/forums/showthr...p?tid=3330
06-29-2013, 02:49 PM
Works perfect, thank you very much sir! =)
I notice one little thing here to edit you may have forgotten to change:
XX/0018: A901 LDA #$04 (Set palette ID to 01)
Should be listed as A904 (Set palette ID to 04)
Thanks to the correct LDA #$04 though I was able to tell right away XD
I notice one little thing here to edit you may have forgotten to change:
XX/0018: A901 LDA #$04 (Set palette ID to 01)
Should be listed as A904 (Set palette ID to 04)
Thanks to the correct LDA #$04 though I was able to tell right away XD
We are born, live, die and then do the same thing over again.
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)