custom score font problem

evertevert Member Posts: 266

Hi all!

i'm having something strange going on.
My custom font won't work.

what is happening?
My score integer defines the div integer of the font.
floor((game.score%self.div)/(self.div/10)).."png"

When i set my score integer at lets say 999 the game starts with my custom font at a score of 999.
But when the score changes, nothing happens and it stays 999.

when i make a display text with game.score it show perfectly.
How come it does not change?

And yes i did do div 10 div 100 div 100.... to each number

thanks

Comments

  • deej011deej011 Member Posts: 159

    Did you put ".png" not "png"

  • mhedgesmhedges Raised on VCS Member Posts: 634
    edited April 2015

    @evert,

    Hello. Looking at the above, you're missing a period within the quotes - ".png" . Check that out.

    The floor expression figures out the number, then the .. joins the number with .png , the file suffix.

    Also, you should have used the expression in a "contain attribute" behavior or a very frequently updated "change attribute" behavior.

    Good luck!

  • evertevert Member Posts: 266

    but it does respond when i change my attribute integer directly to lets say 999..
    it does not respond to change when the game plays.

  • gingagaminggingagaming FREELANCE GS DEV Member Posts: 1,685

    @evert said:
    Hi all!

    i'm having something strange going on.
    My custom font won't work.

    what is happening?
    My score integer defines the div integer of the font.
    floor((game.score%self.div)/(self.div/10)).."png"

    When i set my score integer at lets say 999 the game starts with my custom font at a score of 999.
    But when the score changes, nothing happens and it stays 999.

    when i make a display text with game.score it show perfectly.
    How come it does not change?

    And yes i did do div 10 div 100 div 100.... to each number

    thanks

    Are you using the "constrain" behaviour or the "change" attribute?

    You should be constraining the image not changing the image.

    Failing that, please post a screen shot of the logic so we can see what you have inside.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited April 2015

    Is it "Change attribute" or "Constrain attribute"?

    It has to be a Constrain, or else it won´t change.

    Mental Donkey Games
    Website - Facebook - Twitter

  • mhedgesmhedges Raised on VCS Member Posts: 634

    @evert,

    If that is the case, check your game logic. You could be missing a rule where upon a certain event occurs score = score+ 100 (or whatever) points .

  • evertevert Member Posts: 266

    Thanks guys! i indeed used a change attribute!
    fixed it now!

    thanks again

  • mhedgesmhedges Raised on VCS Member Posts: 634

    @evert , you're welcome. Keep in mind, though, a change attribute will update only once (unless you use a timer to update every fraction of a second or so), while a constrain attribute will update constantly (although at the expense of performance, so using too many of these is not recommended).

  • gingagaminggingagaming FREELANCE GS DEV Member Posts: 1,685

    @mhedges said:
    evert , you're welcome. Keep in mind, though, a change attribute will update only once (unless you use a timer to update every fraction of a second or so), while a constrain attribute will update constantly (although at the expense of performance, so using too many of these is not recommended).

    I think what he was saying was he "was" using a change attribute (like I suggested he might be doing), that was the issue.

Sign In or Register to comment.