Forgive me if I'm being obvious or repeating something someone else posted. I'm a newbie. It's what we do.
Anyway, been thinking a lot about an easy method to put random outcomes based on mathematical operations into our stories (I.e. combat). Such things should be handled in one section, and not spread across a bunch of them. I think I hit on a method - again, I don't know if anyone's done this or not. Don't mean to claimjump.
So, the way this works is pretty simple. We make our "dice" rolls and determinations at the start of the section (hidden from the user, of course). And then, after we describe what is scene and give our options. For the option that involves the combat, the two possible outcomes are presented, with different sections to go to but the same descriptions. Hench, the outcome is predetermined. The user just can't tell the difference until he clicks through.
[[start]]:
var rnd = Math.ceil(Math.random() * 2); // random number between 1 and 2
squiffy.set("rnd",rnd);
You step out into the dusty Texas street. A short distance away, the gunslinger awaits. You step up, center yourself, and stare into his eyes.
{if rnd=1: [[Draw!]](win)}{else:[[Draw!]](lose)}<br>
[[Run!]]
[[win]]:
He goes down, a bullet through his heart. Happy citizens flood out of their shops and saloons to surround you. Happy ending.
[[start]]
[[lose]]:
Something kicks you in the chest. You blink your eyes to look up into that pale sky. Your life ebbs. Shoulda... practiced... more...
[[start]]
[[Run!]]:
Well, you gave them something to talk about in town, you coward!
[[start]]
Anyway, figured I'd pass this along in case someone else was looking for a way to do this.