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.
-
【Kirin-Chan】
- Newbie
- Posts: 5
- Joined: Wed Apr 20, 2016 5:24 am
-
Contact:
#1
Post
by 【Kirin-Chan】 » Thu Apr 21, 2016 7:39 am
So I've been trying to practice and learn how to do the in-game messages code and have stumbled on a bit of a problem. I'm a noob a coding so please bear with me.
I'm trying to change the button of when you receive new mail, I've tried:
Code: Select all
screen mailbox_overlay:
hbox:
xalign 1.0 yalign 0.0
if new_message_count() > 0:
imagemap:
xalign 1.0 yalign 0.0
ground "phone/p.png"
hotspot (0,1,116,56) action Show("mailbox"):
use my_valuee(v=new_messages)
else:
imagemap:
xalign 1.0 yalign 0.0
ground "phone/h.png"
hotspot (0,1,116,57) action Show("mailbox")
and this comes up,
Code: Select all
File "games/messages.rpy", line 119: u'else' is not a keyword argument or valid child for the screen statement
else -->
Any clue?
-
xela
- Lemma-Class Veteran
- Posts: 2481
- Joined: Sun Sep 18, 2011 10:13 am
-
Contact:
#2
Post
by xela » Thu Apr 21, 2016 7:41 am
Else must be indented by the same amount of spaces as if, you cannot put whereever the heck you like.
Like what we're doing? Support us at:

-
【Kirin-Chan】
- Newbie
- Posts: 5
- Joined: Wed Apr 20, 2016 5:24 am
-
Contact:
#3
Post
by 【Kirin-Chan】 » Thu Apr 21, 2016 7:46 am
Ah, yes, that did the trick. Thank you so much!