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.
-
asatiir
- Regular
- Posts: 86
- Joined: Tue Oct 01, 2013 6:04 pm
- Completed: Within the Walls (Twine)
- Projects: Roses Will Rise
- Organization: Asatiir's Tales
- Skype: asatiir
- itch: asatiir
- Location: Dubai, UAE
-
Contact:
#1
Post
by asatiir » Tue Oct 29, 2013 5:58 pm
I've reached a stump in my game, there is a point where some bits can possibly be examined before progressing (example: locked door that unlocks after a series of events), my issue here is that I don't want certain lines of text repeated or missing context (examining locked door with the knowledge its there once it unlocks vs. finding out that a door nearby just unlocked). A way that I got around this was using if statements, I'm not sure if it works in a similar form on Ren'Py as it did with Twine:
Code: Select all
<<if $seendoor eq "yes">>
The door you notice earlier had began to emit a creaking sound, signifying that it's no longer locked
<<endif>>
<<if $seendoor eq "no">>
You hear a creak in the opposite corner of the room, to your attention it's a door you haven't seen prior <given event>.
<<endif>>
you walk towards the door and carry onwards.
is there something I can do similar to this?
-
xavimat
- Eileen-Class Veteran
- Posts: 1458
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love, unknown
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
-
Contact:
#2
Post
by xavimat » Tue Oct 29, 2013 6:07 pm
Very similar (except for <given event>, I don't know what's that).
Code: Select all
# at the begining of your game:
$ seendoor = False
# Later:
if seendoor:
"The door you notice earlier had began to emit a creaking sound, signifying that it's no longer locked"
else:
$ seendoor = True
"You hear a creak in the opposite corner of the room, to your attention it's a door you haven't seen prior."
"You walk towards the door and carry onwards."
-
asatiir
- Regular
- Posts: 86
- Joined: Tue Oct 01, 2013 6:04 pm
- Completed: Within the Walls (Twine)
- Projects: Roses Will Rise
- Organization: Asatiir's Tales
- Skype: asatiir
- itch: asatiir
- Location: Dubai, UAE
-
Contact:
#3
Post
by asatiir » Wed Oct 30, 2013 7:53 am
That makes sense, thanks! don't worry, the <given event> is just a generic example.
Users browsing this forum: Google [Bot]