Tutorial Ren'Py Enabling Developer & Command Consoles In Ren'py

worlingkit

Newbie
Jun 6, 2020
20
4
Unfortunately normal keyboards are useless on the phone (by normal I mean virtual, or display keyboards
And bla bla bla.
I came with 4pda and xda. I'm not a trembling creature, I have the right, Connect the physical! Bugagaga
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
9,949
14,548
guys please help how do i know what to enter in console command is there a list i can find somewhere
It totally depend of the game. So, if there's a list you can find somewhere, it's in the game thread that you'll find it.
 
  • Like
Reactions: DarkSoul99

firefly66

Newbie
Jan 26, 2019
79
59
guys please help how do i know what to enter in console command is there a list i can find somewhere
When enabled, you can use the variable viewer in the developer console (Shift-D) to find variables in the game. You can use the game console (Shift-O) to edit the variables.

Getting the name right is critical, so I recommend the following. Let's assume that there's a variable named "Fred" In the console, if you type "Fred" and return, it will show the current value of Fred. If you mistype, e.g., 'Fref', you get an error message. If you attempt to change the value of a wrongly named variable you will either edit the wrong variable (if it is defined) or create a new variable with the given value. Either could cause unknown and serious consequences at some point.

When you have the name correct, you can use the up/down arrows to navigate through your entries back to the Fred entry and edit it by appending, e.g., "=5", "+=2","-=3", etc. to modify the value. This way, you are guaranteed to not accidentally edit the wrong variable or create a new variable. For example:

Code:
>Fref
NameError: name 'Fref' is not defined
>Fred
3
>Fred=5
>Fred
5
>Fred+=2
>Fred
7
>Fred-=3
>Fred
3
 

Speedyg869

Newbie
Oct 11, 2019
33
6
Can the Developer disable the user from changing certain variables? Example: I enabled the console in 00Console and then started the game. I opened the console (Shift+O) and then entered sidneylibido = 15. Then I entered sidneylibido again (w/o a value) and it displayed 10.
 

Tlaero

Active Member
Game Developer
Nov 24, 2018
996
4,892
I have a question that is similar to what you folks have been discussing, but a little different. The default for config.developer is "Auto," and, in that mode, the developer commands work until you package the game for distribution.

Does anyone know how renpy knows that the game has been packaged for distribution? Is there a variable set in some file or something? More specifically, does anyone know how to make renpy think the game has not been packaged for distribution yet?

I packaged a VN I'm developing and accidentally deleted my original sources. It's easy enough to develop from the packaged version instead, with the exception of the config.developer part. I've set config.developer = True in my code, but now I've got to remember to remove that line before distributing the game. (You could argue that I should just leave it in developer mode. Although I don't mind knowledgeable people using developer mode, I think having it enabled for everyone will lead to confusion.)

So I'd like to convince Renpy that this VN hasn't been packaged yet. Anyone know the magic?

Thanks!
Tlaero
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
9,949
14,548
I packaged a VN I'm developing and accidentally deleted my original sources.
Next time, goes where Ren'py double the save files ("C:\users\[YOU]\AppData\Roaming\Renpy" on Windows), you'll find a directory named "backups". In there you'll find a shit tons of directory, including all your projects. And in the directory for your game project you'll find all the backup files. Use a filtering by date to find the most recent ones.


Anyone know the magic?
There's no magic at all.
When building the distribution, Ren'py add a file named "script_version.txt".
When starting the game, Ren'py search if there's such file, and assign its content to config.script_version.
Then if config.script_version have a value, Ren'py put config.developer at False.
dot.

So remove the file "script_version.txt", remove the line where you put config.developer at True, and you should be able to have the developer menu when using the SDK, and having it automatically disabled in the built distributions.
 
  • Like
Reactions: Tlaero

Tlaero

Active Member
Game Developer
Nov 24, 2018
996
4,892
When building the distribution, Ren'py add a file named "script_version.txt".
When starting the game, Ren'py search if there's such file, and assign its content to config.script_version.
Then if config.script_version have a value, Ren'py put config.developer at False.
dot.
Thank you! That's exactly what I was looking for. (Thank you also for the info on backups, but this helps me a ton.)

Tlaero
 

victor659

Member
Jan 9, 2019
145
184
I don't know if it is mentioned already but at some cases it is needed to have the ".rpy" files inside the game folder and not just the ".rpyc" files. Many games are delivered with only the ".rpyc" files or they have all the files included images to ".rpa" archives. You can get the files from an ".rpa" archive using the "unren.bat". To create an ".rpy" file from an ".rpyc" you need the "unrpyc" where you can find here
 
  • Like
Reactions: Zwart

ExploringTogether

New Member
Nov 21, 2019
2
1
Has something changed recently with the console command for dir()? Now I get a truncated list of in play variables rather than the full output. I've Goggled and searched here, but am not finding anything to extend the list.

Photo attached
 
  • Thinking Face
Reactions: Pigfarmer

ExploringTogether

New Member
Nov 21, 2019
2
1
Has something changed recently with the console command for dir()? Now I get a truncated list of in play variables rather than the full output. I've Goggled and searched here, but am not finding anything to extend the list.

Photo attached
Ah...never mind. I was able to find the switch in the 00console.rpy file to adjust the output of the console when it comes to listing variables and such. For those interested, please see below:

00console.rpy (Open in Notepad)
'Set this to the number of listed items desired - Default is 20 which is why you get the list and then , ...]
aRepr.maxlist = 250
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
9,949
14,548
For those interested, please see below:
Or you could have looked deeper into the said "00console.rpy" file and found the lines 680-687, or used the help command of the console.
Both would have told you that there's two commands, (short and long), designed especially to deal with this, shortening the result of a command when it's a too big one, or presenting it entirely.


aRepr.maxlist = 250
Ren'py itself have more than 600 variables/objects, putting "250" as value will not solve the problem you have with dir, it will just make you miss the "..." in the middle of the display.
It also limit the effectiveness of your change to the sole lists. Tuples, dictionaries, even strings, will still be shortened ; what wouldn't happen if you use the command created for this
 

bigboxbarry

Member
Feb 3, 2018
300
274
so i turned on console command in the 00console folder but for some reason when i shift+0 it dosent work. if i changed it from false to true then it should work. any suggestions?
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
9,949
14,548
He/She is just making sure you are using the letter and not the number (which was in your post and will never work).
And he was also probably putting the emphasis on the fact that it's the letter, not the key.
 

Jafo

Member
Oct 8, 2017
102
108
I have another question abou savegames. Is there a simple way to add a variable. In the game I am playing right now I missed something and want to add the variable to the latest savegame I have.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
9,949
14,548
I have another question abou savegames. Is there a simple way to add a variable. In the game I am playing right now I missed something and want to add the variable to the latest savegame I have.
You don't add it to the save game, but to the current play. What is in fact the same, just the logic behind change.
Let's say that you want "kissedThisGirl" to be "True", because you missed the opportunity to kiss this girl. Open the console, type kissedThisGirl = True, then validate.
 
  • Like
Reactions: Jafo