Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
- Posts: 7
- Joined: Tue Nov 15, 2016 11:17 am
I was going to place this in the bug replication section, but first I wanted to make sure this wasn't a feature instead. Let's look at an example code:
Code: Select all
call pick("paper") #works flawlessly
jump pick("paper") #causes an exception
"I picked up the [object]"
In the above code, what I'd expect is to pick a paper, then pick another paper, then go back to the main menu. However, the jump statement says that it expected a newline right over the opening parentheses. If that line is commented, the code runs smoothly. Does anyone have any idea why is that, and any tips or alternatives to solve it? I'm using ren'py 126.96.36.1998, if that helps about something. Thanks in advance!
- Lemma-Class Veteran
- Posts: 2806
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
You have no "paper" to pick... I only see "stone"
Did you put return at the end of paper as you did with "stone"?
All I can think of here, is you're jumping to the label "example", and then instantly jumping to another label.
You should change that so there's some kind of user-interaction between the jumps.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
- Eileen-Class Veteran
- Posts: 1692
- Joined: Wed Dec 04, 2013 12:33 pm
Looking at the documentation, it doesn't seem like jumping with parameters is intended. (Call explicitly mentions parameters, jump does not.) Not sure why though. Might be worth raising with PyTom if you'd like. https://www.renpy.org/doc/html/label.ht ... -statement
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
If you go to (jump to) another line of the code, you can't tell its scope is local or global. It'll share the same global scope, so arguments become meaningless. In that's case, the following would do the same thing.
You shouldn't use a same label for both call and jump. If you jump to a label that has the return statement, it leads to the main menu.