Closed MishaIac closed 4 years ago
NUTEditor is a very basic tool and to do what you want you need of a Diassembler, the most near tool that is what you need is this one: https://github.com/darknesswind/NutCracker
But not sure if still works with new games.
Also, maybe you can open the script with a hex editor and manually edit the value that you found near the pitchSpaceFull
I tried it through the hex editor, but it breaks the script, and the game just doesn't work. NutCracker works with scripts from Tokyo Necro, but it doesn't support shift jis, and the output is this:
Is there any way to make NutCracker work with shift jis encoding? I tried it through Japanese local, it didn't help anyway.
He display that, but he corrupt the text? if not then just ignore and edit anyway
Yeah, he corrupt the text. It's not supposed to be like that. But it's the Japanese symbols, the rest is fine.
Probabbly here is where he read the text: https://github.com/darknesswind/NutCracker/blob/ed98f1a9209014e3d80a4168e814c24b3ad4dbf9/nutcracker/SqObject.cpp#L42-L44 If not, maybe here: https://github.com/darknesswind/NutCracker/blob/ed98f1a9209014e3d80a4168e814c24b3ad4dbf9/nutcracker/LString.cpp#L66-L70
If I knew the C++ programming language...
Anyway, I tried this version (https://github.com/darknesswind/NutCracker), and it doesn't work at all, even if I don't make any changes.
This version (older) works, but I didn't find the file LString.cpp
in it.
NutCracker.zip
You said this old version works, but why you can't use that?
You said this old version works, but why you can't use that?
Because all Japanese text turns into \x0083
and so on.
NUTEditor:
As you can see, there's a difference.
Here's the archive with one nut
from Tokyo Necro. Try to make it in txt
and look at what's in it and where the Japanese text should be.
Tokyo Necro nut.zip
Test this: 1 - Use the NutCracker to decompile 2 - Recompile the script without changes 3 - Decompile the recompiled script 4 - Edit the value that you need change 5 - Compile the script again in a new file 6 - With a hex editor (010 Editor for example have this feature), verify the diff bettwen the 2 recompiled scripts 7 - Probabbly now he will show only the changes that you need 8 - Find the same part of the script in the original one. 9 - Do the same changes. 10 - Enjoy.
Yeah, it helped. I was able to change the distance between the letters.
But now there's another problem. You don't know how to fix the word wrap? I've seen SRL have this feature, and I know that SRL works with Totono. I tried it with Tokyo Necro too, but SRL doesn't work at all.
The SRL only works to change the font size in this engine. The wordwrap is better a tool to automatically rewrite the scripts with wordwrap. Anyway you managed to edit the font of this Engine? There are more guys trying to edit it, if it's public will help if you share to me document how.
The wordwrap is better a tool to automatically rewrite the scripts with wordwrap.
I don't quite get it. Can I get more details?
Anyway you managed to edit the font of this Engine? There are more guys trying to edit it, if it's public will help if you share to me document how.
Not really. I just took the font from Sonicomi as it was Cyrillic, and then I just reduced the distance between the letters.
Hmm, the NUTEditor as you can see is a 'library', all that we need is a tool to apply wordwrap in the modified lines. This will require a little of skill with coding, you need check what lines changed in the 2 scripts to ensure to don't modify command lines, after that just do a wordwrap in the lines manually then put a breakline in the best place.
By the way, the old SRL (you can look in the secondary branch) have a tool to rewrite the scripts using the SRL, while he can apply the wordwrap to you, the only problem is that you must translate using .lst files without the command lines to prevent he break the line of commands.
Looks like it would be easier to put \n
manually...
By the way, the old SRL (you can look in the secondary branch) have a tool to rewrite the scripts using the SRL, while he can apply the wordwrap to you, the only problem is that you must translate using .lst files without the command lines to prevent he break the line of commands.
Can you tell me the specific version? Otherwise, while I'm looking...
you're looking in the master, switch to the DotNetFramework branch and you will found some tools.
Okay, well, I walked into that branch, but then what? I just don't know much about all this...
Or can you give me a direct link?
https://github.com/marcussacana/StringReloads/tree/DotNetFramework/Help the lstgenerator can be used to generate the .lst files the Debug Utility allow you use the SRL to process all lines of the game scripts (using the sacanawrapper) With that in mind you just need setup the SRL wordwrap, install the NUTEditor plugin and use the SRLTracer to rewrite the scripts using the genareted LST files
That's it. I was able to solve the problem with word wrap without SRL, through the game code.
As you can see, the text doesn't contain any \n
:
But still, thank you for trying to help me :D
@MishaIac could you explain how did you do that (the wordwrap)?
I know it's very late to share anything here but just wanted to share this for anyone wondering here like me. For me the string format inside of the squirrel .nut
files were plain old utf8. The issue with nutcracker was that windows forced utf16 encoding and everything was messed up.
for me the fix was:
in main.cpp
at the beginning of main()
SetConsoleOutputCP(CP_UTF8);
setvbuf(stdout, nullptr, _IOFBF, 1000);
and commenting the ascii check in Expressions.h
:
//if (c < 0x20 || c > 0x7e)
//{
// m_text += "\\x00";
// m_text += ToHex((c >> 4) & 0x0f);
// m_text += ToHex(c & 0x0f);
//}
//else
//{
m_text += c;
//}
Tested with Saya no Uta
, I still needed to skip the first 16 bytes (SCRP header) though.
I have this problem: I want to change the distance between the letters in the game, but to do this, you have to change the values of the parameter, but you can't do this with the NUTEditor.
NUTEditor:
The value I have to change:
What can I do in that case?
Game - Tokyo Necro (The font is in
.png
format, and the necessary letters have spaces in it)