Strange behaviour?
pHghost
London, UKMember Posts: 2,342
This is really, really strange. No matter what, I cannot explain what is going on here. The buttons are supposed to light up as defined by the number, but react strangely.
Is it a bug? Or am I just missing something?
Comments
Seems Gamesalad is not reading decimals correctly if you make them 0.1,0.2,0.4,0.6 it works. seems Gamesalad for example GS is seeing 0.35 as 0.4 and so on.
Yep... something's not working right.
This:
Results in this:
That Log Debugging Statement should only trigger when those two values are equal.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Here's an even simpler version of the bug in a new project file I created:
And the result:
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I just submitted this as a bug.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@pHghost @tatiang Use text expression for a workaround. If self.hundreth is self.zero
Fortuna Infortuna Forti Una
That works, yes, thanks. For a new project it might be a solution. Though of course on a project with many instances of numbers being compared, going through everything to change it is a bit of a nightmare.
Simply put -- my AI pathfinding stopped working entirely after updating to 13.9, which is really annoying, as it was the version I hoped would get me back on track with the new import/export CSV function. As you can imagine, a pathfinding AI won't be just a few blocks of code, and there is a lot of underlying math. The search for resolving the issue led me to this, but I can in fact confirm that this issue is also present in 13.2 Nightly, in which my pathfinding works, so the issue seems a bit more complex.
So, there is the question whether this underlying problem might show itself up somewhere else. If GS has an error with simple math like this, there might be a domino effect.
I can't see the bug @tatiang -- can you add 13.2 Nightly as a version that has the bug as well? It might be in earlier versions, but cannot test that at the moment.
@pHghost it's just a single rule that says When self.hundredth = self.zero, Display Text "0.01 = 0"
I manually set the value of self.hundredth to 0.01 and self.zero to 0.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
This issue exists in 12.10 too.
You can get around it by shifting the maths out of the problem range (less than 0.01), so for example instead of comparing A (0.01) to B (0), you could compare A * 100 to B * 100.
I meant I cannot see the bug you submitted in the bug database. I can see what is happening in your example.
Oh sorry, I misunderstood. It's being reviewed and hasn't been posted publicly yet.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Cool, that's what I thought.
Here's the bug report: http://bugs.gamesalad.com/show_bug.cgi?id=956.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks! Comment added!