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.
"Pick which gender":
"Male":
$ male = True
"Woman":
pass
if male == True:
show male at left
else:
show woman at right
But if i were to show the player's character multiple times I would have to copy paste the else/if multiple times. Is there any other way to do this? Thanks!
default pc_gender = "male"
image pc_sprite = "images/[pc_gender].png"
label start:
show pc_sprite # shows "images/male.png"
"..."
$ pc_gender = "female" # changes to now show "images/female.png"
"..."
This doesn't work for me, because when I add $ pc_gender = "female" # changes to now show "images/female.png" then add show x at left it doesn't change anything, I still see the male image.
x is the shorthand name of my character
It doesn't show how to assign the female image. I assign the default as male, but no mention of the alternative. How do I write default = male and not default = female? Do I have to add something like default x pc_gender = "male"?
What, spy on our spy as he searches for their spy? Why not, sounds rather like fun.
default pc_gender = "male"
image pc_sprite = "images/[pc_gender].png"
label start:
show pc_sprite # shows "images/male.png"
"..."
$ pc_gender = "female" # changes to now show "images/female.png"
"..."
This doesn't work for me, because when I add $ pc_gender = "female" # changes to now show "images/female.png" then add show pc_sprite at left it doesn't change anything, I still see the male image.
It doesn't show how to assign the female image. I assign the default as male, but no mention of the alternative. How do I write default = male and not default = female?
Doesn't it require something like