How to hook a Ren'py game with AGTH/ITH

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Bulopu
Newbie
Posts: 8
Joined: Thu Jul 10, 2014 3:45 pm
Contact:

How to hook a Ren'py game with AGTH/ITH

#1 Post by Bulopu » Thu Jul 10, 2014 9:19 pm

I want to use AGTH/ITH with a visual novel made with Ren'py for automatic translation need but I can't figure how to do that.

With AGTH used by Translation Aggregator, sometimes it says "Error: can't install hook", sometimes it "works" but the AGTH window disappears.
With ITH, I attached the process but it found no threads.

I don't know what to do while I heard it's easy to use AGTH/ITH with Ren'py.
Thank you for your help.

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: How to hook a Ren'py game with AGTH/ITH

#2 Post by Asceai » Thu Jul 10, 2014 10:09 pm

I'd say it would be quite hard, generally. Those tools typically look for OS calls to render fonts and stuff. Something like Ren'Py that does everything internally and produces textures of text would be largely opaque to these efforts.

I wonder if it would be feasible to inject a script (this is easy, just drop it in the game dir) that copies everything said with say statements to the clipboard...

Bulopu
Newbie
Posts: 8
Joined: Thu Jul 10, 2014 3:45 pm
Contact:

Re: How to hook a Ren'py game with AGTH/ITH

#3 Post by Bulopu » Thu Jul 10, 2014 10:30 pm

It's a VN made by me, a porting to be exact, for personal comfort but if I can't extract the text, it's useless.
Just to say that I have full access to the data so if you can write me a script or whatever to copy the text to the clipboard, I am 100% with you.

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: How to hook a Ren'py game with AGTH/ITH

#4 Post by Asceai » Thu Jul 10, 2014 10:42 pm

How about the 'extract dialogue' or 'generate translations' buttons in the launcher? Do those serve your purposes?

Bulopu
Newbie
Posts: 8
Joined: Thu Jul 10, 2014 3:45 pm
Contact:

Re: How to hook a Ren'py game with AGTH/ITH

#5 Post by Bulopu » Thu Jul 10, 2014 11:01 pm

I need to extract lines in live, when I read the VN, so "extract dialogue" is a no go. And most likely "generate translations" because my automatic translator need live data in the clipboard.

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: How to hook a Ren'py game with AGTH/ITH

#6 Post by Asceai » Fri Jul 11, 2014 12:29 am

Realised that there's no way to copy stuff into the clipboard in Ren'Py, so I guess that option is out. Well, I guess throwing win32clipboard in there somewhere could work...
EDIT: Although it's kind of a mess of files and I'm not really sure how to install it into Ren'Py's python.

Bulopu
Newbie
Posts: 8
Joined: Thu Jul 10, 2014 3:45 pm
Contact:

Re: How to hook a Ren'py game with AGTH/ITH

#7 Post by Bulopu » Fri Jul 11, 2014 1:06 am

Errr... I tried to follow your advice but it seems to me too hard for my level. In fact, I have no skills if we talk about python...

Before posting here, I found this thread where Elmiwisa said:
Elmiwisa wrote:Yes, it is very easy to do text hooking on Ren'Py games, in fact easier than some other VN engine.
So, I sent her a pm but her last post dates from "Thu Oct 31, 2013". I guess she is no longer active.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: How to hook a Ren'py game with AGTH/ITH

#8 Post by PyTom » Fri Jul 11, 2014 10:38 am

What are the options for how your translation tools can get their data?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Bulopu
Newbie
Posts: 8
Joined: Thu Jul 10, 2014 3:45 pm
Contact:

Re: How to hook a Ren'py game with AGTH/ITH

#9 Post by Bulopu » Fri Jul 11, 2014 10:48 am

What file? What line?
I don't want to spam you with a .rpy wall of text.
In fact, I don't think I touched this sort of option so, I guess they have their default values.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: How to hook a Ren'py game with AGTH/ITH

#10 Post by PyTom » Sat Jul 12, 2014 1:06 am

I guess the question is - if there was a small modification to make Ren'Py more translation-friendly, what would it be?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Bulopu
Newbie
Posts: 8
Joined: Thu Jul 10, 2014 3:45 pm
Contact:

Re: How to hook a Ren'py game with AGTH/ITH

#11 Post by Bulopu » Sat Jul 12, 2014 3:02 am

If you are asking me what to do to allow translator tool, it's simple, you need to copy each dialogue/narration in the clipboard.
For example, with that:
"他の勢力も含め、その迷宮とやらに群がっているのか"

play voice "voices/v_SR021_0003.a2402c79e742e832f21066f03c9df77c.ogg"
y "「はい。 中は階層構造となっている事が判明しています」"

"その迷宮には何かの秘密があるという事か"

p "「迷宮、ではなく迷宮を出現させた張本人を捕縛に向かっているかと思われます」"

"なるほど。たしかに強力なようだな"
Each time you click, you will have in the clipboard:
他の勢力も含め、その迷宮とやらに群がっているのか
click > 「はい。 中は階層構造となっている事が判明しています」
click > その迷宮には何かの秘密があるという事か
click > 「迷宮、ではなく迷宮を出現させた張本人を捕縛に向かっているかと思われます」
click > なるほど。たしかに強力なようだな

The clipboard must get the sentences in one time with no break even if the text speed is at "very slow".

If you want to improve that, you can add the y/p value defined in Character() with a special delimiter like:
[p_value] 「迷宮、ではなく迷宮を出現させた張本人を捕縛に向かっているかと思われます」
Let's be foolish, you said "options" so, if I would an option, it would be the possibility to choose the way the name of the character, if there is one, and the sentence are send to the clipboard, what delimiters I want to use, if I want or no to send the name of the character. Something like:
optionwhatshername= ### sentence >>> @character@
where sentence and character are the variables and the other strings like "### ", the delimiters.

Even if you can't avoid some garbage in the output, it's no big deal because there is a plugin who allow us to perform regex before translation. Even if you can just send something like:
p "「迷宮、ではなく迷宮を出現させた張本人を捕縛に向かっているかと思われます」" instead of just 迷宮、ではなく迷宮を出現させた張本人を捕縛に向かっているかと思われます
... idem, it's better than nothing.

Ah, you need to send the In-Game Menus. I don't know how menus work in Ren'py but if you have something like that on your screen:
Q/ What should I do?
1/ Drink coffee.
2/ Drink tea.
you can render that like that:
What should I do? Drink coffee. Drink tea.
With no break.

If you can do that, I would be very grateful to you. Basically, you just need to send the raw sentences to make me happy, you can implement the options later if you are busy.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Ocelot