(17/17)*100 should = 100, correct?
Nklrcade
Member, PRO Posts: 95
Ranking and score work great on my MacBook, but I continue to have mathematical issues on iPad.
At the end of my level I have a 'Change Attribute: self.Moves To:(17/game.Moves)*100'
I used Display Text to make sure and 'game.Moves' does equal 17, so (17/17)*100 should equal 100% but shows up as 89.47% on my iPad.
Can't find the bug, because sometimes 'self.Moves' will equal 100%.
Any ideas??
At the end of my level I have a 'Change Attribute: self.Moves To:(17/game.Moves)*100'
I used Display Text to make sure and 'game.Moves' does equal 17, so (17/17)*100 should equal 100% but shows up as 89.47% on my iPad.
Can't find the bug, because sometimes 'self.Moves' will equal 100%.
Any ideas??
Comments
(17/19)*100 = 89.47 (...)
It would be useful to see your rules, but without seeing them I suspect (a guess) the answer might be to place a timer (as a delay) somewhere in your rules to allow some calculation to happen (and display) before the 'moves' value creeps forward a little.*
Hi @Nklrcade Odd that it should be happening; good advice from @Socks...
As far as I know, mathematical equations are the most watertight there is in GSC and there's not really anything that can go wrong...
The result 89.47 is when self.Moves = 19, so the attribute must be picking up an extra 2 from somewhere, sometime....
Another thing to try, which shouldn't make any difference at all, but perhaps worth a try, is to add another pair of brackets:
Change Attribute self.Moves To ((17/game.Moves)*100)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I added a timer (as a delay) and additional brackets but no luck.
I do have a bit of animation running at the same time... do you think this could be the reason for the 'slip'?? Is there a way to find out when it adds the extra 2? It's hard to tell due to the fact that Display Text 'game.Moves' still reads 17.
So perhaps a bit more info might help: what are you using game.Moves for? And does this attribute's value start out as 17? And what else is happening in the Rule when you use the equation?
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
@Nklrcade There are definitely ways to find out when this is happening. Besides DisplayText, which is helpful but is a constrained attribute, you can use Log Debugging Statements at various points in your rules to see exactly where (if you like, even add ..game.Time to see the time) things are changing value.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Once you solve the puzzle then game.CheckWin = true.
Once game.CheckWin = true, the results actor is activated - after .05 seconds Change Attribute self.Moves To ((17/game.Moves)*100)
The rules i've set up work every time when played on my MacBook and the Log Debugger confirms the proper coding, but 'slip' once played on my iPad.
Will the Log Debugger work from my iPad??
If you'd like, you can send me a link to download the project file (first compress it as a .zip file) and I'll take a look.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
thanks for pushing me into finding the problem. i appreciate your help.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Ah! The classic sausage fingers issue !