Well, first of all you’re missing a closing quotation mark in your optionsfrom macro, so that can’t be helping.
But in general, this might be easier if you used object properties instead of separate variables; I used widgets like this in my recent game and that’s how I did it.
So in StoryInit you would have:
<<set $healer to {gender : "Non-Binary"}>> (or whatever you want as a default)
<<widget "she">><<if $args[0].gender is "male">>he<<elseif $args[0].gender is "female">>she<<else>>they<</if>><</widget>>
And when you wanted to use it, you would call it the same way as you did in your example. It’s really a very small change, but it saves you from having to muck around with string concatenation the way you’re doing right now.
EDIT: Oh, no, sorry, you would want to call it using:
Thank you so much! I’m still not 100% sure how, but that seems to work.
I was using something similar before this, but it didn’t work for me. Your solution is much better.
Yeah, the Sugarcube documentation basically assumes you already know JavaScript, so it doesn’t really cover “what is an object and how do you use it?”, but they’re incredibly useful once you get into more complex stuff like this.
This is something I found with a quick Google search, but this intro to objects looks pretty clear: JavaScript Objects
They basically work the same way in Sugarcube except that where the JS examples read:
const car = {type:"Fiat", model:"500", color:"white"};