Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Setting a "max number" for variables.

$
0
0
Hi. Sporadic searcher, first time poster.

Ok, so I'm working on a board game with Twine 2 (Harlowe 1.1.1... I should probably update, shouldn't I?). Through "die rolls", the player needs to make it to the end of the board (Square 100). This is what I currently have in place to propel the player up the board:

(set: $event to (random: 1, 6))(if: $event is 1)[1! (set: $Player1 to $Player1+1)You're moving to Square $Player1.](if: $event is 2)[2! (set: $Player1 to $Player1+2)You're moving to Square $Player1.](if: $event is 3)[3! (set: $Player1 to $Player1+3)You're moving to Square $Player1.](if: $event is 4)[4! (set: $Player1 to $Player1+4)You're moving to Square $Player1.](if: $event is 5)[5! (set: $Player1 to $Player1+5)You're moving to Square $Player1.](if: $event is 6)[6! (set: $Player1 to $Player1+6)You're moving to Square $Player1.]

This all works fine, except for one little aesthetics problem. The user can currently get a result higher than 100, whereas I'd like to make it so that 100 is the max result. What do I need to add to make that so?

Thanks!

Viewing all articles
Browse latest Browse all 1844

Trending Articles