I have what is maybe a weird question/request. I've been working on the concept and storyline of my game for a while now with the attitude of "Write it now, worry about execution later" because I knew I'd get too overwhelmed and scared of limitations if I thought about the coding XD But now I'm almost done with the text, just wrapping up a few loose ends, and looking at putting things together.
I've more or less figured out how to keep track of variables and if/else statements, so that feels like a triumph

But here's my question!
Is there a way to create a "random event" in Twine?
So as an example: You're walking through a forest, and a bear appears. But the bear doesn't always appear at the same time/after the same passage from one play-through to the next. In fact, every time you click on a passage, you have some small chance of the bear passage appearing.
The idea would be to make it startling and intrusive -- sort of the textual equivalent of jump-scare.
Is this possible? How would I set that up?
Comments
Or if you don't want things to happen every result: The important thing to remember is that 0 is a number too, so the random function will roll 0 at some times. If that bothers you you can always just say <<set $variable to random(5) + 1>>.
Or, you could simply specify the
min
parameter, as noted in therandom()
function's documentation. For example:;D I think I can manage this. Thank you guys!