Jump to content

H-code for Enkou Shoujo


Deep Blue

Recommended Posts

So I'm trying to create a hook text for Enkou Shoujo https://vndb.org/v17048

I managed to somehow do it but the problem is that it just split it in 4 threads (not a big deal since I can merge them) but one of them(it's used from time to time) is dumping garbage code which is a problem once I merge the threads.
This is the code

/HW-4:-2@F8CEC:SiglusEngine.exe

So is there a way to merge the threads and create a code with them already merged and second separate the bad code from the good one?

(what I'm doing right now is enabling the global filter and add the letters so it can filter them but there is still some garbage code left)

BLpHKKC.jpg

 

Link to comment
Share on other sites

7 minutes ago, Kiriririri said:

You can hook the game with ITHVNR instead of ITH if you are interested in that.

If you still want to make a Hook-code then I can't help xD

I tried with ithvnr and it doesnt work at least not with the version I'm using... (well, kinda but it's way worst than the code that im using)

Link to comment
Share on other sites

23 hours ago, Deep Blue said:

So is there a way to merge the threads and create a code with them already merged and second separate the bad code from the good one?

If you come across this problem in the future again, the easiest way (meaning you don't need to search for a new code) is simply to delete every instance of garbage characters via regular expressions.
In this case, you have some patterns you can use to filter the hooked strings.
For example, all the garbage characters are ASCII characters, so you could search for all strings which consist of only ASCII characters. Thanks to Unicode using the same range for ASCII as SJIS, you can always use this expression for this purpose:

[\x20-\x7F]*

This would work fine if you never have ASCII in your game text. If this is too broad, you could also try to use underscores as a border marker since nearly every garbage line uses underscores in the beginning and the end of the string:

_.*_

This would delete everything except a "bu" before every important line in Thread 4, which is probably fine enough since these would be hooked anyway and don't interfere with your other threads. And you can be sure to never delete anything important because a VN script most certainly won't use the underscore character.

These are just some very simple examples to give you some pointers where to begin finding solutions the next you time have this problem.

23 hours ago, Deep Blue said:

(what I'm doing right now is enabling the global filter and add the letters so it can filter them but there is still some garbage code left)

Never do this. Use regular expressions instead. The only exception to this rule would be if there is only a small number of not common but very persistent characters.

17 hours ago, Deep Blue said:

can you upload it for me? I'm using 3.5640.1 and it doesn't really work :( 

Never overwrite ITHVNR releases. Every newer release might break something an older version was capable of. It has something to do with the way how VNR works from which ITHVNR steals its hooking algorithms.
It's different from the original ITH where every new release completely superseded the last.

Link to comment
Share on other sites

4 hours ago, Bolverk said:

Interesting @TyrosynI know of regex, but didn't know you could use it in ITH. How do you actually insert the regular expressions? Just paste them into the h-code bar? Or somewhere else?

You are not using the regex in ITH but in TA. ^^

You probably have a "Plugins" folder in your TA main directory. You can probably also find a "Replacements" folder in there in which a "names.txt" text files exists. This is used for regular expressions. Normally, it's used to substitute kanji names with romaji (hence the name), but you can use it for any substitution purpose really, which also includes simply the removing of garbage characters.

Every line in the names.txt is a regular expression with the regex first, then a tab, then the substitution. In my very simple examples here, the substitution would simply be nothing.

If you haven't installed TAplugin, you can also use the build-in substitution function of the core TA. It's essentially the same, but this time the file is located in the "dictionaries" folder as "UserDict.txt" and you can even use a GUI menu in TA itself to edit it (Tools --> Substitutions...").

The difference between names.txt and UserDict.txt is when and how it's applied. All UserDict expressions are read into memory at the time you open TA. If you have too much expressions in your file, TA needs longer to start up. But that also means that the UserDict.txt  substitutions are way faster than the ones you define in names.txt.
UserDict substitutions are applied before TA does anything else with the clipboard string. That means you won't notice it. (Before silly me knew about this feature, I always wondered why TA does some black magic with certain phrases. I later noticed I unknowingly installed a predefined UserDict ^^).
TAplugin substitutions can be computed before parsing or before translating. That means that the "Original Text" window will always contain the unaltered string (except you also use UserDict, be aware of that) while the translations will always be computed after applying the regex (obviously). You can choose whether to do the substitution before or after parsing the string with Mecab and JParser. The option is in your Taskbar Tray, search for the TAplugin icon.

I usually use names.txt because I like to have the option to (de-)activate specific regular expressions on the fly. You can deactivate everything by commenting out the line with an * and saving the text file with your editor of choice. Since the UserDict file is loaded into memory when TA initializes itself and not every time the clipboard updates, you can only deactivate substitutions as a whole during runtime.

By the way, VNR also has this feature. But it's a little bit clunkier here because the expressions are not saved in a text file but on the VNR server. TAHelper also uses a text file for substitutions. I don't think anyone uses this tool anymore though.

Link to comment
Share on other sites

21 hours ago, Tyrosyn said:

If you come across this problem in the future again, the easiest way (meaning you don't need to search for a new code) is simply to delete every instance of garbage characters via regular expressions.
In this case, you have some patterns you can use to filter the hooked strings.
For example, all the garbage characters are ASCII characters, so you could search for all strings which consist of only ASCII characters. Thanks to Unicode using the same range for ASCII as SJIS, you can always use this expression for this purpose:


[\x20-\x7F]*

This would work fine if you never have ASCII in your game text. If this is too broad, you could also try to use underscores as a border marker since nearly every garbage line uses underscores in the beginning and the end of the string:


_.*_

This would delete everything except a "bu" before every important line in Thread 4, which is probably fine enough since these would be hooked anyway and don't interfere with your other threads. And you can be sure to never delete anything important because a VN script most certainly won't use the underscore character.

These are just some very simple examples to give you some pointers where to begin finding solutions the next you time have this problem.

Never do this. Use regular expressions instead. The only exception to this rule would be if there is only a small number of not common but very persistent characters.

Never overwrite ITHVNR releases. Every newer release might break something an older version was capable of. It has something to do with the way how VNR works from which ITHVNR steals its hooking algorithms.
It's different from the original ITH where every new release completely superseded the last.

I will try this the next time then, seem very useful and I don't usually delete the ithvnr versions (I remember you told me this several times xD) but sometimes I just don't find them or I don't have them to begin with since most of the time the same one works always I don't bother with the others. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...