Hi everyone!
my name's quinten, and i've been fiddling around with darkbasic for some time now, never took the time to make a forum post though

.
Here's my problem, i've been working on my first game, creating a virus (biological) and evolving it, infecting other cells etc.
it's text based,uses a lot of random numbers and a (5,10) array.
now the problem is, sometimes it just quits the program between an if and a wait key, it doesn't even return an error.
i put a print "whoops, error" and a wait key at the end, which the program shows like normal, so there isn't a "real" error.
here's a code snippet
if infectchoice$="t" or infectchoice$="T"
playercombatroll=rnd(15)+player(2,2)
if playercombatroll >20 then playercombatroll = 20
if playercombatroll <0 then playercombatroll = 0
playercombatmodifier=playercombatroll-distance
if playercombatmodifier <0 then playercombatmodifier=0
if playercombatmodifier <10 or playercombatcombatmodifier = 10
print "You try to latch on, but you fail."
distance=distance+rnd(3)
print "the cell got a little farther away"
print "the cell is now ";distance;" nanometers away from you"
wait key
cls
Goto cellhunt
in this piece of code it usually stops, before the wait key, it just displays the "whoops, error" and the program exits.
the playercombatroll and playercombatmodifier variables weren't there in the first place, it just rolled the random numbers, added the skill modifiers and compared them, resulting in an outcome.
so, does anyone have some advice on how to solve this?
i'd be very gratefull