Page 1 of 2

[P4G PC] Issue: Editing the script's text in .bf files

Posted: Wed Jul 01, 2020 3:10 am
by Nulla
Hello everyone, I'm trying to edit the text in .bf files for P4G PC and I'm having some issues in doing so.

Now, here's what I wanted to do and what I did to make it happen (failing miserably): I wanted to change Dojima's dialogue right after you get to walk freely for the first time in the game. "I'll wait here. Why don't you take a[n]walk and get some fresh air?", this one. It's in f008.bf, and f008.bf is both in data00004/field/script and data00004/field/pack/f008_00X.arc. Now, as far as I know there's two tools for editing .bf files: AtlusScriptToolchain and BFMessageScriptEditor. I tried using AST and it failed at producing a .flow file, so there was no way I could compile it back using that as far as I'm aware. Then I tried with BFMessageScriptEditor, since all I cared for was the text: I decompiled it, changed the text that I needed to change, compiled it back in the .bf, put the .bf in data00004/field/script and in the data00004/field/pack/f008_00X.arc files, using Amicitia, inside the mods directory and started up the game, using the P4G PC Mod Loader plugin for ReloadedII. When I got to the shopping district, though, I was greeted by Shesez from Boundary Break.

Image

I have no idea how or why this happened, since apparently the BFMessageScriptEditor is just supposed to edit the script's text and nothing else: are the tools not working as intended or am I just dumb? It's probably the latter, but I just can't figure out what I could possibly be doing wrong here.

Re: [P4G PC] Issue: Editing the script's text in .bf files

Posted: Wed Jul 01, 2020 10:10 am
by Reishiki
Did you try Persona Editor?

Re: [P4G PC] Issue: Editing the script's text in .bf files

Posted: Wed Jul 01, 2020 11:49 am
by Nulla
Reishiki wrote: Wed Jul 01, 2020 10:10 am Did you try Persona Editor?
I didn't, so thank you for pointing that out, but now I did and it's the same. All I did this time was take the f008_00X.arc files and f008.bf from the original .pac, opening it with Persona Editor, saving it without even touching the text, replacing the .bf file inside the .arcs and boom, strange camera once again. Plus, I forgot to tell since there were bigger issues, but the people I speak with don't show any name (at least in the messages kept in the files I put back in). This happened both when I edited the .msg files and compiled them with BFMessageScriptEditor and when I used Persona Editor. It seems like any .bf file I save with Persona Editor loses its names, actually. All I do is open up the .bf in PE, open the .BMD file inside it, check and uncheck the "Enable Edit" option, save the .BMD file and then the .bf, and when I open up the new .bf the names are nowhere to be found.

Update: I somehow managed to make the dialogue names appear apparently just by setting a destination font in Persona Editor, no idea how those things are related but I'm not complaining. The camera is still wierd though.

Just in case anyone was wondering about what the student at the bus stop was looking at:
Image

Re: [P4G PC] Issue: Editing the script's text in .bf files

Posted: Thu Jul 02, 2020 5:33 am
by Nulla
Another update: it seems that whatever I do with f008_00X.arc 001 and from 003 to 011 (all of them but 002), the game doesn't change. The old text is still there and the camera is where it should be, but the moment I touch f008_002.arc, then the magic happens: the text changes how I wished, but the camera guy takes a break. Plus, I edited f007.bf and f068.bf, which contain Yu's thoughts upon entering his room for the first time and "the fog's" dialogue in his dream, and they don't seem to mess with the camera in any way. I should probably test more .bf files to see what's wrong.

Re: [P4G PC] Issue: Editing the script's text in .bf files

Posted: Tue Jul 07, 2020 2:43 am
by Nulla
Once another update: after tinkering some more with other .bf files, I found out that the south portion of the shopping district isn't the only victim. Here's some other places where the camera gets messed up whenever I edit the text within the .bf files in the .arc:
-Outside of Dojima's House, fd007_001.arc
-Shopping District, North, fd008_001.arc
-Tatsuhime Shrine, fd008_009.arc

I checked these places on 4/12, the first day when you can explore somewhat freely. Now, the .bf files I have edited are dungeon, f007, f008, f068 and n008_002. dungeon and f068 seems to be behaving quite normally since the dungeon sequence in Yu's dreams had normal camera and those two files are related to that, but the other three are used in the .arc files that are giving me trouble. Has this ever happened to anyone else?

Re: [P4G PC] Issue: Editing the script's text in .bf files

Posted: Wed Jul 08, 2020 8:52 am
by ShrineFox
Thanks for the report, I appreciate the sense of humor lol. I'll have to see if I can reproduce these results and look for any workarounds. I'm beginning to wonder if this is a problem with editing ARC files rather than the scripts themselves, since people have also mentioned mere fileswaps of models between ARC containers resulting in invisible models ingame.

However, since the compiler seems to be failing to decompile them that tells me it's a bigger issue than that. I've also run into broken cameras when recompiling vanilla P4 scripts in full, but it's almost always avoidable by hooking the specific function you're editing rather than recompiling the whole file. The message editor should only be appending new data to the end of the file and updating offsets to it though, so this is very strange indeed

Re: [P4G PC] Issue: Editing the script's text in .bf files

Posted: Thu Jul 09, 2020 1:27 am
by Nulla
ShrineFox wrote: Wed Jul 08, 2020 8:52 am Thanks for the report, I appreciate the sense of humor lol. I'll have to see if I can reproduce these results and look for any workarounds. I'm beginning to wonder if this is a problem with editing ARC files rather than the scripts themselves, since people have also mentioned mere fileswaps of models between ARC containers resulting in invisible models ingame.

However, since the compiler seems to be failing to decompile them that tells me it's a bigger issue than that. I've also run into broken cameras when recompiling vanilla P4 scripts in full, but it's almost always avoidable by hooking the specific function you're editing rather than recompiling the whole file. The message editor should only be appending new data to the end of the file and updating offsets to it though, so this is very strange indeed
Yeah, I've had the same feeling that it was something with the .arc editing since I couldn't really tell what I may have been doing wrong, but I wanted to make sure before saying it's not my fault but someone else's. Really impressed by the community hard work for creating tools, you truly are the best.
I'll be waiting for a workaround then, thanks.

Re: [P4G PC] Issue: Editing the script's text in .bf files

Posted: Fri Jul 10, 2020 4:32 am
by TGE
Try again with the latest version of Amicitia v1.9.4 as I recently fixed a bug that'd sometimes occur when saving ARC files.

Re: [P4G PC] Issue: Editing the script's text in .bf files

Posted: Fri Jul 10, 2020 4:58 am
by Nulla
TGE wrote: Fri Jul 10, 2020 4:32 am Try again with the latest version of Amicitia v1.9.4 as I recently fixed a bug that'd sometimes occur when saving ARC files.
I wasn't using 1.9.4 before, now I am and well... it looks different now I guess?

Image

So something has changed but it's still broken. All I did was replace the f008 and n008_002 in fd008_002.arc, there's nothing else in the mods directory.

Re: [P4G PC] Issue: Editing the script's text in .bf files

Posted: Fri Jul 10, 2020 6:48 am
by TGE
Hmm. Perhaps there's a bug in the CMR handling code.
Can you try replacing the files in the archive using PAKPack instead? You can get it from here: https://github.com/TGEnigma/AtlusFileSy ... y/releases
It's a commandline program though.. But you can view the usage instructions when you run it without arguments.