You can change either the hex data or the hex values within the text data. There's a few quirks with hitting return in the text data -- basically, to add another line you have to hit return between the hex values and the text. Other than, it works pretty well I think. I even got instantaneous updating to work, which I wasn't sure was possible. Along with my event offsets document (hosted by bond697 here (http://bond697.110mb.com/data/Events.txt)) you can script any of the events by copying and pasting the hex data. I'm planning on using it for writing my own events, too.
bond697: I noticed the line values on the event offsets document you have posted is messed up after event 3D. Do you need a new copy of it, or can you fix it?
Title: Re: Javascript FF4 Event Scripter
Post by: Dragonsbrethren on August 12, 2008, 05:24:25 PM
Hey, this is pretty cool. I was planning on making some modifications to a few events soon so this will come in really handy.
This is a bit of a stupid question but what determines where events appear? For example, if I wanted to change Baron's item shop so it used a different shop list, what determines what event the shopkeeper calls?
Title: Re: Javascript FF4 Event Scripter
Post by: Phoenix on August 12, 2008, 06:03:10 PM
To warn you, you're much better off changing the event itself. The events loaded by speaking to people are a bit of a hassle to mess with. I'm sure you can decide for yourself which is better, though, so here's the explanation:
The events when speaking to people are determined by the speech data. The pointers for this are 99A00-99DFF (2 bytes, reverse and add 0x99E00) and the speech data is 99E00-9A4FF (variable length). It took me a long while to figure out what the bytes meant, but I believe I have a clear understanding of how it's coded:
FFxx = Load event xx FEaa = If event flag aa is set... aa = If event flag aa is clear...
Examples: aaFFxxFFyy = If event flag aa is clear, then load event xx, else load event yy FEaabbFFxxFEccFFyyFFzz = If event flag aa is set and bb is clear, then load event xx, else if event flag cc is set, load event yy, else load event zz
The speech data utilizes events numbers 01-03, which are EE message calls: "Show message [hex data xx following event call] (from bank 2)" For example, the Old Man wandering in the town of Baron has the following data (at 99EDE-99EEA): FE 06 FF 03 FE 0B FF 02 FF 01 03 04 05 This translates to: DataMeaning FE 06If event flag 06 is set, FF 03load event 03 (i.e. message call EE 02 = message 05 of bank 2) FE 0B(else)If event flag 0B is set, FF 02load event 02 (i.e. message call EE 01 = message 04 of bank 2) FF 01(else)load event 01 (i.e. message call EE 00 = message 03 of bank 2) 03 04 05Hex data following event call So you see, it's a pain to change, because you need to keep track of the person/object index and the event flags. Shops aren't conditional, so they would be a simple "FFxx" string. For example, I checked on the Baron Item shop man, and he is person/object number 44. You look that up in the speech data, and the data is "FF 26." Event 26 is "Bring up shop 13." And shop 13 is the item shop that you want. Much easier to just change event 26 to bring up a different shop.
Just a heads up: when writing this out I did notice that person 44 is used by the Baron, Kaipo, and Toroia item shops. That means they all load the same item shop, and if you change the event it'll change all the shops. You'd have to create three different person/object instances to have three different shops.
Title: Re: Javascript FF4 Event Scripter
Post by: Dragonsbrethren on August 12, 2008, 06:11:03 PM
Just a heads up: when writing this out I did notice that person 44 is used by the Baron, Kaipo, and Toroia item shops. That means they all load the same item shop, and if you change the event it'll change all the shops. You'd have to create three different person/object instances to have three different shops.
Ack, so not only do those sprites share the same event, the maps share the same sprite...makes it a lot more annoying to change than I was expecting.
Title: Re: Javascript FF4 Event Scripter
Post by: bond697 on August 12, 2008, 06:31:41 PM
bond697: I noticed the line values on the event offsets document you have posted is messed up after event 3D. Do you need a new copy of it, or can you fix it?
can you send me a new copy? the one i have from last time has the events messed up in the same manner. if that doesn't work, i'll fix each one manually.
Title: Re: Javascript FF4 Event Scripter
Post by: bond697 on August 13, 2008, 11:07:27 PM