Hey guys, I'm a total newbie at this still and I just have a simple question.. At the start of my game you can choose a gender, and I want to show a side image (portrait) of a male or a female depending on your choice. How can I easily do this?
When I define the "you" character at the top I'm able to define the name as a variable you choose later, (using "[name]") how can I do that with the image?
define y = Character ("[name]")
That line works, but adding something like , image="[gender]" doesn't. (gender is defined as either female or male after a menu choice at the start of the game.)
The images display correctly if I just type in image="male", but I want the gender choice to change that tag according to your choice..
Any help?
Using variable (flag?) for side image when defining characters.
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.
-
- Newbie
- Posts: 2
- Joined: Thu Oct 18, 2018 4:09 am
- Contact:
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: Using variable (flag?) for side image when defining characters.
You likely want to just interpolate gender into the single defined image:
Code: Select all
default pc_gender = "male"
image side pc = "images/pc_[pc_gender].png"
define pc = Character("[pc_name]")
label start:
pc 'Male Picture "images/pc_male.png"'
$ pc_gender = "female"
pc 'Female Picture "images/pc_female.png"'
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
-
- Newbie
- Posts: 2
- Joined: Thu Oct 18, 2018 4:09 am
- Contact:
Re: Using variable (flag?) for side image when defining characters.
That worked.. Thank you so much!!Remix wrote: ↑Thu Oct 18, 2018 5:17 am You likely want to just interpolate gender into the single defined image:Code: Select all
default pc_gender = "male" image side pc = "images/pc_[pc_gender].png" define pc = Character("[pc_name]") label start: pc 'Male Picture "images/pc_male.png"' $ pc_gender = "female" pc 'Female Picture "images/pc_female.png"'
Who is online
Users browsing this forum: apocolocyntose