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.
-
Evildumdum
- Regular
- Posts: 191
- Joined: Sun Jan 18, 2015 8:49 am
- Projects: ApoclypseZ
-
Contact:
#1
Post
by Evildumdum » Sun Jun 28, 2015 10:49 am
I'm trying out using the as function to show an image twice by redefining it, but i'm getting an end of line expected error and a can't work out why. I know the problem is in the xalign and yalign part of the code but i can't work out why. can anyone help?
This is the part of the code that is a problem
Code: Select all
if zombie5_center == True:
if enemy_distance <= 1:
hide zombie5_small
hide zombie5_med
hide zombie5_large
show zombie1_huge as zombie5_huge xalign 0.4 yalign 0.5
This is the error
Code: Select all
File "game/Combat_image.rpy", line 151: end of line expected.
show zombie1_huge as zombie5_huge xalign 0.4 yalign 0.5
^
File "game/Combat_image.rpy", line 155: end of line expected.
show zombie1_large as zombie5_large xalign 0.4 yalign 0.5
^
File "game/Combat_image.rpy", line 159: end of line expected.
show zombie1_med as zombie5_med xalign 0.4 yalign 0.5
^
File "game/Combat_image.rpy", line 163: end of line expected.
show zombie1_small as zombie5_small xalign 0.4 yalign 0.5
"If at first you don't succeed, try hitting it with a shoe."
-
SinnyROM
- Regular
- Posts: 166
- Joined: Mon Jul 08, 2013 12:25 am
- Projects: Blue Birth
- Organization: Cosmic Static Games
-
Contact:
#2
Post
by SinnyROM » Sun Jun 28, 2015 12:53 pm
It looks like screen language (xalign, yalign) is mixed with Ren'Py scripting. If you want to position something in the script, you need to define the position using
at.
Here's an example from the tutorial game:
Code: Select all
show eileen happy at left
show eileen happy at right as eileen2
with move
The documentation has a list of predefined positions:
http://www.renpy.org/doc/html/transforms.html
If you need to create custom positions you can define one using Position():
Code: Select all
init:
$ offleft_centre = Position(xalign=0.4, yalign=0.5)
label start:
show zombie1_huge at offleft_centre as zombie5_huge
Last edited by
SinnyROM on Sun Jun 28, 2015 1:19 pm, edited 1 time in total.
-
Evildumdum
- Regular
- Posts: 191
- Joined: Sun Jan 18, 2015 8:49 am
- Projects: ApoclypseZ
-
Contact:
#3
Post
by Evildumdum » Sun Jun 28, 2015 1:14 pm
Got it

thanks for the help.
"If at first you don't succeed, try hitting it with a shoe."
Users browsing this forum: Ocelot