Ren'Py
Helpful Tools:
- Visual Studio Code
- "Ren'Py Language" Extension for VSCode
I've recently written quite a
lenghty post which actually inspired me to write this guide. RenPy is definitely the most fun engine of the ones listed above, due to its developer tools and console. They are the most powerful tools you could ask for that come packed with the game. The Dev Tools literally let you view the state of the game, while the console lets you run any python code. So this first part of the guide isn't really a hack, but more a tutorial on how to access these two tools.
Enable Developer Tools
Open the game in question, and navigate to the
renpy/common/ folder. Inside this folder you will find a file called
00library.rpy open it with VSCode (or any other code/text editor) then search for a line
config.developer.
You should find the following line:
Change that entire line to simply read:
Bare in mind python is a language that cares about the indentation (the spaces to the left of the text). So you
MUST ensure that the
config.developer line is in line with the other config lines.
Save the file, and run your game. You now have access to the Developer Tools via the
SHIFT + D keybind AND
SHIFT + O console. The developer config is the highest level of permission essentially. So you don't need to enable the console - at least for most modern games. So if you've set this up and both keybinds are working, you can safely skip the next step about enabling the console.
Enable Console
Open the game in question, and navigate to the
renpy/common/ folder. Inside this folder you will find a file called
00console.rpy open it with VSCode (or any other code/text editor) then search for a line
config.console.
You should find the following line:
Simply change the
False to
True. That's it. Save the file open the game and boom, You now have access to the Console via the
SHIFT + O keybind. Some games may require you to enable both, or only give you an option to enable one or the other.
Variable Viewer
Firstly, lets get into our game and open the Developer Tools with
SHIFT + D. Once the developer tools are open, press the
Variable Viewer button. The variable viewer is the bread and butter.
In here you can view all the variables that are currently in memory and see what value is assigned to them. It's in here that we will find the variables we want to change. There's also the
Persistent Viewer which shows you the persistent variables, think of these as global state variables. This could be things like gallery unlocks, or key story flags that need to be saved. Most of the time though, you will be looking at the normal
Variable Viewer.
Key thing to note about the variable viewer, is that we mainly use it to get a feel for the variable names, and the structure of the game. We can access all this information in the console as well - and we will be using the console to view/change these variables very soon - but the variable viewer is a nice visual way to explore the variables without needing to type anything or guessing things. This is normally where I would start when trying to cheat a RenPy game. Just open the variable viewer and look for interesting variables names.
Console
If the
Variable Viewer is the bread and butter, then the
Console is the steak dinner with a nice glass of wine. The console is where we will be doing most of our cheating. The console allows us to run any python code we want, and since RenPy is built on top of python, we can access all the game variables, functions, classes, etc. directly from the console. This is where the real power lies. Open it with
SHIFT + O or via the
Console button in the developer tools.
The console can be scary. Afterall it is just a blank ">" prompt and you probably have no clue what to type in. But lets not panic yet. If your game allowed you to access the developer tools, then you should already have a variable in mind that looks juicy. So
for this example we are playing
Doomination v0.3.8 (purely because its the one I've most recently made a post about). Now, in RenPy you will encounter two types of variables. Simple variables like integers, strings, booleans, etc. and complex variables like lists, dictionaries, classes, etc. If the variable you are looking at is a simple variable, lets say the
dgg_pt1 boolean variable which tracks the nude versions of the characters you've unlocked. You can simply type the following into the console to change its value:
This will set the variable to True, effectively unlocking the nude versions of the character. Simple as that.
REMEMBER: these variable names are only relevant to Doomination game. You will have different variables with different names!
I've looked through the variable viewer and I found a juicy variable called
inventory. This variable is a class. You can tell its a custom class because when you write it in the console you get a response like this:
Other games will have other types of complex variables, but normally when you see
object at 0x.... its a custom class. Now to figure out what this class contains, we can use the built in
dir() function. This function will list all the attributes and methods of an object. So we can type the following into the console:
You can see that this class has a bunch of attributes and methods. Its not very user friendly, but you can mostly deduce from the names what they do. Probably the most interesting attribute here is
items and
money as for the methods we have
add_item() and
earn_money(). So let's check out what the
items attribute contains. We can do that by typing:
Its a list! A list of custom classes though. But we already know how to explore those. Lets check out the first item in the list:
Side note: In python, lists are zero indexed. So the first item is at index 0, the second at index 1, etc.
You can see that this item has attributes like
name,
description, etc. So we can check out the name of the first item by typing:
In my case that gives me "BROKEN ARMOR". That's all great, but you probably want to add items to your inventory. Well the item has an attribute
itemcount which you can change directly like so:
Code:
inventory.items[0].itemcount = 99
This will set the item count of the first item to 99. Usually, this is enough to cheat your way through the game.
But what if you want to add a new item that you don't already have? Well, this is usually more tricky, so I would suggest you to avoid this path if you dont have to, BUTTTTTTTT... We do have the
add_item() method. We can use that method to add a new item to our inventory. But we need to know what parameters it takes. Now, there's 2 ways to figure this out.
First. We already looked at the
inventory.items this has shown us a list of
<store.Item object at 0x...>. So the class is called
Item and since we have access to the source code, a simple search for
class Item will lead us to the definition of this class. Here we can see the
__init__() method which is the constructor for the class. This method shows us what parameters are needed to create a new item.
Second. We can use the built in
help() function to get more information about the method. So we can type:
Unfortunately, in this case the help function doesn't give us much useful information, this is usually due to the developer not adding comments to their code - which for cheating is technically a good thing, but in the real world you should comment your code

- But in other cases it might spit out something useful, so always worth a try.
Now that we know what parameters are needed to create a new item, we can call the
add_item() method like so:
Code:
inventory.add_item(Item("ITEM NAME"))
Now I've actually created a new item called "For The Lols" and it was added to my inventory. This item doesn't actually do anything since I've not actually defined any of its attributes properly, but it shows you the process of how to add new items to your inventory. You can essentially create your own items this way that are totally broken.
But what if you wanted to add an existing item? Well, here you most likely need to look in the source code. Since we know the method and class that we are interested in, we can just search the entire source code for
add_item() and see where it's used.
In this case, I found it being used in lots of files, and lucky for me the developer has created a
items.rpy file which contains all the item definitions. So I can just copy the definition of an item and add it to my inventory like so:
Code:
inventory.add_item(SEXTOY_DOOM6000)
Each game will be different, so you might need to explore the source code a bit to figure out how to add existing items, but the process is generally the same. Find the class definition, find how its instantiated, then use that information to create or add items via the console.
As for the other interesting attribute we found, the
money attribute. It's a simple data type so we can simply set that directly like so:
or via the
earn_money() method like so:
Code:
inventory.earn_money(999999)
And that's it! You've successfully cheated a RenPy game using the developer tools and console. From here you can explore more variables, functions, classes, etc. and see what else you can manipulate to your advantage. Happy cheating!
Extras - Fancy Python
So I've already mentioned that the console allows you to run any python code. This means that you can do more than just manipulate variables. You can also call functions, create new objects, etc. You can even write python code to do fun stuff for you. Lets take our inventory as an example. Specifically the
inventory.items list. What if we wanted to print out all the items in our inventory along with their item count? We can do that by writing a simple for loop in the console like so:
Code:
for item in inventory.items:
print(f"{item.name}: {item.itemcount}")
If you run that code in the console, it will print out all the items in your inventory along with their item count. You can get really creative with this. You might also want to print out the index of each item so you can easily reference them later. You can do that by using the
enumerate() function like so:
Code:
for index, item in enumerate(inventory.items):
print(f"{index}: {item.name}: {item.itemcount}")
If you know even a little bit of python, the possibilities are endless. You can write scripts to automate tasks, manipulate game state in complex ways, etc. The console is your playground. Have fun with it!
Extras 2 - Source Code and Decompiling
I realise I've not made it abundantly clear. Don't be scared to go into the game files. All the rpy files are there for the taking. You can simply view all the code for yourself and find how everything works. You found a menu that takes a patreon code? Search for the text in that menu across the entire game folder, you will find where its used and what it references, what codes are supported. If it's using hashing, you can always edit the function so that you rename the codes (See my SugarCube example on how to do that, although in a different engine, the methods are identical). World is your oyster and the code is all there for you to view.
If the game you are viewing is actually obfuscated or the rpy files are compiled into gibberish, you may need to decompile them before being able to view them. There are many tools online for this, I believe the most popular is
You must be registered to see the links
. You will have to refer to its instructions as I think it's out of scope for this guide. Point is it's just a slowdown mechanic and doesn't actually achieve much. Just decompile the code and apply all the above as normal. Funnily enough, usually you don't even have to compile the code back. You can just play the game on decompiled files

which makes it easier to inject code into it.