Point based jumps?

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
lemonokashi
Regular
Posts: 55
Joined: Mon Jan 13, 2014 11:46 pm
Contact:

Point based jumps?

#1 Post by lemonokashi »

I'm having trouble getting this segment to work. The trouble is through line 9 and 13. Can anyone help me?
label start:
$ scene_points = 0
$ person_points = 0
$ time_points = 1

label scene_1:
if person_points = 0:
jump scene_2

if person_points = 1:
jump Aidan_3

label scene_2:
"Random dialogue."
$ time_points += 1
menu:
"Answer 1":
"More dialogue"
jump scene_1
"Answer 2":
"More dialogue"
$ Aidan_points += 1
jump scene_1

label scene_3:
"This is scene 2!"

return

philat
Eileen-Class Veteran
Posts: 1913
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Point based jumps?

#2 Post by philat »

Well, it's hard to tell if there are any indentation errors from what you posted, but all the if statements should have two = signs:

Code: Select all

if person_points == 0:
    jump scene_2

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

Re: Point based jumps?

#3 Post by Asceai »

First of all, in the future you should use

Code: Select all

 
tags when pasting code so that the indenting is preserved, since indenting is important in ren'py and python and can lead to subtle bugs.

This probably isn't your problem though. The problem is that you are using = instead of ==. Use = for assignment, == for comparison.

a = b means a is set to b
a == b means comparing if a is equal to b.

lemonokashi
Regular
Posts: 55
Joined: Mon Jan 13, 2014 11:46 pm
Contact:

Re: Point based jumps?

#4 Post by lemonokashi »

I'm sorry. I'm a bit new on this forum. Thank you for the help!

Post Reply

Who is online

Users browsing this forum: Google [Bot], Houseofmine, Lacha