Kein Posted June 20, 2019 Posted June 20, 2019 I know krkrz scene editor can be used to edit tjs2 but I'm trying to remove a line altogether and can't do it with krkrz scene editor. I've managed to decompile with tjs2Disassembler by xmoe but using his tjs2Compiler causes a crash without an error report. Quote
uyjulian Posted June 20, 2019 Posted June 20, 2019 You don't need to compile after editing TJS scripts. Just replace the file on the filesystem or the archive. Quote
Kein Posted June 21, 2019 Author Posted June 21, 2019 On 6/19/2019 at 9:22 PM, uyjulian said: You don't need to compile after editing TJS scripts. Just replace the file on the filesystem or the archive. Sorry, I mean for krkrz. If it's not compiled it will give a syntax error. Quote
uyjulian Posted June 21, 2019 Posted June 21, 2019 13 hours ago, Kein said: Sorry, I mean for krkrz. If it's not compiled it will give a syntax error. Is it a half width to full width conversion error? If so, save the script in UTF-16 with BOM. Quote
Kein Posted June 21, 2019 Author Posted June 21, 2019 (edited) 1 hour ago, uyjulian said: Is it a half width to full width conversion error? If so, save the script in UTF-16 with BOM. All the error says is "error at initialize line 1 Sytnax Error". This is what the compiled and uncompiled versions look like, the second works without any problems: https://i.imgur.com/7EHjmEn.png I've tried ctjs2 from here too: http://www.kaede-software.com/2013/02/tjs2_3.html But I get this error with Japanese locale: Edited June 21, 2019 by Kein Quote
uyjulian Posted June 22, 2019 Posted June 22, 2019 Did you try to use KrkrExtract to decompile the script? Quote
Kein Posted June 22, 2019 Author Posted June 22, 2019 12 minutes ago, uyjulian said: Did you try to use KrkrExtract to decompile the script? Yeah, it seems that is the problem. I've tried using both tjs compliers now on a decomplied startup.tjs that was included with krkr2bytecode and they compile without a problem. So I'm right now looking for a different method to decompile. Quote
Kein Posted June 22, 2019 Author Posted June 22, 2019 (edited) I've found out how to decompile and compile. First, Furikiri seems to be the only decompiler that exists for tjs, everything else is a dissembler. You can learn the difference here: https://ulysseswu.azurewebsites.net/post/Furikiri The main thing to know is that you can't use a compiler successfully on a dissembled tjs, only a decompiled one. I have uploaded the exes here, for people who don't know how to build it: https://mega.nz/#!3HZWTS4L!CFJ2xBI8hhHCPlcLfUz2ySvD725W6MFlg4_4WpSht1o To use girigiri.exe open the command line with shift + right click, then type "girigiri (tjs name + extension) --dec", or use --help to see all the commands. For compiling, I recommend xmoe's compiler over the official ctjs2: https://github.com/xmoeproject/KrkrExtract/releases (download from releases and the exe will be under Tool Sources) After you decompile you also have to change the encoding to UTF 16 (/ UCS 2) LE BOM. Like it says on the blog post, the decompiler will not usually work if the tjs is complex but this is the only option, overall I wouldn't recommend doing this if you can use use this instead: https://github.com/marcussacana/KrKrZSceneManager Edited June 22, 2019 by Kein Ulysses 1 Quote
Ulysses Posted June 29, 2019 Posted June 29, 2019 (edited) On 2019/6/23 at 4:45 AM, Kein said: I've found out how to decompile and compile. First, Furikiri seems to be the only decompiler that exists for tjs, everything else is a dissembler. You can learn the difference here: https://ulysseswu.azurewebsites.net/post/Furikiri The main thing to know is that you can't use a compiler successfully on a dissembled tjs, only a decompiled one. Basically you're correct, there is no "TJS2 decompiler"(*) other than my Furikiri. But Furikiri is not finished (the TJS2 language is a bloated, badly-implemented language after all), and currently the decompilation result can only be used as a reference of TJS2 bytecode's behaviour - that's already useful in my cases. You cannot expect the decompilation result can be directly compiled again, it's impossible for now. However, it might be more practical to implement a tool to compile the disassmbled assembly. Furikiri has a plan (issue) to do that, but I currently just focused on decompilation. Furikiri also provides the fastest TJS2 disassemble feature - definitely faster and more complete than the official one. That's the main feature of girigiri for now. (*): Xmoe said on weibo (at 2019-5-25) that he will release a tjs decompiler after a while. Maybe he can make a better tool than my shit Edited June 30, 2019 by Ulysses about other tools Kein 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.