Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.FES file extract and repack Catsystem2 engine visual novel #5

Open
tbhoang12 opened this issue Jun 27, 2021 · 1 comment
Open

.FES file extract and repack Catsystem2 engine visual novel #5

tbhoang12 opened this issue Jun 27, 2021 · 1 comment

Comments

@tbhoang12
Copy link

Hi , when i'm using Garbro and extract fes.int in this game (which i'm thinking contains UI images for main menu and battle-gameplay part .hg3 files) >> I got a bunch of .fes files instead and can't extract it using Garbro
https://vndb.org/r71356

My question here is how to extract ,edit and then repack .fes files ? I just want to make a simple UI patch to play with Textractor (correct me if I'm wrong about the files contains UI ,because according to online guide I found , the UI images of games using CS2 engine normally is in image.int or sth like that but in this new game I did't see any using Garbro)
I can edit the script file scene.int using CatSceneEditor tool but stuck with UI images
SKMK English script

@tbhoang12 tbhoang12 changed the title .FES file extract and repack .FES file extract and repack Catsystem2 engine visual novel Jun 27, 2021
@trigger-segfault
Copy link
Owner

trigger-segfault commented Jul 8, 2021

I have a somewhat usable tool cs2_decompile.exe to extract FES (Front End Script) files into a text format. It can be obtained from the Decompile Tool link below, in my research repository.

Links

Decompile

As an example to decompile a single script meswnd.fes in the command line:

C:\>cs2_decompile meswnd.fes
:: CatSystem2 Script Decompiler
::  FES meswnd.fes -> meswnd.txt  (shift-jis)

By default, FES scripts are extracted in their original Shift_JIS text encoding, and it's recommended to keep it that way while modifying.

Modify

Once decompiled, you'll get a file that looks something like this. And they can be pretty massive >.>

Like this
// [...]
#MACRO
	PX 0
	PY 420
	VY 720

// [...]

#SYSVOICE
	if ($814>=900)
		if ($814==900) se2 load se900
		if ($814==901) se2 load se901
		if ($814==902) se2 load se902
		if ($814==903) se2 load se903
		se2 play 1 0
		break
	endif
	if ($781==0)

// [...]

#OBJECT FILE ID.0 ID.1 ID.2 ID.3 ID.4 ID.5 DISP PL PRI
img_autospd $str900 700 701 702 703 704 705 0 pl_base 410

#OBJECT FILE IDN
img_font userfont -1

#START
	deletebgbutton
	getconf 1026 messpd
	\110 = $1026
	call STRLAYOUT
	call NAMELAYOUT
	call WNDALPHA
	\200 = 1
	\201 = 1
	\202 = 1
	\203 = 1
// [...]

The documentation pages linked above should help a bit, but hopefully whatever you need to accomplish isn't too difficult, I haven't done nearly enough research into working with FES scripts. :(

Note: If you find the following in your decompiled FES script: STRING8, LOGSTRING8, NVSTRING8. Then you may run into extra hurdles when de/recompiling the script. I never figured out exactly how CS2 does it, but some FES scripts may contain both Shift_JIS text and UTF-8 text. (but don't bother worrying about that unless you're actually experiencing issues)

Recompile

Once you're done modifications, you can recompile it using the official CS2 devkit tool fes.exe, linked above. If you run into errors or unexpected behavior while compiling, you might need to emulate the Japanese Locale in a command prompt when running the Tool.

C:\>fes meswnd.txt
:: <japanese>(fes)<japanese> fes.exe
:: convert to fes -> C:\meswnd3.txt ... done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants