Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Multiple variable dependant widgets

$
0
0
So in my little game the player can choose between being a man or a woman and a couple different races. I would like to have a couple different widgets that are dependant on whether you are a man or a woman, your race and maybe another stat, strength for example.

I don't know how to write the code for this though. As an example this is sort of like what I want to do..

<<widget "plr-body">>
<<if $plr.gender eq 1>>
<<if $plr.race eq 1>>
<<print "strong toned body">>
<<elseif $plr.race eq 2>>
<<print "short strong dwarfen body">>
<<elseif $plr.race eq 3>>
<<print "tall elfin frame">>
<</if>>
<<elseif $plr.gender eq 2>>
<<if $plr.race eq 1>>
<<print "wiry human body">>
<<elseif $race eq 2>>
<<print "short curvy body">>
<<elseif $plr.race eq 3>>
<<print "lean elfin frame">>
<</if>>
<</if>
<</widget>>

That's just an example but the format is what I really want to know how to do. How do I stack multiple dependant variables within a widget.

If a character is a female, human with a strength of 10, the widget displays x.

If a character is a male, dwarf with a strength of 15, the widget displays y.

and so on and so forth..

Any thoughts? Am I even on the right track here?


Viewing all articles
Browse latest Browse all 1844

Trending Articles