I’m getting this error on random test. It’s showing up as infinite *page_break’s . Unfortunately this game is very code heavy. I’m assuming it’s somewhere in this section of code spread over 2 scenes. (I think anyway. Wish random test gave line numbers). I’ve been over and over it but can’t work out where it would have an infinite loop of pagebreaks. Any suggestions please?

*if (coins > 0)
*if ((traps >= 0) and (traps < 31))
*if (thief < 5 )
To your knowledge, no thieves were able to break into your home this year.
*if (thief > 4)
To your dismay, you find that your home has been broken into.
*if (thieftype = 1)
At least they were not as capable as some of their kind, only managing to steal 5% of your treasure.
*set calcstolen (coins * 0.05)
*if (thieftype = 2)
They were reasonably competent for their kind, managing to steal 15% of your treasure.
*set calcstolen (coins * 0.15)
*if (thieftype = 3)
In a panic, you find that they were able to make off with almost 30% of your hoard and there is no way to trace them. They must have been skilled at their work indeed.
*set calcstolen (coins * 0.30)
*set coins (coins - calcstolen)
*set totalstolen (calcstolen + totalstolen)
*page_break
*if (goblin = "leave")
*set goblin "leaveend"
*goto_scene years
(Scene years)
*label summary
*page_break
*temp modifyfood 0
*temp modifycoins 0
*temp temphealth 0
*temp tempfood 0
*temp foodloss ""
*if (skin = "scales")
*if (hibernateno = 0)
*set hibernatefood 100
*if (hibernateno = 1)
*set hibernatefood 150
*if (hibernateno = 2)
*set hibernatefood 200
*if (hibernateno = 3)
*set hibernatefood 250
*if (skin != "scales")
*if (hibernateno = 0)
*set hibernatefood 100
*if (hibernateno = 1)
*set hibernatefood 150
*if (hibernateno = 2)
*set hibernatefood 250
*if (hibernateno = 3)
*set hibernatefood 300
*set foodeaten 0
*set food 0
*set tempfood 0
*set temphealth 0
*set hunt ""
*set treasurehunt ""
*set elementhunt ""
*set securityhunt""
*comment reset each year
*comment survival check for overstayed hibernation times.
*if (hibernate = 6)
*set health -10
*if (hibernate = 7)
*set health -10
*if (hibernate > 7)
*set health -20
*if (health < 1)
Lack of rest has taken its toll on your growing body. You've overstayed your time in the waking world, and as a result your health fails. Eventually you find yourself weakened to the point that you can no longer rise and slip into a deep sleep from which you never wake.
*goto_scene died
*comment knight check has been moved to summarydragon page and under the hibernate label on this one due to RNG
*if ((humans >20) and (humans < 41))
*if (knight = 10)
*goto_scene knightbattle
*if ((humans > 40) and (humans <61))
*if (knight > 7)
*goto_scene knightbattle
*if ((humans > 60) and (humans <81))
*if (knight > 5)
*goto_scene knightbattle
*if ((humans > 80) and (humans <100))
*if (knight > 2)
*goto_scene knightbattle
*if (humans = 100)
*goto_scene knightbattle
*if (completedevent1 = "no")
*if (hibernateno = 0) and (hibernate =4)
*goto_scene randomevent
*if (completedevent2 = "no")
*if (hibernateno = 1) and (hibernate =2)
*goto_scene randomevent
*if (completedevent3 = "no")
*if (hibernateno = 2) and (hibernate =1)
*goto_scene randomevent
*if (completedevent4 = "no")
*if (hibernateno = 3) and (hibernate =3)
*goto_scene randomevent
*if (health > 100)
*set health 100
*if (health < 0)
*set health 0
*if (health > 84)
*set healthtxt "and in excellent health"
*comment 85-100%
*if ((health > 69) and (health < 85))
*set healthtxt "and in good health"
*comment 70-84%
*if ((health > 54) and (health < 70))
*set healthtxt "and in fair health"
*comment 55-69%
*if ((health > 39) and (health < 55))
*set healthtxt "and are weakened"
*comment 40-54%
*if ((health > 24 ) and (health < 40))
*set healthtxt "and are significantly weakened"
*comment 25-39%
*if ((health > 9) and (health < 26))
*set healthtxt "and are dangerously unwell"
*comment 10-25%
*if (health < 10)
*set healthtxt "and are so weak that some days you are barely able to rise"
*comment <10%
*if (humans > 100)
*set humans 100
*if (humans < 0)
*set humans 0
You are currently ${age} years old ${healthtxt}.