Tutorial Ren'Py Fixing Errors in Renpy Games

Moricano

Well-Known Member
Jan 30, 2019
1,666
1,126
I've seen this forum many people complaining about errors in games "Renpy"
Tool to fix and edit this.
Use Notepad ++

Steps to follow:
1- Always have 2 text files of the game, the Original and the Translated.

2- Get the file that gave error that will be in the document name (traceback)

3- Example - (Full traceback:
File "renpy / common / _layout / screen_load_save.rpym", line 35, in script
$ ui.interact ())

4- Open the Original File in Notpad ++ and also open the same file that gave error in Notpad ++.

5- Check the line that gave error in the example above will be in (game / screen)

Compare one file with the other and correct the original and save your work.

7- I do this step in all files that gave error, do not forget to look at the path or address .... because errors can give only one file or maybe in several.

8- Once you correct everything, delete the generated file from your game folder or the name (traceback)

Always try to load all games as Administrator.
To do this - Click the game's executable icon Right-click / Properties / Compatibility / Below the Privilege level check box - Run this program as administrator - from an Apply and close the file.

Going back to step 8 after deleting upload the game and upload a saved file near where you gave the error.

11- Usually this solves by correcting the errors if everything is right as explained here.

12- There are certain files that cannot be corrected because it is an error that only the creator of the game will be able to correct, it is an error that causes the game to break due to some line-writing-comma-space- or code that was injected into the game. wrong place at the time the game was being made, and this can only be fixed if the Author of the game makes a patch to correct such a break.

I hope this makes your life easier.
Thank you all for the attention.
Dowmload Notpad++ Here
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Language - Português Br

Corrigindo erros em jogos Renpy

Já vi neste forum muitas pessoas reclamando de erros em jogos "Renpy"
Ferramenta para consertar e editar isto.
Use o "Notepad ++

Passos a seguir:
1- Tenha sempre 2 Arquivos de texto do jogo, o Original e o Traduzido.

2- Pegue o Arquivo que deu erro que vai estar no documento de nome(traceback)

3- Exemplo - (Full traceback:
File "renpy/common/_layout/screen_load_save.rpym", line 35, in script
$ ui.interact())

4- Abra o Arquivo Original no Notpad++ e abra tambem o mesmo arquivo que deu erro no Notpad++

5- Verifique a linha que deu erro no exemplo acima vai estar em( game/screen)

6- Compare um arquivo com o outro e corrija pelo original e salve seu trabalho.

7- Faço este passo em todos os arquivos que deu erro, não esqueça de olhar o caminho ou endereço.... pois erros podem dar em um arquivo somente ou talves em varios.

8- Assim que corrigir tudo, exclua o arquivo gerado da sua pasta do jogo o de nome (traceback)

9- Procure sempre carregar todos os jogos como Administrador.
Para fazer isto - Clique no Icone Executavel do jogo botão Direito do Mouse/Propriedades/Compatibilidade/ Abaixo na descrição Nivel de Privilégio Marque a caixa - Executar este programa como administrador - de um Aplicar e feche o arquivo.

10- Voltando no passo 8 depois de excluir carregue o jogo e carregue um arquivo salvo perto de onde deu o erro.

11- Geralmente isto resolve corrigindo os erros se fizer tudo certo como expliquei aqui.

12- Existe certos arquivos que não são possiveis corrigir porque é erro que só o proprio criador do jogo vai poder corrigir, é algum erro que faz dar quebra no jogo devido a alguma linha- escrita- virgula- espaço- ou codigo que foi injetado no lugar errado na hora que estava se fazendo o jogo, e isto só é possivel consertar se o Autor do jogo fizer alguma patch para corrigir tal quebra.

Espero que isto torne sua vida mais facil.
Obrigado pela atenção de todos.
Download Notpad++ Aqui
 

Penfold Mole

Engaged Member
Respected User
May 22, 2017
3,117
7,614
Sorry, I didn't bother to read through all of it, but I'd like to say one really important thing though:

Never-ever run Ren'Py (game or SDK) as an administrator and you highly likely never need to run it in compatibility mode, either.

1. Because there is no need to do that in the first place. Ren'Py is working perfectly in limited user rights. It's a modern Python-based software that is designed to run safely without administrative rights or compatibility mode.
2. Because it's never a good idea to run non-administrative software with administrative privileges, unless there is no other way and you really-really have to (one of the very basic rules for every OS there is)

Just make sure you have correct permissions for the folder you placed your Ren'Py SDK or a Ren'Py game to. The easiest way to be sure of that is to put it into one of the subfolders inside your user profile folder. ("%userprofile%" folder, Documents folder, Desktop folder or one of the others)

In case you have problems running Windows command line in there because of some exotic characters in your user profile folder name, you can create a folder somewhere else, closer to the drive root ("C:\games" or whatever you like)
Just make sure to set correct NTFS privileges to that folder before you proceed with anything. If you don't know how, just google for "Windows <version> take ownership", "Windows 10 take ownership" for example. Web is full of instructions about it, one better than the other.
When you have set ownership to yourself on that folder, there is no need for administrative rights for Ren'Py. Just run everything as yourself and without compatibility mode.
 
Last edited:

scrumbles

Well-Known Member
Jan 12, 2019
1,069
1,096
1- Always have 2 text files of the game, the Original and the Translated.
Wait, are you translating the game like that? By editing the original files? Do you know that Ren'py has built-in translation tools and they would make your job much easier (especially when you are translating a game that is not finished yet)? If you want to know more about this, read havenest's tutorial.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,963
16,201
1- Always have 2 text files of the game, the Original and the Translated.
I'm totally confused here. Ren'py translation works with separated files that contain only the dialog lines. How can you end with two versions of the code ?


2- Get the file that gave error that will be in the document name (traceback)

3- Example - (Full traceback:
File "renpy / common / _layout / screen_load_save.rpym", line 35, in script
$ ui.interact ())
The culprit is never in the renpy directory. Please, don't let the readers think that it's OK to edit the core of the engine to correct a bug. They'll break the game even more, and just exceptionally fix it. And once they'll have broke it, whatever how many of us will come to their help, there's rarely chance to turn back.
Plus, Ren'py traceback show where the error implied a problem, not necessarily where the error effectively is.


5- Check the line that gave error in the example above will be in (game / screen)
Personally I got it, but do you really think that every reader will pass like that from 'File "renpy/common/_layout/screen_load_save.rpym", line 35' to "oh I should look at the loading screen in the game/screens.rpy" file ?

[Edit]
Wait, are you translating the game like that? By editing the original files?
Wait, what ? Especially a game like Long Live the Princess that have a complex game mechanism and probably see many changes in parts previously released (and so previously translated).
 
  • Like
Reactions: Penfold Mole

Belle

Developer of Supermodel & Long Live the Princess
Game Developer
Sep 25, 2017
3,189
10,603
I found this thread just now because my game's name was mentioned, and wow... It's hard to find the proper words.

We should let this thread stand as excellent advice on what to not do, ever. Seriously, do not follow the advice in the original post. There is a proverb that says: "A little knowledge is a dangerous thing." This thread is a perfect example of what that phrase is talking about.
 

Penfold Mole

Engaged Member
Respected User
May 22, 2017
3,117
7,614
We should let this thread stand as excellent advice on what to not do, ever. Seriously, do not follow the advice in the original post.
I'm sorry, but I can not agree with you here :(. There is one ;) thing that is not bad per se and it's the suggestion to use Notepad++ to edit rpy (or any kind of plain text files, really).
Just for Ren'Py scripts it can be improved a bit by adding userDefineLang.xml file to "%appdata%\Notepad++" and set tab key to insert 4 spaces instead of one tab character:

functionList.xml for the current version of Notepad++ is too old there, attached file is updated for the current version. Goes into the same folder ("%appdata%\Notepad++"). Rename the file to remove random numbers and underscore character from the file name, added there by the forum software here.
 
  • Like
Reactions: scrumbles

Belle

Developer of Supermodel & Long Live the Princess
Game Developer
Sep 25, 2017
3,189
10,603
Even that is probably not a good idea. While Ren'py supports all kinds of editors, unless you have a specific reason to use a particular one, you're best off following the recommendations by the developers themselves. For the moment, that means Atom. I use Notepad++ all the time, just not for Ren'py.
 
  • Like
Reactions: Moricano

Moricano

Well-Known Member
Jan 30, 2019
1,666
1,126
Wait, are you translating the game like that? By editing the original files? Do you know that Ren'py has built-in translation tools and they would make your job much easier (especially when you are translating a game that is not finished yet)? If you want to know more about this, read havenest's tutorial.
I will try to see if I understand these articles you gave me, to see if it makes my life easier in translations thanks friend for the tip.
 

Moricano

Well-Known Member
Jan 30, 2019
1,666
1,126
Even that is probably not a good idea. While Ren'py supports all kinds of editors, unless you have a specific reason to use a particular one, you're best off following the recommendations by the developers themselves. For the moment, that means Atom. I use Notepad++ all the time, just not for Ren'py.
I always used only Notepad ++ already got used to it, tried to use such Atom but could not work with it I do not think it is lacking in custom.
 

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,327
22,774
Even that is probably not a good idea. While Ren'py supports all kinds of editors, unless you have a specific reason to use a particular one, you're best off following the recommendations by the developers themselves. For the moment, that means Atom. I use Notepad++ all the time, just not for Ren'py.
There is absolutely nothing wrong with using notepad ++ for renpy. Atom is a recommendations by pyTom because he uses it, it's his preference, nothing more.
 

Moricano

Well-Known Member
Jan 30, 2019
1,666
1,126
Personally I got it, but do you really think that every reader will pass like that from 'File "renpy/common/_layout/screen_load_save.rpym", line 35' to "oh I should look at the loading screen in the game/screens.rpy" file ?
Yes I agree that not all players will waste time in reposting each line, but for those who do not know and want to correct the error I think this system I quoted is the best to correct or error.
There is also a possibility that at the time of error you can ignore that the game proceeds without crashing.
In my case whenever I translate games I enter the game and do a test everything if I give error already open and correct.
Although now I'm used to mecher in everything I know what can and can not translate.
 

Moricano

Well-Known Member
Jan 30, 2019
1,666
1,126
I found this thread just now because my game's name was mentioned, and wow... It's hard to find the proper words.

We should let this thread stand as excellent advice on what to not do, ever. Seriously, do not follow the advice in the original post. There is a proverb that says: "A little knowledge is a dangerous thing." This thread is a perfect example of what that phrase is talking about.
Yes I agree with the phrase.
But it was just an impulse to make it easier or faster to break the error, it can also be ignored the error that the game proceeds well.
In my case I like things well done I think I'm kinda peferccionista.lol
 

Moricano

Well-Known Member
Jan 30, 2019
1,666
1,126
Sorry, I didn't bother to read through all of it, but I'd like to say one really important thing though:

Never-ever run Ren'Py (game or SDK) as an administrator and you highly likely never need to run it in compatibility mode, either.

1. Because there is no need to do that in the first place. Ren'Py is working perfectly in limited user rights. It's a modern Python-based software that is designed to run safely without administratvie rights or compatibility mode.
2. Because it's never a good idea to run non-administrative software with administrative privileges, unless there is no other way and you really-really have to (one of the very basic rules for every OS there is)

Just make sure you have correct permissions for the folder you placed your Ren'Py SDK or a Ren'Py game to. The easiest way to be sure of that is to put it into one of the subfolders inside your user profile folder. ("%userprofile%" folder, Documents folder, Desktop folder or one of the others)

In case you have problems running Windows command line in there because of some exotic characters in your user profile folder name, you can create a folder somewhere else, closer to the drive root ("C:\games" or whatever you like)
Just make sure to set correct NTFS privileges to that folder before you proceed with anything. If you don't know how, just google for "Windows <version> take ownership", "Windows 10 take ownership" for example. Web is full of instructions about it, one better than the other.
When you have set ownership to yourself on that folder, there is no need for administrative rights for Ren'Py. Just run everything as yourself and without compatibility mode.
Yes I totally agree with you friend.
I just mentioned the administrator question because I recently spent time using these types of games.
I worked on TriboGamer translations help and learned one thing there ... about always applying admin to all exe games.
But now that I hear about your tip for this type of game I am less carefree.
I appreciate the collaboration.
 
  • Like
Reactions: Penfold Mole

Moricano

Well-Known Member
Jan 30, 2019
1,666
1,126
I'm totally confused here. Ren'py translation works with separated files that contain only the dialog lines. How can you end with two versions of the code ?
I didn't understand your vision very much.
But when I open the file to be translated does not contain only texts ..... along with the text has all the parameters together ...
Example - A line of text starts like this.
mc "I ... I was ..."
mc "I was using this to protect myself ..."
mc "I ..."
mc "I heard a noise ..."
mc "I heard something outside ... maybe a burglar .."
If at the time of translating you add a space at the end or accidentally delete a symbol like this ... "will break the reading of the game load.
I recently started working on this type of game and am getting a little bit to understand a lot of things, but the little I learned from the mistakes added more practice.
I'm used to working with game style translations (Elder Scrolls V Skyrim Legenday) this kind of game.
 

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,327
22,774
I'd say engrish is the problem here. It's hard to understand what you actually mean Moricano The way you explained it in the op is not correct and barely understandable in english.
 

scrumbles

Well-Known Member
Jan 12, 2019
1,069
1,096
I will try to see if I understand these articles you gave me, to see if it makes my life easier in translations thanks friend for the tip.
If you want to see how the final game will look like, you may download for instance House Arrest: all the translations are stored into the "game\tl" folder. They are just list of strings, extracted for you by the Ren'py SDK and ready to be translated. Also, if the original script changes, Ren'py will detect the new sentences and just add them at the bottom of the translation files: you don't need to check the line numbers, comparing the versions and so on. Everything is fucking easier.
Btw, I mentioned that particular game because the events have a (partial) Portuguese translation (actually the author is brazilian, iirc).

I'm sure you will learn the ropes in the blink of an eye. ;)
 

Moricano

Well-Known Member
Jan 30, 2019
1,666
1,126
Even that is probably not a good idea. While Ren'py supports all kinds of editors, unless you have a specific reason to use a particular one, you're best off following the recommendations by the developers themselves. For the moment, that means Atom. I use Notepad++ all the time, just not for Ren'py.
--------------------------
From what I saw you are a developer I appreciate this and I need an extra tip.
When I translate these types of games I go crazy due to not knowing how to leave only the texts, without the parameters that hinder a lot .... Parameters I say are the codes inserted with the texts these types so
label basement2am:
hide screen locations
scene black
$ dtime = 2
"You wake up."
pov "{i} Huh? Did I hear anything? {/ i}"
pov "{i} No. This was nothing. {/ i}"
"You fall asleep again."
with vpunch
Seeing so many codes along with the text I wish I could hide these parameters to see only the texts this the way it is very difficult to translate because if you accidentally delete something or give a space in the end by accident also crash on loading.
I only use Notepad ++ but there is no way to hide any of it.
Do you know any editor that leaves hidden and shows only the texts?
 

Moricano

Well-Known Member
Jan 30, 2019
1,666
1,126
If you want to see how the final game will look like, you may download for instance House Arrest: all the translations are stored into the "game\tl" folder. They are just list of strings, extracted for you by the Ren'py SDK and ready to be translated. Also, if the original script changes, Ren'py will detect the new sentences and just add them at the bottom of the translation files: you don't need to check the line numbers, comparing the versions and so on. Everything is fucking easier.
Btw, I mentioned that particular game because the events have a (partial) Portuguese translation (actually the author is brazilian, iirc).

I'm sure you will learn the ropes in the blink of an eye
Thanks ... I really need to learn a lot of things I'm writing down everything you are giving me to study and try to understand.
I will analyze this game you mentioned and follow your steps to see if I understand ..... thanks ...
 
  • Like
Reactions: scrumbles

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,963
16,201
I didn't understand your vision very much.
But when I open the file to be translated does not contain only texts ..... along with the text has all the parameters together ...
I don't think someone gave the link, so the page of regarding translation. Which is what I mean and what you should read before continuing to do translation. Not that I'm against the idea of a translation, whatever the language but because, like scrumbles implied, it will really ease your works when you'll do it correctly.


I'm used to working with game style translations (Elder Scrolls V Skyrim Legenday) this kind of game.

Ren'py have really nothing in common with Gamebryo, even the Bethesda's modified version. And in this discussion, the main reason is that Ren'py offer a native translation system.
You don't even need a dedicated thread, just post on the game thread to give the link to the translation files, then add a mod to update the OP. Then player using the translation can at anytime during their play, pass from English to Portuguese, Portugues to English, without the need to do more than click on a button (that you have to add).
It doesn't matter if you're a little late for the update of the translation, the file will still works, just presenting in English the dialog that haven't been translated.


[...] I think this system I quoted is the best to correct or error.
No. Sorry to say that, but presented like that, it's one of the worse, and Belle is right when saying that it's more an example of how not to fix an error, and how not to translate a game ; which isn't a problem by itself, you just still have to learn and, more important, are apparently whiling to to it.
It works, more or less, in your particular case, where there's two original files (your translation and the original game) and the error is due to the translation. But for all the other cases, so 99% of the "there's an error in this game", it will not effectively works.
You encountered easy to fix errors, because you're only working on translation and by default don't touch to the code, but those are exceptions.

Just take a classical (quoted from memory), "_menu screen not found". Most of the time it's due to the enabling of the developer mode, and in 100% of the case, the said "_menu screen", exist, can be found, and have absolutely nothing to see with the error.
There's also the classical case of recursion :
Code:
define m = Character( "[m]" )
[...]
    $ m = renpy.input( "John" )
that throw an exception totally not related with the effective error, and can throw it three months after the wrong line was effectively wrote. If my memory don't betray me, there's one person in this thread that encountered it.
Same for the last fix I've done, two/three days ago, because a dev used my Dynamic String Patcher, but didn't updated the definitions. If you're not me (yet it took me time to understand the cause), or don't take a look at the code of the said patcher, you'll never found, nor understand, why you've "I FORGOT TO SET THIS" that appear on the dialogs. It's obviously a bug, and at least two people reported it, but you can look at the dialog line and the code of the game all you want, you'll not find the reason.
Fixing bugs is way more complicated that just reading the traceback. I think I said it above, half of the time what you see in it say nothing about the real error, and don't even have, among the many lines listed, the line where the said error really is. Take this, that's the last traceback of a mod I'm working on :
File "game/AONmod.rpy", line 1503, in keywords
if p() + AONcounter > 10:
File "<screen language>", line 1503, in <module>
TypeError: coercing to Unicode: need string or buffer, int found
Now, if with this you can tell me that the error come from the line X of another file (not listed in the traceback), where a variable, conditionally returned by the p function, is overwrote by a string, well you're better than me. Took me 10 minutes and a lot of debug text to find it.
And this is the kind of error people report concerning games. Like I said previously, the traceback show where the error break the game, not where it effectively is located.