How do I add a side image to my game??

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.
Message
Author
dohazrael
Newbie
Posts: 1
Joined: Sun Jun 12, 2016 10:35 pm
Contact:

Re: How do I add a side image to my game??

#16 Post by dohazrael »

I know this thread may be a bit old now but I wanted to see if a newcomer could still reach out for some ATL assistance XD.

Code: Select all

     I'm sorry, but errors were detected in your script. Please correct the
     errors listed below, and try again.


     File "game/script.rpy", line 19: invalid syntax
         Character('Siena Mitsu', color="#c8ffc8", window_left_padding=160, show_side_image=("smsid", xalign 0.0, yalign 0.925))
                                                                                                           ^

     Ren'Py Version: Ren'Py 6.99.10.1227
     
Does anyone have any suggestions? I'm sure you can see by this line that im referencing to "smsid" as an ATL 2 image repeat loop. Trying to animate the side image and correct the placement. Thank you much in advance!!!

User avatar
Alex
Lemma-Class Veteran
Posts: 3093
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: How do I add a side image to my game??

#17 Post by Alex »

Check the line 19, it should look like

Code: Select all

define sm = Character('Siena Mitsu', color="#c8ffc8", window_left_padding=160, show_side_image=("smsid", xalign 0.0, yalign 0.925))

User avatar
Ringei
Regular
Posts: 34
Joined: Fri Jun 17, 2016 5:58 am
Projects: Wish Upon A Star- A Visual Novel
Organization: Kamisama Visuals
Location: Hell was full, so yeah i am on earth
Contact:

Re: How do I add a side image to my game??

#18 Post by Ringei »

Hi,
I guess this should work because this is what I use:

Code: Select all

define e = Character("Eileen", image="eileen")

image eileen happy = "eileen_happy.png"
image eileen concerned = "eileen_concerned.png"

image side eileen happy = "side_eileen_happy.png"
image side eileen = "side_eileen.png" 
And to prevent the image from overlapping the text:

Code: Select all

style window:
    left_padding 150
Hope it helps! :D

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: How do I add a side image to my game??

#19 Post by Scribbles »

Sorry to dig up this old thread.... BUT I was having issues with this

Code: Select all

label start:
    define you = Character("[povname]", window_left_padding=160, image="you")
    image side you passive = im.FactorScale("Sprites/Mc_Passive.png", 0.5,0.5)

default povname = "Delilah"

label start:
    scene bg theWoods
    with bgfade    
    
    $ povname = renpy.input("Please choose a name by typing it on your keyboard...",length=12)
    $ povname = povname.strip()

    if not povname:
         $povname = "Delilah"

    "You have chosen: [povname]"
and then:

Code: Select all

you passive "Blah Blah Blah"
but all it does is move my text over via the window padding -_- it doesn't show the image. I've checked the image name a million times, I'm not sure if my input code is screwing with it somehow?

for what it's worth, my text and the name are already where I wanted it... So I don't need any padding, but still no side image appears.

Am I screwing up the code? Is my image messing it up( it's a trimmed, transparent, portrait sized placeholder image)? Am I just completely off???

I would like the image to appear roughly where the circle thingy is..

(You can ignore the text box design - it's not final > <) - Oh, and I kept the padding on so you can see what I see with the above code.
Attachments
Screenshot (18).png
Image - Image -Image

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: How do I add a side image to my game??

#20 Post by Imperf3kt »

Drop the "passive" - two words are not supported.
If you really need it, add an underscore.

Also, you have two start labels. That's gonna cause issues. Define characters and images outside the label.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: How do I add a side image to my game??

#21 Post by Scribbles »

Imperf3kt wrote:Drop the "passive" - two words are not supported.
If you really need it, add an underscore.

Also, you have two start labels. That's gonna cause issues. Define characters and images outside the label.
that worked! thank you, but then how do I show other emotions?

and thanks for pointing out the double start label I didn't notice at all, and I'm not sure why it was there... lol
Image - Image -Image

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: How do I add a side image to my game??

#22 Post by Imperf3kt »

The way I do it is just to define a new character per expression.
It's probably not perfect, nor preferred, but it works.

Something like <character>_<expression>
for example:

define na = Character('', image="naside")#Narrator
define na_upset = character('', image="nangry")#Narrator Angry

image side naside = "narrator side image.png"
image side nangry = "angry narrator.png"
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: How do I add a side image to my game??

#23 Post by Scribbles »

Imperf3kt wrote:The way I do it is just to define a new character per expression.
It's probably not perfect, nor preferred, but it works.

Something like <character>_<expression>
for example:

define na = Character('', image="naside")#Narrator
define na_upset = character('', image="nangry")#Narrator Angry

image side naside = "narrator side image.png"
image side nangry = "angry narrator.png"
thanks! that worked :)
Image - Image -Image

User avatar
explodingcrayon
Newbie
Posts: 3
Joined: Tue Jul 25, 2017 10:15 pm
Tumblr: doodlingcrayon
Deviantart: explodingcrayon93
Contact:

Re: How do I add a side image to my game??

#24 Post by explodingcrayon »

Hi there, sorry to beat a dead horse, but I'm having trouble with this same issue. I've looked up video tutorials, the Ren'Py documentation, and several forum posts and still I can't get the side image to show up. I've been an unofficial lurker so far, but after seeing that I had almost identical code to Scribbles above and it still didn't work, I figured it couldn't hurt to ask directly.

So far I've only done tiny test games, but I wanted this one to be a little more thorough and dynamic. I didn't think this would be the piece of coding that would end up being too ambitious for me haha! Any help would be appreciated. I've shuffled around the code so many times last night, that at this point that alone might be the problem, or maybe it's something silly that I'm not noticing because I'm new! n_n;;

So far the script looks like this:

Code: Select all

define pc = DynamicCharacter('pc', image='trap', wndow_left_padding=160, color='#0061BA')
image side pc_side = im.FactorScale('side_trap_smile.png', 0.5,0.5)

label start:
    
    scene black
    
    $ pc = renpy.input("Enter your name.", length=12)
    $ pc = pc.strip()
    
    if pc == "":
        $ pc="Trap"
        
        jump prologue
        
    label prologue:
        
        pc "It's been a while since I moved to a new city."
        

User avatar
explodingcrayon
Newbie
Posts: 3
Joined: Tue Jul 25, 2017 10:15 pm
Tumblr: doodlingcrayon
Deviantart: explodingcrayon93
Contact:

Re: How do I add a side image to my game??

#25 Post by explodingcrayon »

Hey I hope it's okay if I bump this thread, I still can't figure it out :( Any help would be greatly appreciated!

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: How do I add a side image to my game??

#26 Post by philat »

You're naming the side image wrong. You set character image attribute to "trap" but the image name is "side pc_side". Go one way or the other.

User avatar
explodingcrayon
Newbie
Posts: 3
Joined: Tue Jul 25, 2017 10:15 pm
Tumblr: doodlingcrayon
Deviantart: explodingcrayon93
Contact:

Re: How do I add a side image to my game??

#27 Post by explodingcrayon »

That helped, thank you so much! :D I guess I got so caught up trying to fix it, I ended up flubbing it in a different way. Thank you for your help!

Post Reply

Who is online

Users browsing this forum: Google [Bot]