• To improve security, we will soon start forcing password resets for any account that uses a weak password on the next login. If you have a weak password or a defunct email, please update it now to prevent future disruption.

How to Play from any point in Game?

DoctorPervic

Well-Known Member
Game Developer
Aug 13, 2019
1,062
4,403
Hi, I'm a newbe in Renpy game dev, I am wondering if there is a way to play your game in development from any place in the code.

For example. Lets say I have over 10,000 lines of code but I do not want to play my game from start to Finnish just to test a few lines of code at the end of my game. or in the middle of game.

So is there a way to be able to play the game from a specific part of code?

any help is greatly appreciated. thanks so much.
 

scrumbles

Engaged Member
Jan 12, 2019
2,265
2,315
Say you have a scene you want to test, e.g. the 4th scene of the 2nd chapter.
First, label that scene, i.e. make the scene start with a line like this (I have omitted the spaces before "label"):
Code:
label Chap2_scene4:
Then you have at least two solutions:

2) insert at the beginning of the story (but after you have defined all the variables) a jump statement and reload the game (again, I have omitted the spaces):
Code:
jump Chap2_scene4
Even better, you can create an in-game menu with "jump" instructions leading to the main chapters.

1) open the console (press Shift+O as in Oscar) and type (no spaces required before the jump statement):
Code:
jump Chap2_scene4
Press Enter to execute the statement, then press Esc to quit the console. Play the scene.
You can use the console to define new variables or to change the value of the existing ones.
The console remember what you have typed. Use the arrow keys (↑, ↓) to browse the console history.

Read also:

I'm sure other devs will give you a better answer, but at least you can start to test your game. ;)
 
Last edited: