Syntax? call variable label [SOLVED]

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
Coyotl
Regular
Posts: 27
Joined: Wed Jan 29, 2014 5:36 pm
Contact:

Syntax? call variable label [SOLVED]

#1 Post by Coyotl »

I'm trying to put a modular combat engine into my project, and it's coming along okay except for one thing. Before the combat I set a variable winlocation so the code knows where to go after the combat. But I can't seem to find the syntax to tell the call (or jump) command that winlocation is a variable, so it looks for a label with that name instead.

I'm new and missing something very basic in the syntax, aren't I?
Last edited by Coyotl on Thu Jan 30, 2014 8:55 pm, edited 1 time in total.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Syntax? call variable label

#2 Post by xela »

You mean like:

Code: Select all

python:
    if renpy.has_label(winlocation):
        renpy.jump(winlocation)
?
Like what we're doing? Support us at:
Image

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

Re: Syntax? call variable label

#3 Post by Asceai »

Use "jump expression"

Code: Select all

jump expression winlocation

Coyotl
Regular
Posts: 27
Joined: Wed Jan 29, 2014 5:36 pm
Contact:

Re: Syntax? call variable label

#4 Post by Coyotl »

Thanks for your solution, xela.
Asceai, that was just what i was looking for. I knew there should be something to tell the command statement to treat it as a variable instead of a label.

I suspect that both of your solutions will be put to use at different points.
Much thanks to you both!

Post Reply

Who is online

Users browsing this forum: Nozori_Games, Ocelot