Problem with numbers. Possible bug?

MarkOnTheIronMarkOnTheIron Member Posts: 1,447
edited July 2012 in Working with GS (Mac)
I'm having a big problem with numbers.

See this video: https://dl.dropbox.com/u/8244920/Images/ScreenFlow.mov

I'm increasing a value by 0.01 at every click and the green numbers on the bottom right are constrained to that value.

As you can see at one point it's like if the green actors miss one click. It's like they are then constrained to another value and that's impossible (unless I managed to link the numbers yo a parallel universe that's one digit behind)

Here are the rules for the click actor that increase the value: https://dl.dropbox.com/u/8244920/Images/Screen Shot.png

And this are the rules of the green actors: https://dl.dropbox.com/u/8244920/Images/Screen Shot2.png

Probably the solution is simple, but I slept only 3h in the last 3 days and I'm starting to see strange things :)

Best Answers

Answers

  • HapiappsHapiapps Member Posts: 373
    Have you tried adhoc or maybe even the viewer might work better than the preview since the code seems alright at first glance.
  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    Yes, I tried. It's the same also with adhocs :(

  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    Ok, i'm starting to convince myself that it is indeed a bug.

    I'm starting to suspect that even if I add only 0,01 in reality it adds 0,00999999... (or something like this) and then for some strange reason it round up the number in the display text but the other expressions (like the one on the green digits) use the wrong one.

    In fact I tried to use this expression: https://dl.dropbox.com/u/8244920/Images/Screen Shot3.png

    In it I force the number to be rounded down to only the first two decimals. With that expression now it works.

    I also submitted it to GS because if it is true it could be a big bug, at least for me.

  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    edited July 2012
    After some tests even my second method didn't work. So I something similar to what @jn2002dk suggested and I add to my value "10/100" instead of "0.01". :(

    I think that this is a big problem and a major pain in the ass. Hell, if I want to add 0.01 to a value let me add it! I don't want to spend 2h of my time trying different methods to add a simple 0.01!



  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    And I must add that even using 1/100 didn't work perfectly because at one point the display text went from 1.73 to 1.7300001 and then it continued like this.

    I think that this is the end for those that want to use GS to make even a simple calculator. We just don't have the precision it would be needed. :(

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited July 2012

    @MarkOnTheIron

    Hi Mark

    I'm not totally understanding what sort of app you're after; I'm guessing your comment about a calculator was just an example?

    Also not sure why you're needing to use floor in this instance; nor where your min and max values come into play during runtime; anyhow, as far as I can understand from your description and vid, you're wanting a number displayed that goes up in 0.01 increments on every click, and another display that displays the same through a constrain behaviour?

    If so, I've done a straightforward game file test:

    https://dl.dropbox.com/u/14060718/increm+con DG.gameproj.zip

    If you could explain why and where you need the floor function, the same with your min and max, hopefully I can weave in those functions into the game file for you.

    hope that's been of some help.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    @gyroscope Yes the calculator was only an example, on the real thing the green digits will be part of a game hud.

    I used the floor in one of the example to see if by rounding down the values it would make any difference. It did not.

    Thanks for your project but I don't need to constrain an attribute to another, I need to constrain the digit image to an attribute that I'm increasing and decreasing.

    Here's a quick example of what I'm dealing with:
    https://dl.dropbox.com/u/8244920/DigitTest.zip

    On test 1 and 2 see what happens when the count reach 1.58.
    On test 3 see what happens when the count reach 2.08.

    Maybe it's me that I'm doing something wrong or a bug in the system. Either way it's a pain.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited July 2012

    @MarkOnTheIron

    Wow - in a bad way - Mark, I see what you mean. That's the weirdest thing... I can't quite work out what's going on there either... the floor/modulus equation used to be rock-solid for timers, etc., I'm scratching my head with this one.... sorry I couldn't help out.

    What's so crazy about it doesn't work for 1.59 only (as you've obviously seen); and as far as I can see doesn't go wrong after that.... it just doesn't seem to like 1.59......

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    I'm partly relieved to know that it wasn't me going crazy :)

    However this could be huge there are sometimes where precision must be absolute like my situation were i have to successfully add a 0.01 value to an attribute.

    I found a workaround by using only integers and then faking the digit actors to "seems" like they have decimals. I start my attribute from 150 instead of 1,5 and I add a +1 every time, then on the digit actors I changed the rules to show the correct values. Then I need to remember in all the other calculation where my attribute is required to divide it by 100. Then it would work.

    But in theory we shouldn't be forced to find crazy workarounds with the use of lateral thinking, we should be able to use more straightforward methods.

    I contacted GS to let them know of the problem. I hope they can fix it.

  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    edited July 2012
    Thanks @MotherHoose that's exactly as I wrote on my previous post for a temporary fix. :)

    But the fact that we shouldn't be forced to make this workarounds is still true.


  • MotherHooseMotherHoose Member Posts: 2,456
    edited July 2012
    @MarkOnTheIron … duh! didn't read past your dropboxProject! :\">

    although, as I am a completeControl Freak … I like index more than integer, in this one.

    liked how you demonstrated that realValues vary in alternative realities!

    @};- MH
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    edited July 2012
    @MarkOnTheIron -- couldn't you just use old fashioned arithmetic?

    For example, make four variables: Temp, Huns, Tens, Ones
    Temp = game.Height * 100
    Huns = floor(temp/100)
    Tens = floor((temp-(Huns*100))/10)
    Ones = temp-(Huns*100)-(Tens*10)

    Untested -- did I do the arithmetic right? For some reason, the 'Tens' calculation does not feel quite right. If it's not correct I hope the idea shows through.
Sign In or Register to comment.