Custom Score Weird Error...?

Games4lifeGames4life 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

  • SocksSocks London, UK.Member Posts: 12,822

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

    The whole screen ?

  • Games4lifeGames4life Member, PRO Posts: 279

    @Socks said:

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

    The whole screen ?

    Yes, it goes black for about a half of a second maybe less.

  • ArmellineArmelline Member, PRO Posts: 5,332

    What logic are you using for the custom score?

  • Games4lifeGames4life Member, PRO Posts: 279

    @Armelline said:
    What logic are you using for the custom score?

    Here is my code:

    I continue with the divs until 100000

    Hope this helps
    ~G4L

  • Games4lifeGames4life Member, PRO Posts: 279

    @Lost_Oasis_Games said:
    Open the expression

    My apolo
    gies

  • SocksSocks London, UK.Member Posts: 12,822

    @Games4life said:
    My a polo

    Lol, I'm not sure how hiding information is going to help. :)

  • Games4lifeGames4life Member, PRO Posts: 279

    @Socks said:

    @Games4life said:
    My a polo

    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.

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

    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

  • Games4lifeGames4life Member, PRO Posts: 279

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

    I tried that and I received a white box instead of the custom font...

  • ArmellineArmelline Member, PRO Posts: 5,332

    What else happens when you update the score? It's entirely possible the flashing screen is unrelated to the custom font.

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

    @Armelline said:
    What else happens when you update the score? It's entirely possible the flashing screen is unrelated to the custom font.

    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

  • Games4lifeGames4life Member, PRO Posts: 279

    @Armelline said:
    What else happens when you update the score? It's entirely possible the flashing screen is unrelated to the custom font.

    @tatiang said:

    @Armelline said:
    What else happens when you update the score? It's entirely possible the flashing screen is unrelated to the custom font.

    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.

    I'll try these options out thanks for your help!
    ~G4L

  • Games4lifeGames4life Member, PRO Posts: 279

    @tatiang said:

    @Armelline said:
    What else happens when you update the score? It's entirely possible the flashing screen is unrelated to the custom font.

    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.

    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?

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

    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

  • ArmellineArmelline Member, PRO Posts: 5,332

    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.

  • Games4lifeGames4life Member, PRO Posts: 279
    edited December 2015

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

    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.

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

    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

  • Games4lifeGames4life Member, PRO Posts: 279

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

    Good suggestion, I'll keep trying these out and thanks for all your help so far. I'll let you know my result.

    ~G4L

  • Games4lifeGames4life Member, PRO Posts: 279

    @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

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

    Yay! You're welcome... glad you got it working.

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

Sign In or Register to comment.