Strange behaviour?

pHghostpHghost 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

  • BBEnkBBEnk Member Posts: 1,764

    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.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    I just submitted this as a bug.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • LovejoyLovejoy Member Posts: 2,078

    @pHghost @tatiang Use text expression for a workaround. If self.hundreth is self.zero

    Fortuna Infortuna Forti Una

  • pHghostpHghost London, UKMember Posts: 2,342
    edited April 2015

    @Lovejoy said:
    Use text expression for a workaround. If self.hundreth is self.zero

    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.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @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

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2015

    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.

  • pHghostpHghost London, UKMember Posts: 2,342

    @tatiang said:
    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.

    I meant I cannot see the bug you submitted in the bug database. I can see what is happening in your example. ;)

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    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

  • pHghostpHghost London, UKMember Posts: 2,342

    @tatiang said:
    Oh sorry, I misunderstood. It's being reviewed and hasn't been posted publicly yet.

    Cool, that's what I thought.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • pHghostpHghost London, UKMember Posts: 2,342

    Thanks! Comment added!

Sign In or Register to comment.