I have a quick Multireplace question that wasn’t resolved by the wiki.
Say that I’m using a numeric var to call a value from a multireplace set of values separated by pipes……
Here’s a place to start, the syntax note from the wiki:
Numeric example: @{(variable+1) Text if 0|Text if 1|Text if 2|Text if 3}
I gather the +1 there is really so coders used to the first value being 0 rather than 1 could operate with their patterns in place. But this stirred up some other ideas and questions.
But what if variable=3 ? And variable=4 ?
Here’s something likely foolish, but interesting to me. I’m looking to play around with a pretty aggressive set of multireplace inline tweaks in a “hub” block of text that is repeated that I want to coax into feeling really fresh and not flatten to “I’ve seen this before.” And one strategy could be to have multiple sets of inline insertions to call for flavor in addition to separate ones that are really functional.
What if you were using var as a counter to keep a reused block of text fresh with lots of inline insertions. But then what if the var goes beyond the number of options separated by pipes?
I was thinking of the toggling through variables option in twine, though in this case not as an interface thing, but as an experience where a label called more than once can toggle through a list of values and then go back to the first value after moving beyond the last value.
I thought of this studying Book of Hungry Names where you have to visit the trainers many times and Kyle has done so much magic to make that feel intentional and fresh every time you basically repeat the same label call.’
I can think of a bunch of external logic tests/fixes to call to keep my “index” call request cleaned of any problematic values, but this revealed that I don’t really know as much about multireplace as I thought, and am not sure what scenarios break a game! As with many things in ChoiceScript, there are my instincts to make it insanely complicated and maximalist, and then there are elegent coder strategies that crunch my 2k words of messiness down to like 10 lines of logic.
So this is a request for some help to learn some elegance! And the reward will be a technical study leaning into what I learn that I will submit at the end of the week for the NarraScope Game Jam!