I've got eight colour strips (strip0 through strip7) whose filenames are defined in the corresponding variables (e.g.: strip0 = "thiscolour.png") whih may contain different colours according to what the user selects meaning each of the eight strips may have a DIFFERENT colour each time the game runs.
Is there a way to define my images using the Variable Name…?
I've already tried:
image c0 = strip0
image c0 = [strip0]
image c0 = [strip0!t]
none of which works (and, as the colour will be variable I can not use image c0 = "thiscolour.png"). Please help!
Thanks in advance…!
How to define an Image using a VARIABLE
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.
Re: How to define an Image using a VARIABLE
I don't know what you trying to achieve, but this might help youhttps://www.renpy.org/doc/html/displayi ... -statement
https://www.renpy.org/doc/html/other.html#renpy-random
https://www.renpy.org/doc/html/screens.html
Also, check https://www.renpy.org/doc/html/displaya ... splayables
viewtopic.php?f=51&t=19063
Code: Select all
image strip0 = "thiscolour_0.png"
image strip1 = "thiscolour_1.png"
image strip2 = "thiscolour_2.png"
screen color_scr(x):
add x
label start:
"?"
$ color_to_show = renpy.random.choice(("strip0", "strip1", "strip2"))
scene expression color_to_show
"!"
scene black
"..."
show screen color_scr(x=color_to_show)
"?!"
https://www.renpy.org/doc/html/other.html#renpy-random
https://www.renpy.org/doc/html/screens.html
Also, check https://www.renpy.org/doc/html/displaya ... splayables
viewtopic.php?f=51&t=19063
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: How to define an Image using a VARIABLE
I certainly would use a dynamic displayable (already linked by Alex)
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
THANK YOU!
Thanks a lot! I'm afraid I'm still quite green in Ren'Py and Python... but I'm interested in learning and you've really helped!
Who is online
Users browsing this forum: No registered users