Users browsing this thread: 1 Guest(s)
Event Hacking question

#51
Posts: 763
Threads: 83
Thanks Received: 55
Thanks Given: 7
Joined: Apr 2015
Reputation: 22
Status
Obliviscence
The fresh ROM isn't necessary, if it worked with CB/6906 then the game is calling the right events. You should work on figuring out why you walked diagonally down on the first event call instead of right 2 spaces and stopping.
  Find
Quote  

#52
Posts: 174
Threads: 23
Thanks Received: 0
Thanks Given: 6
Joined: Feb 2011
Reputation: 0
Status
None
(07-17-2013, 01:52 PM)Edrin Wrote: The fresh ROM isn't necessary, if it worked with CB/6906 then the game is calling the right events. You should work on figuring out why you walked diagonally down on the first event call instead of right 2 spaces and stopping.

I just re entered the event (20946) into the LE and it did exactly what it was supposed to do. I went back to the event script and looked at it there (CC/0946) and read it again. I don't recall reading those instructions last time, so my conclusion is that I had entered and read the wrong event script the first time around. Both the events you gave me seem to be working fine now!
  Find
Quote  

#53
Posts: 763
Threads: 83
Thanks Received: 55
Thanks Given: 7
Joined: Apr 2015
Reputation: 22
Status
Obliviscence
So now we are going to go into dialogue: how to know what dialogue you are setting, how to manipulate the dialogue window, and editing dialogue with FF3usME. You will need to be able to convert Hex to Decimal and vice-versa for this lesson. My recommendation is the default windows calculator set to the Programmer view; it allows easy conversion between Hex, Decimal, and Binary at any moment simply by changing the radio button selected, instantly converting whatever is on the screen to the desired format.

Going back to your last assignment, CC/0946 has some dialogue in it:
Code:
CB/690E: 4B    Display dialogue message $01BA, wait for button press
               Yaaaouch!!!!

The dialogue event command(4B) is a 3-byte command. The first byte(4B) is the command byte and it is followed by 2 value bytes that signify the dialogue used and the dialogue box modifiers for the command. The values are placed in Endian order which has to do with how the values are fed to the processor. The main thing you need to know is that this means the bytes after 4B are going to be placed in the hex backwards. In the example above, you would see this code in hex as "4B BA 01."

So how do we pick new text to fill the dialogue window? By changing the value bytes of course! But what message will appear?

Math time! Open up FF3usME and your calculator (unless you love doing Hex conversions by hand). The Hex value of your dialog, converted to decimal, then subtracting 1 will be the FF3usME dialogue ID number. Conversely, add 1 to the FF3usME ID number and convert to Hex to get the value for the event command. So taking our dialogue hex value of $01BA converting to decimal gives us 442, subtract 1 and what do you find? "Yaaaouch!!!!"

Practice:
The first thing I want you to do is tell me what message would you receive if I entered the command "4B E1 09".

Next, what is the hex value for the dialogue, "GUARD: We must defend the mines!"?


Not all text appears in the same spot in the same way, sometimes the dialogue box is at the bottom of the screen... sometimes there's no box at all and just text! How does the game know which of these to do when displaying dialogue? The thrid byte in the dialogue event command handles the dialogue box. But aren't we already using this for our dialogue ID? Yes! but not all of it! If you go to the very bottom of the FF3usME dialogue editor, you will see that the text ends at 3082, converting this to the proper hex value gives you $0C0B, notice that that first number is always 0? So our third byte in that command would be 0C, the 0 is referred to as the "high nibble" and the C is referred to as the "low nibble". The high nibble of the third byte in the dialogue command controls the dialogue box.

What can we do with the dialogue box, and how do we do it with the high nibble of the third byte? A nibble is 4 bits and these bits act as flags to tell the game what changes to make to the dialogue window. To my knowledge, only 2 of these bits are used. The top bit, AKA bit 3 of the nibble (and bit 7 of the byte) determines whether the dialogue box appears on the top or the bottom of the screen. It appears on the top if the bit is clear(0), and on the bottom if the bit is set(1). Bit 2 of the nibble (6 of the byte) determines if there is a dialogue window behind the text. There is a text box if the bit is clear(0), and no text box if the bit is set(1). Bits 1 and 0 (5 and 4 of the byte) do nothing. Here's a little table to help you visualize these changes:

Code:
Binary         Hexidecimal          Window
-----          -----------          ------
0000            0                   Text on top of screen with box
1000            8                   Text on bottom of screen with box
0100            4                   Text on top of screen with no box
1100            C                   Text on bottom of screen with no box

By plugging in the correct top nibble in the table above, displaying the final dialogue ID in the game on the bottom of the screen with no text box would use the event command "4B 0B CC". Notice 8 + 4 = C in hex. It is also important to note that this does NOT mean the dialogue ID is $CC0B, using this number will give you the wrong FF3usME ID, the dialogue ID is still $0C0B, which converts to 3082.


Practice:
What event command would I use to display FF3usME dialogue ID 2003 on the top of the screen with no dialogue box?

What event command would I use to display FF3usME dialogue ID 386 on the bottom of the screen with no dialogue box?

Using your hex editor, go to the following addresses in the ROM and tell me:
a)What message is being displayed, and
b)What is the state of the dialogue window? (top, bottom, box, no box)
note: Don't forget to add $200 to your addresses if your ROM is headered!

CA/8176
CA/97BC
CB/C67E
CC/7169


Editing and creating dialogue is simple with FF3usME. By clicking on any of the lines in the editor, you will get all of the text in the large field below. This is where you can type as much as you want, until all the available dialogue bytes are used. The number of remaining bytes is displayed at the bottom of the dialogue editor window. To save your changes, press the "Apply" button at the bottom of the screen.

There are a number of special characters used in the text that control how the text itself is displayed, but that is beyond the scope of what I want to do today, but you should at least understand that <EOP> stands for "End of Page" and will start a new page of dialog.

No practice for this section, plenty of that to come!


The next lesson will be on event creation and calling, and how to use the expanded ROM to create more events.

BTW, if at any point you decide you've got this down and don't need my silly lesson plan, feel free to speak up. I know this is taking a bit longer than just giving you the answer. Hope this is helping you understand.

Happy Hacking!
  Find
Quote  

#54
Posts: 174
Threads: 23
Thanks Received: 0
Thanks Given: 6
Joined: Feb 2011
Reputation: 0
Status
None
(07-19-2013, 11:35 AM)Edrin Wrote: Practice:
The first thing I want you to do is tell me what message would you receive if I entered the command "4B E1 09".

Next, what is the hex value for the dialogue, "GUARD: We must defend the mines!"?

4B E1 09 = QSSI
'GUARD: We...." = 4B 13 00


Quote:Practice:
What event command would I use to display FF3usME dialogue ID 2003 on the top of the screen with no dialogue box?

What event command would I use to display FF3usME dialogue ID 386 on the bottom of the screen with no dialogue box?

2003 dialogue on top with no box - 4B D4 47
386 dialogue on bottom with no box - 4B 83 C1


Quote:Using your hex editor, go to the following addresses in the ROM and tell me:
a)What message is being displayed, and
b)What is the state of the dialogue window? (top, bottom, box, no box)
note: Don't forget to add $200 to your addresses if your ROM is headered!

CA/8176
CA/97BC
CB/C67E
CC/7169

CA/8176 – 4B F1 80 -
DIA – 2289 – KATARIN: I feel…
DIA BOX – text bottom with box
CA/97BC – 4B 32 C4
DIA – 1073 – RAMUH: She's scared……
DIA BOX- Bottom with no box
CB/C67E- 4B 21 03
DIA – 800 – CYAN: Is this it…..
DIA BOX – Top with box
CC/7169 – 4B 4F 86
DIA – 1614 – BANON: We have to…
DIA BOX – Bottom with box

Quote:BTW, if at any point you decide you've got this down and don't need my silly lesson plan, feel free to speak up. I know this is taking a bit longer than just giving you the answer. Hope this is helping you understand.

Happy Hacking!

Thats ok its taking a bit longer. You are right, you could just give me the answer, but that doesn't do either of us any good. As long as I'm getting this I'm enjoying learning it. Laugh
  Find
Quote  

#55
Posts: 2,549
Threads: 98
Thanks Received: 147
Thanks Given: 159
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
@ Edrin -- That looks like the start of a great event hacking tutorial that could benefit many people and deserves a separate thread, but I suppose here is as good as any if it's intended specifically for the TC to learn from.


We are born, live, die and then do the same thing over again.
Quote  

#56
Posts: 763
Threads: 83
Thanks Received: 55
Thanks Given: 7
Joined: Apr 2015
Reputation: 22
Status
Obliviscence
(07-19-2013, 03:34 PM)ribbits Wrote:
Quote:Using your hex editor, go to the following addresses in the ROM and tell me:
a)What message is being displayed, and
b)What is the state of the dialogue window? (top, bottom, box, no box)
note: Don't forget to add $200 to your addresses if your ROM is headered!

CA/8176
CA/97BC
CB/C67E
CC/7169
[/color]

CA/8176 – 4B F1 80 -
DIA – 2289 – KATARIN: I feel…
DIA BOX – text bottom with box
CA/97BC – 4B 32 C4
DIA – 1073 – RAMUH: She's scared……
DIA BOX- Bottom with no box
CB/C67E- 4B 21 03
DIA – 800 – CYAN: Is this it…..
DIA BOX – Top with box
CC/7169 – 4B 4F 86
DIA – 1614 – BANON: We have to…
DIA BOX – Bottom with box

Recheck CA/8176, great job on everything else!


(07-19-2013, 03:36 PM)Gi Nattak Wrote: @ Edrin -- That looks like the start of a great event hacking tutorial that could benefit many people and deserves a separate thread, but I suppose here is as good as any if it's intended specifically for the TC to learn from.

I was thinking this as I was writing it, we will see. For a beginners tutorial I would probably have to go back to "What is Hex" and talk about Hex Editors themselves. I at least had a baseline to start with here. Really it comes down to my dedication level once Ribbits is done... or if I'm really bored.
  Find
Quote  

#57
Posts: 174
Threads: 23
Thanks Received: 0
Thanks Given: 6
Joined: Feb 2011
Reputation: 0
Status
None
(07-19-2013, 05:17 PM)Edrin Wrote: Recheck CA/8176, great job on everything else!


CA/8176
DIA - 240 - Edgar: sabin....
DIA BOX - bottom with box
  Find
Quote  

#58
Posts: 763
Threads: 83
Thanks Received: 55
Thanks Given: 7
Joined: Apr 2015
Reputation: 22
Status
Obliviscence
I'm sure you've seen the ZoneDoctor beta in the Person Projects forum, so a lot of this may have just become trivial, The only thing really left that the editor can't do is write events in the expanded ROM space (F0-FF banks). This is relatively simple, just make your code in the editor, export the hex and copy into the ROM then create a B2 call to where you dropped the hex.

But before every editor session, MAKE A BACKUP, there is an option in the ZoneDoctor settings to create a backup on save, I would highly recommend using this feature in addition to creating backups of your own periodically.
  Find
Quote  

#59
Posts: 174
Threads: 23
Thanks Received: 0
Thanks Given: 6
Joined: Feb 2011
Reputation: 0
Status
None
(07-22-2013, 10:23 AM)Edrin Wrote: I'm sure you've seen the ZoneDoctor beta in the Person Projects forum, so a lot of this may have just become trivial, The only thing really left that the editor can't do is write events in the expanded ROM space (F0-FF banks). This is relatively simple, just make your code in the editor, export the hex and copy into the ROM then create a B2 call to where you dropped the hex.

But before every editor session, MAKE A BACKUP, there is an option in the ZoneDoctor settings to create a backup on save, I would highly recommend using this feature in addition to creating backups of your own periodically.

This may be slightly redundant as I asked in the Zone Doctor thread, but the will make event editing easier and more user friendly?

Also regardless of the possible now trivialness of all you've been teaching me, I sure appreciate it and have enjoyed learning it!
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite