A downloadable tool

This template includes VSCode launchs for developing Ren'Py projects.

Git Repo: DRincs-Productions/debugger-renpy

What can be done:

  • Add $ print("...") to display them in the vscode terminal while the app is running
  • Don't have to open Ren'py SDK every time
  • Close the game with CTRL+C in the terminal or when closing VSCode

What cannot be done:

  • Insert breakpoint

Install

How Run Debug

As shown in the image there are several launches that are added

image

In any case, if you have never used VS Code Debugging I recommend you read first: Debugging

Setup

( Necessary only in the beginning )

It will create the .renpy-sdk file in which the path to your Ren'Py SDK folder is written.

After you launch it, paste the path to your Ren'Py SDK folder Exemple: /home/username/renpy

Run

Select:

  • Run or
  • Force Recompile & Run

And Play!

Possible problems

A strange error screen opens (tiny file dialogs)

image

This happens when renpy tries to open the error file and the operating system does not have a program capable of opening a txt from the terminal.

The solution is to install a program to open these files. For example yad

sudo apt-get install -y yad 

After an error CTRL+C doesn't work

This happens in case the error log is opened for editing with VIM.

In this case you must write the following sequence of characters to close the file: :q

Linux commands

Give renpy permission

Almost certainly when you start debugging for the first time, it will give you an error because some files do not have "authorization" to be executed.

To fix this you need to run the following commands in the Renpy SDK folder

chmod +x renpy.sh 
chmod +x renpy.py 
chmod +x renpy.exe 
chmod +x lib/py3-linux-x86_64/renpy 
chmod +x lib/py3-linux-x86_64/pythonw 
sudo apt-get install -y xdg-utils 

Installing PowerShell on Ubuntu

https://learn.microsoft.com/en-us/powershell/scripting/install/install-ubuntu?view=powershell-7.3

# Update the list of packages 
sudo apt-get update 
# Install pre-requisite packages. 
sudo apt-get install -y wget apt-transport-https software-properties-common 
# Download the Microsoft repository GPG keys 
wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb" 
# Register the Microsoft repository GPG keys 
sudo dpkg -i packages-microsoft-prod.deb 
# Update the list of packages after we added packages.microsoft.com 
sudo apt-get update 
# Install PowerShell 
sudo apt-get install -y powershell

Use microsoft wsl

You can also debug on WSL.

But there might be some problems while opening the GUI of WSL. It depends on the compatibility with your graphics card. Read: https://docs.microsoft.com/it-it/windows/wsl/tutorials/gui-apps

Files

  • bin/renpy.ps1: Script for calling Ren'Py SDK
  • bin/set-origin.sh: Git setup helper to configure your local folder to sync to a remote host
  • .vscode/launch.json: Launch for launching Ren'Py SDK commands without opening the Ren'Py launcher.
    • Setup (custom file for remembering your project's SDK path for commands to work)
    • Run
    • Force Recompile & Run
    • Delete Persistent
    • Lint
    • Distribute

Download

Download
debugger-renpy v1.0.3 2.5 kB

Comments

Log in with itch.io to leave a comment.

(3 edits)

Hi DRincs,

Thanks for this wonderful tool! I'll using it in my projects moving forward.

There was an error when running my ren'py game the first time, probably due to being on Windows (not WSL) and the version of python I'm using which is 3.12.x.


error:
```
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game/console/debug.rpy", line 17: invalid syntax
    width = max(map(lambda (k, v): len(k), results or [('', None)]))
                ^
   
Ren'Py Version: Ren'Py 8.0.3.22090809
```

So I had to change the code, and to fix it I removed the braces from "lambda (k, v)":
Before:
width = max(map(lambda (k, v): len(k), results or [('', None)]))
After:
width = max(map(lambda k, v: len(k), results or [('', None)]))
I hope this helps!