Characters not moving into different positions

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
Tenarium
Newbie
Posts: 12
Joined: Wed Mar 27, 2013 6:20 pm
Contact:

Characters not moving into different positions

#1 Post by Tenarium » Thu Jun 20, 2013 4:37 pm

Hi guys,

Just started using ren'py today and got my head around most of the basics as I'm trying to compile something just to make sure I can do it, but alas even though I set the characters in different positions, they're always on top of one another, see script below..

# Declare images below this line, using the image statement.
image eileen happy = "eileen_happy.png"
image lucy happy = "lucy_happy.png"
image Tidal Wave BG = "TidalWaveBg.jpg"
image Cave BG = "cave.jpg"
image Landscape BG = "glacier-lake-1280-720-4087.jpg"

# Declare characters used by this game.
define e = Character('Eileen', color="#c8ffc8")
define l = Character('Lucy', color="00ffff")
define slowdissolve = Dissolve (1.0)

# The game starts here.
label start:

scene Cave BG
show eileen happy
show lucy happy
play sound "BGMusic1.wav"

e "I can't help but feel that we haven't chosen the best place for a picnic..."

l "I don't know what you mean, this place is lovely if you can ignore the bats."

e "I can't..."

l "Well we'll just have to move somewhere else then."
l "You always moan about everything, oh Lucy put your dresses away, oh Lucy I'm scared of Krusty the Clo..."

e "You promised not to mention that again..."

l "Hmph, fine, we'll go somewhere else then."


scene Tidal Wave BG
show eileen happy:
xpos 75 ypos 25

show lucy happy:
xpos 25 ypos 75

with slowdissolve

l "Happier now? I still think you'll try and find something to moan about."

e "I just didn't want bats flying around my head!"

l "Oh it's not like they were going to suck your blood!"
l "They're only bats, not homicidal maniacs."

e "Well anyway, this place is far better."

User avatar
Donmai
Eileen-Class Veteran
Posts: 1892
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question
Projects: Slumberland
Location: Brazil
Contact:

Re: Characters not moving into different positions

#2 Post by Donmai » Thu Jun 20, 2013 8:24 pm

Hi Tenarium. When posting code examples, try to use code tags.

There are some built-in routines in Ren'Py to position sprites. You could use:

Code: Select all

scene Cave BG
show eileen happy at left
show long-haired guy at center
show lucy happy at right
play sound "BGMusic1.wav" 
If you prefer the animated way, you can use:

Code: Select all

scene Cave BG
show eileen happy at left with moveinleft
show long-haired guy at center with moveinbottom
show lucy happy at right with moveinright
play sound "BGMusic1.wav" 
or you can define custom positions:

Code: Select all

define esquerda = Position(xanchor=0.5, xpos=0.2)
define direita = Position(xanchor=0.5, xpos=0.83)
# you may use any name that fits and that don't clash with the name of some internal variable;
  I'm using the Portuguese words for left and right.
and then use it this way:

Code: Select all

show eileen happy at esquerda
show lucy happy at direita
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Tenarium
Newbie
Posts: 12
Joined: Wed Mar 27, 2013 6:20 pm
Contact:

Re: Characters not moving into different positions

#3 Post by Tenarium » Fri Jun 21, 2013 4:55 am

I speak spanish so I understand the portuguese variables, the

Code: Select all

 define esquerda = Position(xanchor=0.5, xpos=0.2)
define direita = Position(xanchor=0.5, xpos=0.83)
# you may use any name that fits and that don't clash with the name of some internal variable;
  I'm using the Portuguese words for left and right.
was exactly was I was looking for. Thanks so much! Now I know how to use these tags I'll use this from now on.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1892
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question
Projects: Slumberland
Location: Brazil
Contact:

Re: Characters not moving into different positions

#4 Post by Donmai » Fri Jun 21, 2013 7:54 am

Tenarium wrote:Now I know how to use these tags I'll use this from now on.
You can simply click on the Code button above the text field, and then paste your code. Nice to know I could help! :)
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: wolfofanarchy