Depending on what was chosen, I want Renpy to display different side images.
Now I've been looking for tutorials and hints, and I've been working with the tips in this thread. And it works, but only when I don't use side images.
Code: Select all
init:
$ mc = Character("Jordan",
who_ypos=-23,
who_xpos=230,
who_font="ui/Arsenal-Regular.otf",
who_outlines=[(3, "#000000", 0, 0)],
show_side_image=???,
what_ypos=-30,
what_xpos=200,
what_color="#FFFFFF",
what_outlines=[(3, "#000000", 0, 0)])
# The game starts here.
label start:
$ gender = "female" #default needs to be present
scene hallway with dissolve
n "The shackles bite painfully into my skin."
n "They are just a tad too tight to be comfortable, no doubt on purpose."
n "The two men walking on either side of me do so silently, their eyes stubbornly focused in front of them and their expressions grim."
n "I assume they're male, anyway."
n "Can't be too sure when it comes to other civilisations, especially in this backwater quadrant."
n "I test my cuffs, trying to wiggle out of them."
n "No dice."
guard "You won't be able to escape these. They're reinforced titanium, uhm..."
n "Obviously they're not too sure about our gender conventions, either."
menu:
"Ma'am.":
$ gender = 'female'
"Ma'am. I'm female."
guard "Very well, Ma'am. I'd advise you to keep your hands still. You'll hurt yourself otherwise."
"Sir.":
$ gender = 'male'
"Sir. I'm male."
guard "Very well, Sir. I'd advice you to keep your hands still. You'll hurt yourself otherwise."
mc neutral "You're surprisingly polite, considering you've just arrested us for murder."
n "Somewhere behind me, there's a groan."
l "Your sense of tact is as immaculate as always."
mc annoyed "Just wait till I shove my tact right up your-"
"The guard clears his throat."
guard "It is customary in our society to treat prisoners with respect, no matter their crime."
mc neutral "So you're not gonna throw us in a cell to starve?"
guard "No. We do not stoop to your level."
mc angry "My level? You listen here, twerp, I-"
l "What WILL you do with us?"
n "Asshole."
return
Along with that, I have another file called 'xLiveComposite.rpy', like OokamiKasumi suggested in the thread, which looks like this:
Code: Select all
init-1:
image mc = "mc/MC female/fmc_neutral.png"
# --------------------------
image mc neutral = ConditionSwitch(
"gender == 'female' ", Image ("mc/MC female/fmc_neutral.png"),
"gender == 'male' ", Image ("mc/MC male/mmc_neutral.png"),
"True", Image ("mc/MC female/fmc_neutral.png"),
)
image mc annoyed = ConditionSwitch(
"gender == 'female' ", Image ("mc/MC female/fmc_annoyed.png"),
"gender == 'male' ", Image ("mc/MC male/mmc_annoyed.png"),
"True", Image ("mc/MC female/fmc_annoyed.png"),
)
image mc pleased = ConditionSwitch(
"gender == 'female' ", Image ("mc/MC female/fmc_pleased.png"),
"gender == 'male' ", Image ("mc/MC male/mmc_pleased.png"),
"True", Image ("mc/MC female/fmc_pleased.png"),
)
image mc angry = ConditionSwitch(
"gender == 'female' ", Image ("mc/MC female/fmc_angry.png"),
"gender == 'male' ", Image ("mc/MC male/mmc_angry.png"),
"True", Image ("mc/MC female/fmc_angry.png"),
)
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game\script.rpy", line 69, in script
Exception: Say has image attributes (u'neutral',), but there's no image tag associated with the speaking character.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "C:\Users\Kniggi\Games\renpy-6.14.1-sdk\renpy\execution.py", line 266, in run
File "C:\Users\Kniggi\Games\renpy-6.14.1-sdk\renpy\ast.py", line 401, in execute
File "C:\Users\Kniggi\Games\renpy-6.14.1-sdk\renpy\exports.py", line 750, in say
File "C:\Users\Kniggi\Games\renpy-6.14.1-sdk\renpy\character.py", line 731, in __call__
File "C:\Users\Kniggi\Games\renpy-6.14.1-sdk\renpy\character.py", line 692, in resolve_say_attributes
Exception: Say has image attributes (u'neutral',), but there's no image tag associated with the speaking character.
I hope you guys understand my rambling. Help?