3 Replies Latest reply on May 23, 2016 9:51 PM by Jadwick

    Snapmap intergers issue


      So I am having a problem with an interger here.


      I want to do the following to it by pressing three consoles :


      I want to add, divide and multiply. But I want it all done to 1 interger to get a specific value which I wish to use in a interger compare (its for a puzzle)

      At any rate I have no idea what is going wrong with it, when having all 3 consoles do it to 1 interger object it failed in the equal. When having 3 intergers all part of the same interger identifier (Ergo I called the variable that the compare uses math and all 3 are part of math) it still fails.


      Anyone any ideas?

        • 1.

          Quick bump

          • 2.

            Snapmap's arithmetic operations is an pain in the ass.

            What you could do on calculator or with the programming code within 1 minute, you must waste hours to do same in Snapmap.


            Looks like you can't multiply two variables in Snapmap, only two constants or one constant and one variable. Otherwise you'll get an infinite loop.

            • 3.

              No problems here:

              made a test map with 3 panels and 1 integer object

              one panel adds 1 to the integer

              one panel multiplies the integer by 2

              one panel divides the integer by 4


              And you can do operations on integers/floats with another integer/float, just change the constant in the operations properties to a variable by holding the options button + change (ctrl + x on PC)


              My only other thought is if you are using an integer and dividing, is that the divide option is truncating any decimal, EG:


              2 / 4 = 0.5, but an integer can't have a decimal so it's removed

              in integer division 2 / 4 = 0


              there is no rounding of numbers either, 3 / 4 = 0.75 and even though it is more than half, in int division 3 / 4 = 0


              My suggestion would be to display your int in a world text or on the HUD as you test your map so see what is happening to it as you do the operations.