So I just switched to SugarCube to use the awesome save features, and am very happy with all that--but of course, other things don't work quite so well!
For one thing, it appears the either() function is not supported? I was kinda using that, but now it's telling me that "either is not defined."
Can someone suggest a workaround? I was using it to add variability to my very simple combat system-- $skill + either(0,1,2,3,-1) + $weapon gte $monsterpower sorta stuff. Is there a random number function for the code illiterate?
And secondly, I was having fun using either() to create random events in my central hub card...weather, one of the characters wandering through, that sort of thing, by putting text strings in. I was hoping to use that to cause semi-random events, like merchants appearing and rains of frogs and so forth.
If there's a random number function, I suppose I can use that to make a clunky equivalent--assign $random_happening using the random number, and then build a really large list of if/else? But either() seemed a easier.
Does anybody have a workaround? Am I just doing it wrong?
Comments
Following example from SugarCube docs:
If you really wanted to use a function by that name, you can always use a very simple shim. For example: And yes, there are random functions as well: random(min , max) and randomFloat(min , max). It's also possible to enable a seedable PRNG, to make random results within a playthrough deterministic, if you needed/wanted something like that.
Shows all the code. I'm using the most recent version of sugarcube.