Discussion Forums at Tactical Neuronics


Variable Looping problems... From:
Nutty

ok, i've got a basic bug with a seek & destroy attitude, but for some reason the variables are getting weird.
heres the problem code:
hunt:
;heres where the numbers, if negative, should be fixed
if value vp < 0 then math vp = #x_pos - #enemy_x
end if
math v1 = ~vp - 1
goto run

run:
assign vw 1
loop:
move forward
math vw = ~vw + 1
;next line problem!
if value vw = ~v1 then goto start2
end if
goto loop

in debug, on the problem line, it says :
if vw = -6 then goto start2

but i ought to have already stopped it from being minus numbers.

Replies to this message:


© 2001, John A. Reder.