My God I feel like a moron I should be better than this. Sorry if this is a repeat but I didn't see anything like this covered after about half an hour of searching the BBS.
Ok - what I'm trying to do is have a scenario in which a random number between -25 and 25 (variable is gamblingresult) is created, and then both subtracted from a cash total (variable is cash) and displayed in dynamic text. I also have a different dynamic text box below this (displaying the variable plusminus$) that calls it either a profit, a loss or a break-even day. Take a look at my horrible coding:
randomvariable=random(51)
gamblingresult=25-randomvariable
if(gamblingresult>0){
plusminus$="profit :)"
}
else if(gamblingresult=0){
plusminus$="break even session"
}
else if(gamblingresult<0){
plusminus$="loss :("
}
cash+=gamlingresult
The dynamic text displays are coded within the stage and don't seem to be a problem. The trouble I'm having is that it seems to work when the result is a positive number, but if gamblingresult would contain a negative number, it seems to end up as zero. Unless it's just generating 0 as a result of the computation, and that seems beyond probability.
Also, I'm teaching myself (out of a background in QBasic :p) so if anyone has a suggestion for a cleaner way to do this, please let me know, but try to explain fully, since it'll probably be over my head.
Thanks.