Event at a random time

This is something I’ve been wondering about for a while.

I used this in my last game:

Every turn when the player is carrying the monkey and a random chance of 1 in 10 succeeds: say "[one of]The monkey picks at your hair. [or]various other choices [at random]".

But now I’m wondering about how to implement a random event that should only happen once. For example, as you move about the map, at some point a rabbit shows up that wasn’t there before.

Would be as easy as the above format, adding “for the first time” somewhere?

On the other hand, I don’t want the player to be distracted by the random event on their very first move. And maybe I don’t want the even to happen just anywhere. So maybe I’d like the event to occur on or after the 15th move, but only when the player is in the courtyard.

I think this will come in handy in future situations as well as in the rabbit puzzle, so I’m looking for general guidance or chapters in the documentation moreso than a specific implementation. I searched the documentation but didn’t find anything but the “random chance” code above.

thanks!

This would probably be a good place to use scenes (ch. 10). Something like this would work:[code]Rabbit Prelude is a scene. Rabbit Prelude begins when the turn count > 6.
Rabbit Prelude ends when the rabbit is in the courtyard for the first time.

Every turn during Rabbit Prelude:
if the player is in the courtyard and a random chance of 1 in 3 succeeds:
say “A rabbit appears.”;
move the rabbit to the courtyard.
[/code]

Oh cool Mike, that looks like what I need. Thanks!