Show image "as"

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
cattro
Newbie
Posts: 16
Joined: Thu Nov 14, 2013 3:56 am
Contact:

Show image "as"

#1 Post by cattro »

So I have this mini game in mind for my game, and it's proving trickery than I imagined

Code: Select all

show back as card1 at o1 with easeintop
    show back as card2 at o2 with easeintop
    show back as card3 at o3 with easeintop
Now, let's say we select card2, the card would flip over

Code: Select all

show rabbit as card2
And then I'd true to move it with
show card2 at truecenter with move

Renpy doesn't recognize "card2" at all. I wouldn't mind if it was just one card but I have a lot to do with all the cards in the game. I defined a few and they work just fine, but it really limits what I wanted to do!
Is there an easier way to do this? Am I using "as" completely wrong?

cattro
Newbie
Posts: 16
Joined: Thu Nov 14, 2013 3:56 am
Contact:

Re: Show image "as"

#2 Post by cattro »

anyone? I'm really having trouble with this I'm not sure the best way to do this!

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Show image "as"

#3 Post by Milkymalk »

Is the indentation right? Your code looks like its indentation is not consistent.

Other than that, I'm not sure, but your use of "as" looks right. Could you give more relevant code?
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Show image "as"

#4 Post by Asceai »

Nope; unfortunately, what you are trying to do just won't work. All I can think of is writing some custom Python functions that call renpy.show and set an appropriate store value to the card image, so you can retrieve that and use it when you want to move a card without changing it.

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Show image "as"

#5 Post by Milkymalk »

Now it's me who is confused. Isn't "as" there to do things exactly like what he wants to do?
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Show image "as"

#6 Post by xela »

Milkymalk wrote:Now it's me who is confused. Isn't "as" there to do things exactly like what he wants to do?
Nope, it is meant to allow you showing the same image twice without automatically replacing the first, it doesn't actually redefine anything.
Like what we're doing? Support us at:
Image

Post Reply

Who is online

Users browsing this forum: Google [Bot]