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.
-
burnt_offering
- Regular
- Posts: 107
- Joined: Sun Feb 23, 2014 4:21 pm
- Completed: The Stroke of Midnight
- Organization: Ace Of Spades
- IRC Nick: burnt_offering or TheTapDancer
- Skype: aceofspadesvn
- itch: aceofspadesvn
- Location: London
-
Contact:
#1
Post
by burnt_offering » Mon Mar 30, 2015 11:23 am
I've been trying to program a code lock as part of a puzzle sequence, but I was putting the code in a python block to avoid messing around with textbuttons. However, when in a block, ren'py doesn't seem to acknowledge jump as a function, so I'm not sure how to proceed.
For reference, here's the code:
Code: Select all
screen GenCodeInput:
tag puzzle
use navigation
imagemap:
ground "gencode.png"
idle "gencode.png"
hover "gencodehover.png"
hbox:
for i in (0,9):
textbutton str(i) action code(i,10529,opengen)
textbutton clear action clearcode
init python:
def code(i,k,label):
if code==0:
code=i
elif code<10:
code= 10*code + i
if code==k:
jump label
elif code>9999:
codestring=str(code)
for ch in codestring:
codestring2 = str(codestring[-4:])
code = int(codestring2)
code = 10*code + i
if code==k:
jump label
-
philat
- Eileen-Class Veteran
- Posts: 1853
- Joined: Wed Dec 04, 2013 12:33 pm
-
Contact:
#2
Post
by philat » Mon Mar 30, 2015 11:31 am
Users browsing this forum: Bing [Bot]