• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
July 15, 2020, 06:50:13 am

News:

Don't be hasty to start your own mod; all our FFT modding projects are greatly understaffed. Find out how you can help in the Recruitment section.


Event Editing directly to a savestate (pSX only)

Started by Xifanie, May 06, 2013, 08:25:58 pm

Xifanie

May 06, 2013, 08:25:58 pm Last Edit: May 24, 2014, 03:32:32 pm by Xifanie
This tutorial assumes you can already use Xifanie's event compiler/decompiler or RavenOfRazgriz's EasyVent editor. If you don't, learn from Elric's tutorial here. This method will only work with pSX emulator's quicksaves, and not Epsxe's savetates because the are compressed... It might work if you manually uncompress the savestates every time and find out the right offset where the event starts in those file types, but I'm not going to cover that.

Setup
Make you have the latest CONFIG.INI, it helps to have all the instructions information up to date.

You will need to copy CONFIG.INI, the compiler, decompiler (and EasyVent if that's what you use), to your pSX \saves\ folder. You can make a copy anywhere, but it's less trouble if the compiler is in the same folder as the quicksave for this purpose.

Edit your \saves\ CONFIG.INI and set:
TESTEVT='quicksave_SCUS_942.21_1.psv'         // Or whichever custom quicksaves your patch uses
Offset='0004A96C'                             // This is the address where events are always stored in the quicksave

I also recommend setting TEXTFILE= to the complete filepath where your event.txt or whichever file you're editing is at. This will make both compilers able to work from the same file, but it's not mandatory.

* To use the new method, you will have to apply the newest version of my Event Instruction Upgrade hack. More information about it on the wiki.

That's it, you're done setuping! Now on to the real deal.


Savestate Event Editing
Set the Text() Offset
Edit your event, set Text() to a relatively large number. PSX Events have 0x2000 bytes available, so Text(x1800) would be reasonable... that gives 3/4th of the space to instructions, and 1/4th to text. Why is this necessary? The compiler cannot change the text offset of an event loaded in a quicksave. So you have to give yourself space to work with beforehand. If you don't and add/remove instructions to your event, the game will not read your event properly anymore. You might have to adjust this if you have a really long event, depending if it has a lot of text or little. Normally this shouldn't be a problem as it is plenty of space for your average event.

Now your two first lines should look like this:
Offset(x00002000)
Text(x00001800)


Offset(x00002000) is simply the number for the first event; Orbonne. Do not change this number whatever it might be in your case.
Text(x00001800) is relative to the Offset's number, so always use values below 0x2000 as an event is only 0x2000 long... if you aren't careful, you'll write over following events that have nothing to do with the one you're editing and really screw up your TEST.EVT!


Compile to TEST.EVT and import
Run the compiler in your main, TEST.EVT folder to compile your recently edited event.
Import your TEST.EVT to your FFT image using CdMage/cdprog.


Create your quicksave
Run the game, and load your event. Reach the point in your event where you want to start editing and make your #1 quicksave there (F6 key). I recommend making a quicksave while a dialogue box is still opened, it's simply safer this way, though again not mandatory. Don't save on the loading screen or before, your event has to be loaded, i.e. running. This means you still have to write some instructions first. If you're lazy and don't want to code anything before quicksave editing, you can simply make Pause() your first instruction, quicksave when you're sure the event has loaded, then add your instructions and only remove the Pause() after you're done editing your quicksave. Note: Pause() require the press of confirm/cancel/select to resume the event.


Re-setup your event for quicksave editing
Comment the Offset(), and don't touch the Text() Offset. This will force the compiler to use the Offset in CONFIG.INI instead, which you should have changed to 0004A96C at the start of this tutorial.
//Offset(x00002000)
Text(x00001800)

You might notice thorough this tutorial that I always ask to comment the lines instead of simply removing them... trust me, you want to keep those numbers, especially the Offset().


Edit your event
Now you can just view what you need to fix, and then edit your event accordingly... but remember, you cannot touch anything that the game already read. Editing all the text data is fine, but not the instructions before the point reached in your quicksave.

Now you can compile your event using the compiler in your /saves/ folder.

Load your quicksave, and see your edits, if they don't suit you, edit away again!

At this point you can keep making your way into the event, making a new quicksave after every part you fix, until the event's over.


Return to TEST.EVT format, compile & import
Now your event should be all perfected, make sure you remove the comment // from the Offset(), and you can also comment the Text() offset, but it's not mandatory. Only now can you compile your event to your TEST.EVT and import it back to your FFT image. If you reload your event now, it should work just like it did during your quicksave editing.
Offset(x00002000)
//Text(x00001800)

or

Offset(x00002000)
Text(x00001800)


Compile to TEST.EVT and import
Run the compiler in your main, TEST.EVT folder to compile your recently edited event.
Import your TEST.EVT to your FFT image using CdMage/cdprog.


Create your quicksave
Run the game, and load your event. Reach the point in your event where you want to start editing and make your #1 quicksave there (F6 key). I recommend making a quicksave while a dialogue box is still opened, it's simply safer this way, though again not mandatory. Don't save on the loading screen or before, your event has to be loaded, i.e. running. This means you still have to write some instructions first. If you're lazy and don't want to code anything before quicksave editing, you can simply make Pause() your first instruction, quicksave when you're sure the event has loaded, then add your instructions and only remove the Pause() after you're done editing your quicksave. Note: Pause() require the press of confirm/cancel/select to resume the event.


Re-setup your event for quicksave editing
Copy your event information to your pSX \saves\ folder. (usually event.txt)
Comment the Offset() with // ; This will force the compiler to use the Offset in CONFIG.INI instead, which you should have changed to 0004A96C at the start of this tutorial.
Code ("Example") Select
//Offset(x00002000)
Why comment it? Trust me, you want to keep that Offset(). You probably won't remember on your own.


Edit your event
Now you can just view what you need to fix, and then edit your event accordingly... but remember, you cannot touch anything that the game already read. Editing all the text data is fine, but not the instructions before the point reached in your savestate.

Now you can compile your event using the compiler in your /saves/ folder.

Load your quicksave, and see your edits, if they don't suit you, edit away again!

At this point you can keep making your way into the event, making a new quicksave after every part you fix, until the event's over.


Return to TEST.EVT format, compile & import
Now your event should be all perfected.
Copy back your event information to your TEST.EVT folder. (usually event.txt)
Make sure you remove the comment // from the Offset(). Only now can you compile your event to your TEST.EVT and import it back to your FFT image. If you reload your event now, it should work just like it did during your savestate editing.
  • Modding version: PSX
Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

Elric

As the requester of this tutorial, I thank you very much for this Xif. This will undoubtedly save me many many many hours.
For anyone that knows how eventing works, imagine being able to make your entire event in 1 run, rather than going back
to test every few minutes. This will be incredibly valuable to someone like myself.
  • Modding version: PSX
<@Angel> Teach a man to fish and he'll open up a fishery to compete against yours.


Journey of the Five Youtube ChannelThe Lion War Current Status
  
Jot5 Leader :: Eventer :: OtherTLW Leader :: Eventer :: Other

Xifanie

Updated with a newer, faster, safer method which requires my Event Instruction Upgrade hack.
  • Modding version: PSX
Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

kyozo22

...  :shock: ...   :mrgreen:

A-freaking-MAZING! This is absolutely awesome Xifanie, thank you so much!
  • Modding version: WotL