Name chosen by player doesn't work +show none sprite graphic

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
User avatar
Hae Young
Newbie
Posts: 23
Joined: Fri Apr 12, 2013 2:26 pm
Contact:

Name chosen by player doesn't work +show none sprite graphic

#1 Post by Hae Young »

Hello guys~
So I finally started coding a little game... Or so I thought. As I'm not really a pro programmer, I encountered some problems already, but most of them could be solved, besides these two:

1. I wanted the player to be able to chose between different ways to be called, however, it didn't work.

Code: Select all

f "Then what should I call you?"
    
    menu:
        "Master":
            $ player = "Master"
        "Senpai":
            $ player = "Senpai"
        "Onii-San":
            $ player = "Onii-San"
        "Prince":
            $ player = "Prince"
            
    n "Why can't you just call me by my name?"
    f "That is because I don't know your name."
    hide smile
    show embrassed
    f "And besides, I like to call you %(player)..."
When the last line is about to be displayed, there is an error saying "ValueError: unsupported format character '.' (0x2e) at index 42" What does it mean? I don't get it...


2. When one of the characters reads a postcard, I wanted to show one on the screen

Code: Select all

image postcard = "moscow_postcard.jpg"
[...]
show postcard at Position(xpos = 0.5, xanchor=0.5, ypos=0.5, yanchor=0.5)
But I always get an error "Undefined Image". I copied the file name, so it can't be a typing error... Plus when I use Position(center) there is a second error...

Please help me T-T
And I'm sorry if I made obvious mistakes, but since I have never succesfully programmed anything (not even a simple website, Javascript and CSS are my enemies). And I had only around 4 hours of sleep tonight...

Still, I want to thank you i advance.

User avatar
saguaro
Miko-Class Veteran
Posts: 560
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Organization: Lucky Special Games
itch: saguarofoo
Location: USA
Contact:

Re: Name chosen by player doesn't work +show none sprite gra

#2 Post by saguaro »

Code: Select all

f "And besides, I like to call you [player]..."
Make sure the image definition is not in a label. Also, make sure you are using the correct path (is the .jpg in a folder?).

User avatar
Hae Young
Newbie
Posts: 23
Joined: Fri Apr 12, 2013 2:26 pm
Contact:

Re: Name chosen by player doesn't work +show none sprite gra

#3 Post by Hae Young »

Ah, I see. since in the Renpy FAQ was a %, I thought I had to use it.
Edit: Now only "(player)2 is displayed, but not what you chose her to call you :/

And yes, the image is in the folder. But it's not in a label...

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1779
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: Name chosen by player doesn't work +show none sprite gra

#4 Post by OokamiKasumi »

This:

Code: Select all

%(player)
--is missing an 's' at the end.

Code: Select all

%(player)s
You use a '%' on one side, and an 's' on the other.

Are you sure you put the definition of your image at the Beginning? BEFORE:

Code: Select all

label start:
Is your image inside a folder within the game folder?
-- If it is, then you need to add the folder's name too.

If inside a folder called 'images':

Code: Select all

image postcard = "images/moscow_postcard.jpg"
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

User avatar
Hae Young
Newbie
Posts: 23
Joined: Fri Apr 12, 2013 2:26 pm
Contact:

Re: Name chosen by player doesn't work +show none sprite gra

#5 Post by Hae Young »

Thanks to the two of you, it worked now :D
I renamed the picture several times and then it suddenly worked~

Post Reply

Who is online

Users browsing this forum: Google [Bot], Nozori_Games