jeudi 17 novembre 2016

batch file thinks 3 gtr than 2*2

Okay I'm trying to make a infinite leveling system for a little personal game I'm making but it doesn't work. This is what it looks like.

if %exp% gtr %lvl%*%lvl% goto lvlup
:lvlup
set /a exp=%exp%-%lvl%*%lvl%
set /a cmhealth=%cmhealth%+5
set /a cchealth=%cchealth%+5
set /a cattack=%cattack%+3
set /a cDefence=%cDefence%+4
set /a cspeed=%cspeed%+2
set /a lvl=%lvl%+1
set /a SP=%SP%+1
goto decisions

It runs fine until it gets to something like

if 3 GTR 2*2 goto lvlup
set /a exp=3-2*2
set /a cmhealth=25+5
set /a cchealth=18+5
set /a cattack=8+3
set /a cDefence=15+4
set /a cspeed=8+2
set /a lvl=2+1
set /a SP=1+1
goto decisions

and exp is then set to -1. Why does it do this and how can I fix it. (The problem is it doesn't read 2*2 as 4 or 3*3 as 9.

Aucun commentaire:

Enregistrer un commentaire