Page 1 of 1

### difference between 2 numbers (not distance)

Posted: Wed Jan 18, 2017 10:26 pm
hi im having trouble finding the logic for finding the difference between to value, anyone able to help??

Thanks

### Re: difference between 2 numbers (not distance)

Posted: Wed Jan 18, 2017 10:47 pm
System >> compare two values then use logical comparison there (equal to, not equal, less than, etc.).

### Re: difference between 2 numbers (not distance)

Posted: Thu Jan 19, 2017 10:43 am
there is no difference option there. ill explain better.

the user collects xp and is stored in xp "xpplayer" variable
is then added to "xptotal" total variable

if the user "xpplayer" variable exceeds the "xptotal" variable then
the player levels up and the "xptotal" variable is reset to 0 and whatever is left from
the xpplayer" variable get added to "xptotal" so they can get xp to level up again

hope this helps

### Re: difference between 2 numbers (not distance)

Posted: Thu Jan 19, 2017 11:32 am
Yes, there is a 'not equal to' option in 'system > condition > Compare two values'. But that is not what you need.

System > Every Tick
Sub EventS ... Local variable 'Exceed' = 0
........................System > Compare two values ... First = Player.xpplayer ... Comparisation = '> is greater then' ... second = xptotal
....................................ActionS: Set 'Exceed' to xptotal - Player.xpplayer
.................................................Set xptotal to zero
.................................................Set Player.xpplayer to 'Exceed'
.................................................Level up