Custom Score Weird Error...?
Games4life
Member, PRO Posts: 279
Hi there,
I am using a custom font which has worked GREAT until I viewed it on my iPad. You see, when I earn a score anywhere from 0-10 the screen starts blinking. This does not happen in preview mode in Gamesalad. Howeever, once I exceed 0-10 the screen is back to normal. By the way, it is an endless runner game and I tested on my iPad Mini 2.
Thanks,
~G4L
Comments
The whole screen ?
Yes, it goes black for about a half of a second maybe less.
What logic are you using for the custom score?
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Here is my code:
I continue with the divs until 100000
Hope this helps
~G4L
Open the expression
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
My apolo
gies
Lol, I'm not sure how hiding information is going to help.
AH, Sorry!
floor( game.score % self.div )/10
Screenshot Saver a bit off.
floor(game.score % self.div) / 10 where self.div is 10 and game.score is 0 to 10 is going to result in these values:
game.score result
0 0
1 0.1
2 0.2
3 0.3
... ...
If you mean for the result to be an integer, you need to change your expression to the following:
floor(game.score % self.div) / (self.div / 10)
(Source: http://forums.gamesalad.com/discussion/80130/custom-font)
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I tried that and I received a white box instead of the custom font...
What else happens when you update the score? It's entirely possible the flashing screen is unrelated to the custom font.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Agreed. Try disabling/deleting the custom font actors and see if it still flashes.
Also, if you're seeing a white box it means that GameSalad can't find an image filename that matches your expression. If you named your images 1.png, 2.png, 3.png, etc., then Change Attribute self.Image to floor(game.score % self.div) / (self.div / 10) should show an image. If it doesn't, use the Display Text or Log Debugging behaviors to verify that the result is what you expect it to be (e.g. "4" when "4.png" should be shown). The ".png" is optional in the expression so I usually leave it off.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I'll try these options out thanks for your help!
~G4L
It does not blink while in preview mode. It blinks while testing the app out on my iPad. it only blinks when it counts 1, 2, 3.... All the way up to 10. Once the score hits 11 the screen stops randomly blinking. The rule I have been using has been working great until I tested it out on my iPad. Any suggestions?
Again, you'll need to disable actors/rules one by one until you discover the problem. It could be something to do with your custom font rules or something else all together. Just because something works on a Mac in Preview doesn't guarantee it will work the same on a mobile device (different processors, memory, etc.).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Follow @tatiang's advice and remove the custom font actors from the scene. Then run the project again. Does it still flash when the score increases? If not, then you know it's the font actors and we can keep troubleshooting those. If it does still flash, we know the flash is caused by something else that you have happening when the score changes.
We need to eliminate potential causes.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Thanks for all your help so far...
I tried removing one of the font actors. When I removed the ones place numeral actor. A similar problem occurred with the tens place actor. Every time the score increased by 1, the entire screen blinked. Any help is always appreciated.
Okay so you've narrowed it slightly to the tens place actor or some other actor on the scene. What happens when you remove the tens place actor? I think you can see that this is a repetitive process... my next question would be: what happens when you remove the hundreds place actor? (etc.)
Maybe just create a new blank scene and put a single actor on it and then have the score increase (e.g. via a Timer). Then troubleshoot the rules and behaviors in that one actor until the flashing stops.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Good suggestion, I'll keep trying these out and thanks for all your help so far. I'll let you know my result.
~G4L
@tatiang @Armelline
Well its all fixed! A weird solution, I changed the movement of my main character and now the blinking has disappeared. Thanks for all your help and support. People like you are the reasons why GameSalad is an amazing platform!
Best of luck with your projects,
~G4L
Yay! You're welcome... glad you got it working.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User