Users browsing this thread: 1 Guest(s)
Order in menu

#1
Posts: 50
Threads: 15
Thanks Received: 6
Thanks Given: 10
Joined: Aug 2013
Reputation: 2
Status
None
In my hack I put all of the Rages in alphabetical order. This is quite easy because of how Rages are displayed in the menu.  I was wondering, could it be done just as easily for characters (like in the shop menu or party select menu), spells, and Espers? Maybe I missed it, but I wasn't able to find a document saying where this stuff is located in the ROM.

If this would require an extensive rewrite of the menu functions, I'll pass. I've just always been a bit bugged by the order some things are listed in that don't make intuitive sense (at least not to me).

Thanks!
Quote  

#2
Posts: 175
Threads: 11
Thanks Received: 10
Thanks Given: 8
Joined: May 2013
Reputation: 13
Status
Well-Fed
Spells would be relatively easy -- just move the data around in usME. It'll take some time, but it's pretty straightforward. Similarly for espers -- move the data into alphabetical order -- except you'll also need to do some event editing so that events which give you espers still give you the right ones.

Characters are more complicated, because you can rename them (unless you're taking that function out of your hack?) -- you can't just reorder the data (which would be a massive undertaking ANYWAY, as you'd have to alter every single reference to every character in every event that references a character), because you don't know what alphabetical order is going to be. That would definitely require more extensive menu hacking, especially as, so far as I know, those currently work based off of character ID.

ETA: Oh, and for spells, that's with the caveat that they'd only be alphabetical based on the default sorting; if someone changes the spell order in config, that goes right out the window. But you could always disable that menu option?


Current Project: FF6: Tensei | Discord ID: TristanGrayse
  Find
Quote  

#3
Posts: 763
Threads: 83
Thanks Received: 55
Thanks Given: 7
Joined: Apr 2015
Reputation: 22
Status
Obliviscence
(12-31-2016, 09:36 PM)GrayShadows Wrote: Spells would be relatively easy -- just move the data around in usME. It'll take some time, but it's pretty straightforward. Similarly for espers -- move the data into alphabetical order -- except you'll also need to do some event editing so that events which give you espers still give you the right ones.

Characters are more complicated, because you can rename them (unless you're taking that function out of your hack?) -- you can't just reorder the data (which would be a massive undertaking ANYWAY, as you'd have to alter every single reference to every character in every event that references a character), because you don't know what alphabetical order is going to be. That would definitely require more extensive menu hacking, especially as, so far as I know, those currently work based off of character ID.

ETA: Oh, and for spells, that's with the caveat that they'd only be alphabetical based on the default sorting; if someone changes the spell order in config, that goes right out the window. But you could always disable that menu option?

For spells you'd also have to rewrite the sorting function entirely since you would end up with black/white/gray magic all mixed around together and the current function doesn't support any spells outside of the blocks. Shameless plug: with MMMMMagic 2.0 you can resort and reorder much more easily, but it'd still take some data minpulation, just a LOT less, and no code rewrites.
  Find
Quote  

#4
Posts: 50
Threads: 15
Thanks Received: 6
Thanks Given: 10
Joined: Aug 2013
Reputation: 2
Status
None
For spells: doing this by essentially recreating the spells in order would not be a good solution. All I want to do is change the way the spell menu displays--that should not entail remaking every spell. If I can put the Rages alphabetically without having to redo them all, that should be possible for spells, too. I just can't find the place in the ROM where the spell display list is setup, and I'm hoping somebody knows where it is.

For characters: maybe I'm not being clear with my comment about character listing. There would be no need to reorder all of the character data and change every reference in the scene data. Terra would still be 00, Celes would still be 06, etc. All I'd want to change is that, when the shop or character select screens come up, rather than having the characters listed 00 01 02 03 04 05 06, etc. I could put them in the order they join you. So ONLY those two functions would be changed, so that the characters are displayed in this order: 00 01 04 05 06 03 02 0B 09 0A 07 08 0C 0D.

Thanks!
Quote  

#5
Posts: 175
Threads: 11
Thanks Received: 10
Thanks Given: 8
Joined: May 2013
Reputation: 13
Status
Well-Fed
I admittedly haven't dealt with rages at all, so I guess I'm working from a more limited understanding of the kind of work you've already done.

In C3, spell names are drawn with a function starting at C3/4F87, and there's a function at C3/4F61 that appears to handle B/W/G ordering. You could proooooobably write a table with your preferred spell-order-by-ID for it to work from, but I haven't dived very far into these functions yet so I'm not 100% sure yet where/when it's grabbing the spell ID.

It gets a little more complicated in C2, because of the way the games builds in-battle spell lists -- first it builds a list of all spells known by all characters. There is some leeway here; because the game removes rows that don't have any spells known (there's a glitch here because it checks three spells at a time, not two, because the JP version had three spells per row), it stores the spell ID itself. Everything here starts at C2/5551, where it builds the in-battle esper/magic/lore list that then gets refined by character.

Espers in C3 are at /5486. As I understand it, they're stored similarly to how rages are stored, so you can probably adapt whatever method you have there. You may need to be careful with it, though, so that you can still open up individual espers to look at their spells-taught list?

I'm not sure about characters for shop/party menu; I didn't see anything with a quick search for $1600 (where character IDs are stored); try doing a search for the RAM address where characters-recruited is stored? I don't know that off-hand and it's not in the RAM map I have.

B-Run: Yeah, resorting manually would only work with default sorting, so it's not a perfect solution, but if you did go this route, the standard B/G/W sorting (... I'm pretty sure that's the default? XD I haven't looked at that in a while since I'm messing around with it COMPLETELY for Tensei) should give you the list of spells, 1-54, in the order they exist in the ROM data. You shouldn't need to touch the code for it to work.


Current Project: FF6: Tensei | Discord ID: TristanGrayse
  Find
Quote  

#6
Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
reply as to whether you want Black/White/Gray mixed together or not.  you still haven't specified.

eh, i'll assume you don't want them mixed.  try this for Bank C2:

1) make a 54-byte ROM table of each Magic spell ID's desired position within its H/A/E category, with 0 being the first position.  it can go in any bank.

2)

Code:
hirom
header   ; comment out as needed

org $C255C1
JSR extra_attack
nop

org $C255CB
JSR extra_effect
nop

org $C255D5
JSR extra_healing
nop

; --------------------

org $C2????    ; pick a free address

extra_attack:
LDA $C2574B,X
bra common

extra_effect:
LDA $C25751,X
ADC #$18
bra common

extra_healing:
LDA $C25757,X
ADC #$2D

common:
phx
tyx
clc
adc new_table,x  ; new_table is 3-byte address
plx
rts

now to give Bank C3 a shot:

Code:
hirom
header   ; comment out as needed

org $C34F7A

jsr extra1

loop:
jsr extra2
INC
INY
DEC $E0
bne loop
RTS

; ----------------

org $C3????   ; you find a free space address

extra1:
pha
tya
sta $e1   ; seeing as they're not using this half...
pla
rts

extra2:
pha
tax
lda new_table,x
clc
adc $e1
tax
pla
STA $7E9D89,X
rts

if i move "INC / INY" into extra2 and pull extra1 inline, it'll be a little faster.

then again, most of the slowness is coming from JSRing inside a loop.  maybe we should move that entire loop into extra2; it'll only take 6 more bytes.  likely worth the tradeoff.
Quote  

#7
Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
Quote:make a 54-byte ROM table of each Magic spell ID's desired position within its H/A/E category, with 0 being the first position.

also think i can write code that'd accept the following: a 54-byte ROM table of each Magic spell ID's desired overall position in a default Attack/Effect/Healing list.  it won't work if the categories are merged.  so for instance, if you wanted Bio and Bolt to be first in Attack, you'd give them values of 0 and 1, respectively; if you want Bserk and Dispel atop Effect, they'd get 24 and 25; and to make Antdot and Cure lead off Healing, assign them 45 and 46.

Bank C2 would do the alphabetization a little earlier, in the C2/55A1 loop, and likely run a little faster than what i have above.  Bank C3 would be slightly more involved than current code, but still do-able.
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite