Reset After Timer?

netdzynrnetdzynr Member Posts: 296
edited November -1 in Working with GS (Mac)
Hi GameSalad Folks:

Hows does one reset something (like a game attribute) once a timer is finished? The timer offers "for" and "after" -- how do you go back to an initial state once the timer is done? The only way I can think to do this is trigger a second timer when the first is started but this seems kind of inefficient to me. Thanks for any suggestions.

Comments

  • KamazarKamazar Member Posts: 287
    A little more information would be better, but you could set up a rule where after x seconds, a variable is changed back to its original state. What situation are you using this in?
  • netdzynrnetdzynr Member Posts: 296
    Thanks for the response. I have an actor that on collision changes a game attribute named "penalty" to true. A scoreboard actor has a rule that displays the score in red for 2 seconds if the penalty attribute is true. I then want to go back to the normal (black) score after the timer has elapsed, but I can't figure out how to change an attribute or perform any other action *after* the timer has elapsed.
  • KamazarKamazar Member Posts: 287
    Ah, simple enough. Most of the stuff I type is mostly theory until I test it out, but you should get the rough idea. Were you using the "for" function for the timer? If so, this might be redundant and completely useless.

    Penalty = False
    When collision occurs,
    Penalty = True (which turns the score red)
    After 2 seconds
    Penalty = False
  • netdzynrnetdzynr Member Posts: 296
    Thanks Kamazar. Your suggestion helped a lot (though changing the the color of the text seems to cause some artifacts in the digits, but that seems like a GS quirk). Much appreciated.
  • design219design219 Member Posts: 2,273
    Yeah, text in GameSalad is pretty clunky if you use it large. I've tried to keep text as small as possible for that reason.
  • rebumprebump Member Posts: 1,058
    Text artifacting: I usually use an actor with text for static text. For dynamically changing text (i.e. timers/scores), you can either roll your own font (which does affect performance) or you can use display text and get the "artifacting" (basically, the numbers look faded).

    JGary discovered you can use multiple display texts in the actor right next to each other and it seems to enbolded the numbers so they are more normal looking. Has worked for me but I imagine under *extreme*(!!!) loads on the older devices, it could be problematic if the value being displayed is updated elsewhere.
  • netdzynrnetdzynr Member Posts: 296
    @rebump: by "roll your own font" I assume you mean using images? That isn't out of the question in my case because I'm only using digits for the score, and doing so would probably look more integrated with the game anyway. Thanks for the suggestion.

    It does seem that GS needs to work on text display though.
Sign In or Register to comment.