Problem with numbers. Possible bug?
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![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
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
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
Best Answers
-
MotherHoose Posts: 2,456
@MarkOnTheIron
demo: http://www.mediafire.com/?r573qcmybkcf55f
IMO … this is not a crazy workAround …
but, an efficient way to get the functionality you want in your projectMH
Answers
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.
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!
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.
@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
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.
@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
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.
But the fact that we shouldn't be forced to make this workarounds is still true.
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
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.