Nice idea, I’ll have to check if that would help with any of my code. I’ve mostly ended up either combining with *if statements or separating the multireplaces across multiple variables.
Haha, perhaps too much nesting would get a little out of hand. Seeing how much more compact my code is thanks to multireplace, though, I’d imagine that 1 nested level could actually still make the code clearer. But I could be wrong!
Sure, it’s not at all a necessary feature, but then neither are many of the more programming-heavy features, yet they can be really helpful to people who do choose to utilize them. Anyway, it’s just me dreaming!
It would be @{(languages <= 59) the foreign tongue | Deeplandish} in this case. You want the first part to be something an *if will see as either true or false, whereas language + 59 is just a number.
I’d been using multireplace properly for variables where, for instance, biting_daisies = 1 (or 2, 3, 4, etc.) but then it occurred to me that multireplace would be really useful for some of my on/off *if flavour text. But I nearly implemented it all wrong, because my way would have only worked if the player had exactly 60 or 61 in languages. I hadn’t thought it through properly; too excited about ending the endless string of *if statements, I suppose.
Actually, it would’ve thrown an error. I drew up a little test file while I was composing my reply (which then got ninja’d to the point I didn’t need to post anymore.) My code looked like this:
*create languages 50
You hear people conversing in @{(languages + 59) the foreign tongue|Deeplandish}.
It gave me the following error: line 7 of startup: invalid @{} at letter 31; ‘languages + 59’ is equal to 109 but there are only 2 options
So here 1 means she has daisies and 2 means she has sunflowers, right? If you wanted to replace flowers, you’d use:
A girl and her @{girl daisies|sunflowers}.
At least, if I’m understanding correctly. Then if you wanted her to have other flowers for values of 3 and 4 and what have you, as long as one keeps track of what number equates to what state, it’s possible to just expand into
A girl and her @{girl daisies|sunflowers|nasturtiums|Venus flytraps}.
I’ve mentioned this elsewhere, but if you set a character’s gender variable as numeric instead of a string, you can simplify plural-variant verbs for “they/them” pronouns. For example:
*fake_choice
#Non-binary.
*set gender 1
*set they "they"
#Female.
*set gender 2
*set they "she"
#Male.
*set gender 3
*set they "he"
Then you can insert things like @{gender teach|teaches|teaches} or @{gender go|goes|goes} inline instead of breaking your sentences apart to use structures things like:
I’ve just added a variation of @Minnow’s suggestion over on the Wiki.
The only difference is that instead of a numeric gender variable (they = 1, she = 2, he = 3), I’m suggesting a Boolean, “plural,” to keep things simpler. In English, I don’t think there are any verbs that conjugate differently for he and she. So it could work like this:
My preferred pronoun is
*fake_choice
#They.
*set plural true
*set they "they"
#Royal We.
*set plural true
*set they "we"
#She.
*set they "she"
#He.
*set they "he"
and then inside the multireplace brackets, we only need: @{plural go|goes} without the need for a third option.
Feel free to suggest edits to the Wiki. I’m still new to multireplace, and to coding for nonbinary characters.
@dfabulich Will you be able to accommodate this request for the next update? If it’s possible, I’d like the *if and *elseif codes to allow us to write options without using *goto at the end of the choice. As it is now, the codes require us to use *goto or *finish at the end of every statement under the *if and *elseif codes. Like this for example:
*if choice = 1
Your choice is one
*goto next
*elseif choice = 2
Your choice is 2
*goto next2
*else
You chose none
*finish
It would be great if we can write it like this instead:
*if choice = 1
Your choice is one
*elseif choice = 2
Your choice is 2
*else
You chose none
*finish
It kinda works like *fake_choice because if any of the conditions are met it goes directly to the next set of commands–in this case, it’s *finish.