[OK]How to test run partial part of game-certain script only

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
saruri
Regular
Posts: 41
Joined: Wed Sep 12, 2012 2:11 am
Contact:

[OK]How to test run partial part of game-certain script only

#1 Post by saruri »

Hi, as subject, I believe it's not quite possible to only test run partial part of game in a whole big script.
So I'm thinking to make a lot of small scripts instead; it's more possible to test run only one script right? (like the NVL Maker)
How to do so with Ren'Py?

Thanks in advance!
Last edited by saruri on Mon Jun 24, 2013 12:28 am, edited 1 time in total.

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: How to test run partial part of game - certain script on

#2 Post by pwisaguacate »

I often set a jump right at the start label, with a return at the end of the section to be run:

Code: Select all

label start:
    jump start1 # Which demo to select

label start1:
    "DEMO: a custom choice menu with an inactive button"

    return

label start2:
    "DEMO: a button inventory screen"

    return
This might be a little shoddy, but it works for me. (Some variables may have to be manually set.)

User avatar
saruri
Regular
Posts: 41
Joined: Wed Sep 12, 2012 2:11 am
Contact:

Re: How to test run partial part of game - certain script on

#3 Post by saruri »

I see! Well, it's a bit troublesome and not cool like the NVL Maker (which got function of testing any script individually) but, it should do the job for me too, thank you so much for your kind reply! ^ ^

User avatar
spiral
Regular
Posts: 47
Joined: Mon Mar 04, 2013 5:48 am
Location: Australia
Contact:

Re: How to test run partial part of game - certain script on

#4 Post by spiral »

The way I have mine set up is very similar, except with a menu from which you choose which version of the game to run. Means I don't have to remember to go into the script and change the variables so much :) I also have a variable "b_demo" which records whether you're playing the demo version or not and changes scenes/variables accordingly via lots of "if b_demo..." statements.

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: How to test run partial part of game - certain script on

#5 Post by nyaatrap »

You can just press shift+O then type "jump labelname"

User avatar
saruri
Regular
Posts: 41
Joined: Wed Sep 12, 2012 2:11 am
Contact:

Re: How to test run partial part of game - certain script on

#6 Post by saruri »

nyaatrap wrote:You can just press shift+O then type "jump labelname"
Hi, you mean press "shift+O" in game??? I just try and nothing happen. Hope for your advice.

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: How to test run partial part of game - certain script on

#7 Post by pwisaguacate »

The console was introduced in Ren'Py 6.15.0, in case you were using an older version. It looks like this:
renpy_console.png
EDIT: If shift+O still doesn't work, try hitting the backtick ` located to the left of 1 (as suggested on the announcement section of the download page; doesn't do anything for me). Maybe certain keyboard layouts have strange effects that I am unaware of.
Last edited by pwisaguacate on Sat Jun 22, 2013 9:56 am, edited 1 time in total.

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: How to test run partial part of game - certain script on

#8 Post by nyaatrap »

The backtick key is disabled because it causes a crash error on IME keyboards used on east asia.
And note, you shouldn't add any function on the backtick key - it works only on western keyboard.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: How to test run partial part of game - certain script on

#9 Post by trooper6 »

How would one use the console?
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: How to test run partial part of game - certain script on

#10 Post by pwisaguacate »

trooper6 wrote:How would one use the console?
The debug console, when config.console is True (default True in unbuilt projects), can be used to:
  • Jump to a label.
  • Interactively try out Ren'Py script statements.
  • Evaluate a python expression or statement to see the result.
  • Trace python expressions as the game progresses.
After you open the console with shift+O and enter "help", this help message appears:

Code: Select all

commands:
 clear: clear the console history
 exit: exit the console
 help: show this help
 jump <label>: jumps to label
 load <slot>: loads the game from slot
 reload: reloads the game, refreshing the scripts
 save <slot>: saves the game in slot
 unwatch Mexpression>: stop watching an expression
 unwatchall: stop watching all expressions
 watch <expression>: watch a python expression
 <renpy script statement>: run the statement
 <python expression or statement>: run the expression or statement
  • I find the console most useful for setting, evaluating, and watching variables. Entering "var1 > var2" will return True if that expression is true. And of course, label jumping.
  • Multi-line input is possible. After one colon it will indent and let you enter additional lines. Outdent all the way and hit Enter to run the script.
  • No dollar sign is needed for python expressions or statements.
  • Hit the Esc key to close the console.

User avatar
saruri
Regular
Posts: 41
Joined: Wed Sep 12, 2012 2:11 am
Contact:

Re: How to test run partial part of game - certain script on

#11 Post by saruri »

It works now, thank you very much! ^ ^

Nova Alamak
Regular
Posts: 71
Joined: Sun Jun 08, 2014 1:45 pm
Contact:

Re: [OK]How to test run partial part of game-certain script

#12 Post by Nova Alamak »

I tried to jump to the label "act1" in my VN and it isn't working... I open the console and type: jump act1 and it just returns with invalid syntax errors. What am I doing wrong?

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: [OK]How to test run partial part of game-certain script

#13 Post by Asceai »

Post a screenshot after opening the console, typing jump act1 and getting the error.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Majestic-12 [Bot]