I'm trying to add a side image for certain characters. It's supposed to be a heart that goes up whenever the character likes you more , but the image wont show up no matter what I do or where I put the code. Please help me!
Heres the code:
init:
$ health = 100
$ sanity = 100
$ tod_love = 0
$ carybdis_love = 0
$ nyx_love = 0
$ ryn_love = 0
define e = Character("[name]")
define n = Character("Nyxi")
define r = Character("Ryn")
define c = Character("Carybdis")
define t = Character("Todd")
define p = Character(None)
define o = Character("???")
image side c = ConditionSwitch(
"carybdis_love >= 100", "love_icon_carybdis.png",
"carybdis_love >= 90", "love_icon_red.png",
"carybdis_love >= 80", "love_icon_orange.png",
"carybdis_love >= 70", "love_icon_yellow.png",
"carybdis_love >= 60", "love_icon_green.png",
"carybdis_love >= 50", "love_icon_lightblue.png",
"carybdis_love >= 40", "love_icon_blue.png",
"carybdis_love >= 30", "love_icon_pink.png",
"carybdis_love >= 20", "love_icon_lightpurple.png",
"carybdis_love >= 10", "love_icon_purple.png",
"carybdis_love >= 0", "love_icon_empty.png",
"carybdis_love <= 0", "love_icon_broken.png",
)
[SOLVED] Help?? Side image not showing up.
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.
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.
- PrxnceKxsses
- Newbie
- Posts: 13
- Joined: Mon Nov 19, 2018 5:04 pm
- Completed: None yet!
- Projects: Painkiller
- Contact:
[SOLVED] Help?? Side image not showing up.
Last edited by PrxnceKxsses on Wed Nov 21, 2018 9:59 pm, edited 1 time in total.
New to coding, learning as I go
- IrinaLazareva
- Veteran
- Posts: 399
- Joined: Wed Jun 08, 2016 1:49 pm
- Projects: Legacy
- Organization: SunShI
- Location: St.Petersburg, Russia
- Contact:
- PrxnceKxsses
- Newbie
- Posts: 13
- Joined: Mon Nov 19, 2018 5:04 pm
- Completed: None yet!
- Projects: Painkiller
- Contact:
Re: [HELP??] Side image not showing up.
Thank you, will this work if its a condition switch? I need it to be so that it changes when the character loves you more
"$ carybdis_love += 10"
Edit: It worked! But it isn't positioned on the textbox. How do I do that?
- IrinaLazareva
- Veteran
- Posts: 399
- Joined: Wed Jun 08, 2016 1:49 pm
- Projects: Legacy
- Organization: SunShI
- Location: St.Petersburg, Russia
- Contact:
Re: [HELP??] Side image not showing up.
By default, the side image is tied to the say() screen (see screens.rpy file)PrxnceKxsses wrote: ↑Tue Nov 20, 2018 9:02 pm But it isn't positioned on the textbox. How do I do that?
Code: Select all
screen say(who, what):
style_prefix "say"
window:
id "window"
if who is not None:
window:
id "namebox"
style "namebox"
text who id "who"
text what id "what"
## If there's a side image, display it above the text. Do not display on the
## phone variant - there's no room.
if not renpy.variant("small"):
add SideImage() xalign 0.0 yalign 1.0 #<<<<<<<<<<<<<<<< this line
Also see https://www.renpy.org/doc/html/side_ima ... tomization
And here two examples:
A)
Code: Select all
image side c = ConditionSwitch(
"carybdis_love >= 100", "love_icon_carybdis.png",
"carybdis_love >= 90", "love_icon_red.png",
#etc...
"carybdis_love == 0", "love_icon_broken.png",
)
define r = Character("Ryn", image='c')
Code: Select all
layeredimage side c:
if carybdis_love >= 100:
"love_icon_carybdis.png"
elif carybdis_love >=90:
'love_icon_red.png'
#etc....
else:
"love_icon_broken.png"
define t = Character("Todd", image='c')
- PrxnceKxsses
- Newbie
- Posts: 13
- Joined: Mon Nov 19, 2018 5:04 pm
- Completed: None yet!
- Projects: Painkiller
- Contact:
Re: [HELP??] Side image not showing up.
Thank you so much!! This really helped a lot!!IrinaLazareva wrote: ↑Wed Nov 21, 2018 11:24 amBy default, the side image is tied to the say() screen (see screens.rpy file)PrxnceKxsses wrote: ↑Tue Nov 20, 2018 9:02 pm But it isn't positioned on the textbox. How do I do that?Code: Select all
screen say(who, what): style_prefix "say" window: id "window" if who is not None: window: id "namebox" style "namebox" text who id "who" text what id "what" ## If there's a side image, display it above the text. Do not display on the ## phone variant - there's no room. if not renpy.variant("small"): add SideImage() xalign 0.0 yalign 1.0 #<<<<<<<<<<<<<<<< this line
Also see https://www.renpy.org/doc/html/side_ima ... tomization
And here two examples:
A)B) (equivalent)Code: Select all
image side c = ConditionSwitch( "carybdis_love >= 100", "love_icon_carybdis.png", "carybdis_love >= 90", "love_icon_red.png", #etc... "carybdis_love == 0", "love_icon_broken.png", ) define r = Character("Ryn", image='c')
about layeredimage see https://renpy.org/doc/html/layeredimage ... yeredimageCode: Select all
layeredimage side c: if carybdis_love >= 100: "love_icon_carybdis.png" elif carybdis_love >=90: 'love_icon_red.png' #etc.... else: "love_icon_broken.png" define t = Character("Todd", image='c')
New to coding, learning as I go
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot]