Author Topic: [FF7] Text editor - touphScript (v1.3.0)  (Read 73534 times)

DLPB

  • No life
  • *
  • Posts: 8836
  • Karma: 253
  • My love is as sharp as a needle in your eye.
    • View Profile
Luksy has added support for Kernel,kernel2 and scene.bin (including AI text) text editing.  Seems to work 100% so far so that's a very good release when it arrives here!  Next is FF7.exe.

To sum this up, touphScript is the ultimate game text editor, soon capable of editing almost all of the games text and allowing a distributor of a mod to make sure that edits to text will not mean having to ship entire files which end up conflicting with other peoples mods.

This is a godly tool.

Vgr

  • Global moderator
  • No life
  • *
  • Posts: 2209
  • Karma: 33
  • If it quacks like a duck, it must be a duck
    • View Profile
If DLPB says so... then it is ;D

And yes, it seems like it's good as hell! ^^

luksy

  • Insane poster
  • *
  • Posts: 363
  • Karma: 41
    • View Profile
Re: [WIP] [v0.9.5] touphScript - FFVII-PC text editor
« Reply #27 on: 2011-09-29 02:56:59 »
Ok as Dan said it now supports scene.bin and kernel2.bin, I'll get to work on exe text for a 1.0 release!

NFITC1

  • No life
  • *
  • Posts: 2764
  • Karma: 61
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: [WIP] [v0.9.5] touphScript - FFVII-PC text editor
« Reply #28 on: 2011-09-29 19:07:18 »
What part of the scene.bin text are you editing? There are only enemy names, action names, and AI text to modify and AI text would be more complicated than just inserting text.

DLPB

  • No life
  • *
  • Posts: 8836
  • Karma: 253
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: [WIP] [v0.9.5] touphScript - FFVII-PC text editor
« Reply #29 on: 2011-09-29 19:16:42 »
The AI text is being done via a search for opcode 93.  naturally if someone has added text to scenes, it won;t replace the correct text unless the person chooses to decode and then make sure the text file is altered ready for encoding properly, but other than that it is perfect.  Download it and try.  Also.. apparently there is some unused "formation" data.

tS edits ALL text in scene bin , kernel2.bin, world map, field, tutorial, and soon ff7.exe

Can you also confirm that "Ex-Soldier" is the only text in kernel.bin?
« Last Edit: 2011-09-29 19:30:05 by DLPB »

Vgr

  • Global moderator
  • No life
  • *
  • Posts: 2209
  • Karma: 33
  • If it quacks like a duck, it must be a duck
    • View Profile
Re: [WIP] [v0.9.5] touphScript - FFVII-PC text editor
« Reply #30 on: 2011-09-29 19:32:01 »
Actually, isn't it in the kernel2? I think so, although I cannot check right now.

DLPB

  • No life
  • *
  • Posts: 8836
  • Karma: 253
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: [WIP] [v0.9.5] touphScript - FFVII-PC text editor
« Reply #31 on: 2011-09-29 19:45:10 »
No.  It isn't :P  believe me, I know.

NFITC1

  • No life
  • *
  • Posts: 2764
  • Karma: 61
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: [WIP] [v0.9.5] touphScript - FFVII-PC text editor
« Reply #32 on: 2011-09-29 21:35:15 »
The AI text is being done via a search for opcode 93.  naturally if someone has added text to scenes, it won;t replace the correct text unless the person chooses to decode and then make sure the text file is altered ready for encoding properly, but other than that it is perfect.  Download it and try.

I don't have time to try, but this doesn't sound safe. If the text length is altered then all the AI jumps would be off. If you increase it then you'd have to re-write all the headers for the enemy AI. If shorten it then you could fill the empty space with NULL value which would be considered as NOPs.

Also.. apparently there is some unused "formation" data.
Can you elaborate on that a little?

tS edits ALL text in scene bin , kernel2.bin, world map, field, tutorial, and soon ff7.exe

Can you also confirm that "Ex-Soldier" is the only text in kernel.bin?

The relevant "Ex-SOLDIER" is in the ff7.exe. Look at Aerith's info. In the KERNEL.BIN her initial name is listed as "Aerith", but when you go to name her she defaults as "Aeris". That text only exists in ff7.exe. That's where initial names come from. You can change those names to anything and it wouldn't alter the names.
Actually, that's not entirely true. The names in KERNEL.BIN are the first names, but when you get to the "enter a name" screen, it defaults to the names in ff7.exe. If you have a piece of dialog that references character 4's name before you get to name her, it will read "Aerith".

Vgr

  • Global moderator
  • No life
  • *
  • Posts: 2209
  • Karma: 33
  • If it quacks like a duck, it must be a duck
    • View Profile
Re: [WIP] [v0.9.5] touphScript - FFVII-PC text editor
« Reply #33 on: 2011-09-29 21:52:27 »
Would be better if tS could edit the whole AI in the scene.bin because that way it'd be safer IMO.

256 scenes * 3 enemies per scene (would be good to dump even if it's empty, to be able to fill) and I'm not sure if independant files or only a file per enemy will be good. I mean, it brings the amount of files for scene.bin to 768 and if we split it in 16 files per enemy it'd be 768*16 which is insanely big. The final word is not mine, however ;D

DLPB

  • No life
  • *
  • Posts: 8836
  • Karma: 253
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: [WIP] [v0.9.5] touphScript - FFVII-PC text editor
« Reply #34 on: 2011-09-29 22:13:31 »
Quote
Can you elaborate on that a little?

No, but Luksy can :P

Quote
The relevant "Ex-SOLDIER" is in the ff7.exe.

The one the game uses is from the kernel is it not?  I was sure the exe one was unused?  There is a dupe in file 3 or 4 of kernel.  When I edit the text inside wallmarket it changes in game.  Surely you don't edit the exe?  Ex Soldier never gets to a name screen.

as for the AI I am pretty sure luksy has altered all the headers and pointers as well.  You would have to take it up with him though, he knows what he is doin and i don't  ;D  He definitely does edit headers and pointers though, I mean, he has just written a program that alters script in flevel too...  he is pretty competent.

edit:  the one in exe is definitely unused.  The game must take it from that file in kernel.bin.  I edited exe and it changed nothing, I edited kernel with wallmarket and it did.
« Last Edit: 2011-09-29 22:24:55 by DLPB »

luksy

  • Insane poster
  • *
  • Posts: 363
  • Karma: 41
    • View Profile
Re: [WIP] [v0.9.5] touphScript - FFVII-PC text editor
« Reply #35 on: 2011-09-30 00:32:14 »
NFITC1 you're absolutely right about the jumps, I hadn't considered that. Luckily it's exactly the same issue when messing around with the field script and I've already solved it, I'll update the app now, thanks again.

Quote
Quote
Also.. apparently there is some unused "formation" data.
Can you elaborate on that a little?

I didn't explain myself to Dan properly, as you will certainly know each scene has 4 formation AI scripts and 3 enemy AI scripts; although the vanilla game does not use text in the formation scripts, it's technically possible to insert text, so I check formation AI too just in case.
« Last Edit: 2011-09-30 08:14:43 by luksy »

DLPB

  • No life
  • *
  • Posts: 8836
  • Karma: 253
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: [WIP] [v0.9.5] touphScript - FFVII-PC text editor
« Reply #36 on: 2011-09-30 00:53:28 »
Just small update, the data in the exe seems to be identical to that found in file 4 of kernel.bin , except kernel.bin is used and the exe isnt.  At least this is true for offset 10h (Ex-SOLDIER) and 3ACh (Sephiroth).

NFITC1

  • No life
  • *
  • Posts: 2764
  • Karma: 61
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: [WIP] [v0.9.5] touphScript - FFVII-PC text editor
« Reply #37 on: 2011-09-30 02:43:58 »
Ex Soldier never gets to a name screen.

That's right, it's used BEFORE the name screen. That's what I meant. I probably composed that sentence out of order. After you defeat the two guards Cloud gets named so you only see the text "Ex-SOLDIER" in that one battle. After that, the game takes the name "Cloud" from the exe and uses THAT name to use as the default text for the name screen. There are several repeats of the string "Cloud" in the exe. I'm not sure which one is used.

DLPB

  • No life
  • *
  • Posts: 8836
  • Karma: 253
  • My love is as sharp as a needle in your eye.
    • View Profile
« Last Edit: 2011-09-30 03:00:51 by DLPB »

luksy

  • Insane poster
  • *
  • Posts: 363
  • Karma: 41
    • View Profile
Re: [WIP] [v0.9.5] touphScript - FFVII-PC text editor
« Reply #39 on: 2011-09-30 08:11:56 »
Would be better if tS could edit the whole AI in the scene.bin because that way it'd be safer IMO.

I don't really want to start bloating the files any further, my original idea was a simple text editor that anyone can use. The only place I have considered anything other than text is in the tutorials because it was trivial to dump the entire file to text including ops.

It's actually safer as it is now, as manually recalculating jumps can get very ugly, very fast.

DLPB

  • No life
  • *
  • Posts: 8836
  • Karma: 253
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: [WIP] [v0.9.6] touphScript - FFVII-PC text editor
« Reply #40 on: 2011-09-30 18:27:31 »
Gemini put me straight... I forgot...  Sephiroth text from kernel.bin is loaded on new game to ram and is then saved when you save a game... so unless you start a game again or alter the save file, you will never see the change.
« Last Edit: 2011-09-30 19:24:38 by DLPB »

luksy

  • Insane poster
  • *
  • Posts: 363
  • Karma: 41
    • View Profile
Re: [WIP] [v0.9.8] touphScript - FFVII-PC text editor
« Reply #41 on: 2011-10-01 00:36:00 »
v0.9.8

Ok that should be it, unless there are bugs, so if you come accross something odd please let me know! When enough people have tested and confirmed working I'll promote it to 1.0.

DLPB

  • No life
  • *
  • Posts: 8836
  • Karma: 253
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: [WIP] [v0.9.8] touphScript - FFVII-PC text editor
« Reply #42 on: 2011-10-01 00:39:47 »
This now supports editing:

All text in FF7.exe
All text in Scene.bin
All text in kernel.bin
All text in kernel2.bin
All dialogue in Flevel.lgp including tutorials.  All non used text is edited out.
All dialogue in World_us.lgp (ev files and mes) for World dialogue.


Also supports scripting of Tutorials, my and kranmer's menu overhaul (see the ini and readme). It can automatically size dialogue windows and removes unused text entries.  It also fixes broken windows from original game.

A monumental effort, and imho the best single translation tool available.  Can be used from Command line.
« Last Edit: 2011-10-01 00:42:23 by DLPB »

NFITC1

  • No life
  • *
  • Posts: 2764
  • Karma: 61
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: [WIP] [v0.9.8] touphScript - FFVII-PC text editor
« Reply #43 on: 2011-10-01 21:30:27 »
While we're talking about AI, are you looking at the player characters' AI in the KERNEL.BIN and the formation AI in the scene.bin? Just wondering. Also, you should think about checking for the A0 opcode since that's the debug text line. That uses standard ASCII values and not the FF7 font, though.

Vgr

  • Global moderator
  • No life
  • *
  • Posts: 2209
  • Karma: 33
  • If it quacks like a duck, it must be a duck
    • View Profile
Re: [WIP] [v0.9.8] touphScript - FFVII-PC text editor
« Reply #44 on: 2011-10-01 21:31:13 »
No and no.

luksy

  • Insane poster
  • *
  • Posts: 363
  • Karma: 41
    • View Profile
Re: [WIP] [v0.9.8] touphScript - FFVII-PC text editor
« Reply #45 on: 2011-10-01 23:44:22 »
While we're talking about AI, are you looking at the player characters' AI in the KERNEL.BIN and the formation AI in the scene.bin? Just wondering. Also, you should think about checking for the A0 opcode since that's the debug text line. That uses standard ASCII values and not the FF7 font, though.

I'm checking formation AI for text just in case, not checking character AI - should I be? I check for 0xA0 but only to skip over it otherwise I wouldn't be able to read scripts that use it, don't think many people are interested in modifying debug text  :D

DLPB

  • No life
  • *
  • Posts: 8836
  • Karma: 253
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: [WIP] [v0.9.8] touphScript - FFVII-PC text editor
« Reply #46 on: 2011-10-02 01:13:05 »
Just a small note.  I think luksy wants to add "script fixes" elsewhere, but so far there are 3 main ones:

1.  bridge scene in mtcrl_9 (text removed in PC, you have to place text back which we can fix anyway with this tool).  Thanks for this to myst6re.

There is one, easy to unlock, at mtcrl_9, border_2 location is disabled due to the first action in the script 0 (main). In fact, the location is cleared all the time. Remove "Clear the location" action, and voila!
http://youtu.be/5gBT0Y8fwhU


2. Barrett scene at Gongaga.  I forget who told me this one but I also told myst6re of it.

    Barret is on current party
    GameMoment < 638
    “A ruined reactor.” text was triggered in gongaga
    You spoke with at least one villager about the reactor accident.
    the fifth bit in var[3][129] is 0

The problem is that the last condition does not happen, the fifth bit is set to 1 at the beginning of the game (chrin_2 > init > S0 - main). Why? I don't know, this may be needed. After all, both fields (chrin_2 & gonjun1) are produced by the same author (Keisuke).

delete the set bit action at chrin_2 > init > S0 - main


3.  Temple of the Ancients original minigame (present in original Japanese game).  I was going to look into it, but Shademp found out its very simple to fix.  A var is set deliberately that is supposed to be set only when you fall down in the clock room 3 times. 

So just remove "Set the 1 bit to 1 in Var[3][239]" in  kuro_4 -> produce -> S0 Init. The text has been translated already but until now, never used.

People always say that this original minigame is too hard... I didn't think so.  It was pretty easy.  If you fall down the clock room 3 times the minigame switches to the easier version.

« Last Edit: 2011-10-02 01:21:40 by DLPB »

luksy

  • Insane poster
  • *
  • Posts: 363
  • Karma: 41
    • View Profile
Re: [WIP] [v0.9.9] touphScript - FFVII-PC text editor
« Reply #47 on: 2011-10-10 10:48:22 »
Minor update with some text files renamed for easy access, and a feature that should be useful for text mods that allows individual entries to be ignored.

luksy

  • Insane poster
  • *
  • Posts: 363
  • Karma: 41
    • View Profile
Re: [WIP] [v0.9.9.1] touphScript - FFVII-PC text editor
« Reply #48 on: 2011-10-20 04:20:06 »
Bugfixes for a couple of things that popped up when using with Aeris revival mod and hardcore mod, as Dan said in the menu mod thread touphScript will probably crash when using hardcore mod due to a bug in las2_3

I could add a check for similar errors and log instead, but logging errors can go unnoticed; at least if touphScript crashes it's pretty obvious, although annoying I'm sure, and also may suggest that there is something fatally wrong with the game code as in this case. I'll think about ways to make these kind of errors more obvious for a future release.

luksy

  • Insane poster
  • *
  • Posts: 363
  • Karma: 41
    • View Profile
Re: [WIP] [v0.9.9.2] touphScript - FFVII-PC text editor
« Reply #49 on: 2011-10-21 03:13:10 »
Quick 'n' dirty bugfix for the hardcore mod issue, it shouldn't crash now.