Hello,
I am trying to create a random event that triggers every time you click on a passage. So far it is working for the very first time the player triggers it, but then it gives the same event over and over again when I have the player loop back around, instead of choosing a different random number.
I'm assuming that the game state gets saved in the history and just brings that up over again. Is there a way for me to get a new number each time the player clicks the passage?
My game has the player mining for silver, but I want random outcomes for each time they click the passage.
Thanks in advance. Below is the code I'm using.
In the startup passage i have:
And in the random event passage I have (sorry for the length):
I am trying to create a random event that triggers every time you click on a passage. So far it is working for the very first time the player triggers it, but then it gives the same event over and over again when I have the player loop back around, instead of choosing a different random number.
I'm assuming that the game state gets saved in the history and just brings that up over again. Is there a way for me to get a new number each time the player clicks the passage?
My game has the player mining for silver, but I want random outcomes for each time they click the passage.
Thanks in advance. Below is the code I'm using.
In the startup passage i have:
(set: $maggie_mine to (random: 1, 10))
And in the random event passage I have (sorry for the length):
(if: $maggie_mine is 1)[(set: $health to it - 15)Ouch! You manage to hurt yourself. To top it off, you mine 0 silver bits.
<center>[[Cart back up]]</center>]
(elseif: $maggie_mine is 2)[(set: $health to it - 10)(set: $money to it + 0.25)Ouch! You manage to hurt yourself. Luckily, you mine 2 silver bits.
<center>[[Cart back up]]</center>]
(elseif: $maggie_mine is 3)[(set: $health to it - 5)(set: $money to it + 0.25)You become slightly exhausted as you mine 2 silver bits.
<center>[[Cart back up]]</center>]
(elseif: $maggie_mine is 4)[(set: $health to it - 10)(set: $money to it + 1.00)You become pretty exhausted as you mine 8 silver bits!
<center>[[Cart back up]]</center>]
(elseif: $maggie_mine is 5)[(set: $health to it - 5)(set: $money to it + 1.00)You become slightly exhausted as you mine 8 silver bits!
<center>[[Cart back up]]</center>]
(elseif: $maggie_mine is 6)[(set: $health to it - 5)You become slightly exhausted, but it was all for nothing as you mine 0 silver bits.
<center>[[Cart back up]]</center>]
(elseif: $maggie_mine is 7)[(set: $health to it - 5)(set: $money to it + 0.25)You become slightly exhausted as you mine 2 silver bits.
<center>[[Cart back up]]</center>]
(elseif: $maggie_mine is 8)[(set: $health to it - 5)(set: $money to it + 0.25)You become slightly exhausted as you mine 2 silver bits.
<center>[[Cart back up]]</center>]
(elseif: $maggie_mine is 9)[(set: $health to it - 20)(set: $money to it + 2.50)You become extremely exhausted but you mine enough silver bits to form a Quarter-Eagle ($2.50)!!.
<center>[[Cart back up]]</center>]
(elseif: $maggie_mine is 10)[(set: $sanity to it - 20) What was that? You see a strange figure in the dimlit mines, like a small child. The image haunts you. Are you losing your sanity?
You mine 0 bits.
<center>[[Cart back up]]</center>]