Change Attributes after Time

Bolt2Bolt2 Member Posts: 41
edited April 2012 in Working with GS (Mac)
Greetings GS forum!

How can I make it so that:

-On Touch
-Attribute Spawn Rate Decreases
-Attribute Add Score Increases
-After 5 Seconds
-Attribute Spawn Rate changes back to before Touch
-Attribute Add Score changes back to before Touch

I can't seem to get the attributes to return to their normal stages.

On that note can I set a timer to 'Every Attribute.Spawnrate' as opposed to 'Every 5 Seconds'?

Thanks

-Blackmill

Best Answer

  • gyroscopegyroscope I am here.Posts: 6,598
    Accepted Answer
    OK, understood, so if you want it on for 5 seconds, that means the user can touch it repeatedly within that time, each time getting 2 points? If so, my suggestion above will work but making the touch rule When touch is released. Hope that solves it for you.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Answers

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You can set the timer to be based off an Attribute but I think GS has changed to where the timer will only use the first value when the timer starts. It wont update to the new value.
  • Bolt2Bolt2 Member Posts: 41
    Ah, that would be my issue then... Hmm...

    Any fixes?

    -Blackmill
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Ok Why Reject the Answer? I know it seems rather juvenile but it is just really annoying. Why bother offering you an answer when your just going to say piss on that? even though you even admit its completely relevant to your problem.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598


    Hi @Blackmill

    A way is needed to interrupt the Timer and reset it. So basically you have to make sure that Run to Completion is not checked in the Timer, then use a boolean "switch" (I'm not sure how you're triggering the change of the SpawnRate attribute, so the following assumes it's on Touch):

    Rule:
    When game.interrupt is false
    Timer: Every game.spawnrate
    Spawn Actor
    x and y pos. random(?,?)

    Rule:
    When Touch is pressed
    Change Attribute game.interrupt to true
    Change Attribute game.SpawnRate to Random(1,5)
    Change Attribute game.interrupt to false

    That should work, I think; hope it helps out.

    ----------------------------------------------
    http://davidgriffinapps.co.uk/

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • Bolt2Bolt2 Member Posts: 41
    edited April 2012
    @Tenrdrmer

    I was unaware that it would be an issue. You suggested a reason as to what my issue was but gave no relevant solution. Therefore it was not the answer I was requiring so I rejected your post.

    Usually, I find that if you tag your thread as Answered, when it truly isn't, there is no more debate on the matter and I feel that this matter is unfinished.

    Sorry for the inconvenience :S I'm new to this...

    Blackmill
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited April 2012

    I think it's probably best to avoid the Reject, Blackmill ;-) @tenrdrmer was answering part of one of your questions and so was just trying to be helpful as you know; rejecting can only cause upset.... don't know why it's there really... unless an answer is spam-like or something, only then should it be used, I reckon....

    Anyhow, I hope i've answered part of one of your questions in my post above.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • Bolt2Bolt2 Member Posts: 41
    Thanks for the reply @Gyroscope. I feel bad about that reject button now :(

    I'll give it a whirl.

    -Blackmill
  • Bolt2Bolt2 Member Posts: 41
    @Gyroscope

    So, on Touch it changes my Boolean Attribute to True. Attribute Game.SpawnRate increases as does the Attribute Game.IncreaseScore.

    But I can't seem to get it to turn to false after 5 seconds.

    Your thoughts?

    -Blackmill
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited April 2012
    Hi @Blackmill, did you make sure that Run to Completion in the Timer is unchecked?

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • Bolt2Bolt2 Member Posts: 41
    Yes. I need: Boolean Switch to be on for 5 Seconds after the actor has been touched.

    -For 5 Seconds
    -Set Boolean Switch to True

    I then state that when:

    -When Switch is True
    -When Game.SpawnRate is greater than or equal to 0.5
    -Game.SpawnRate changes to Game.SpawnRate - 0.1
    -Game.AddScore changes to 2

    That's it... but it won't do it. The attributes never change back.

    The timer is unchecked.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited April 2012


    I'm a little unsure exactly how your Rules are working in practice without "seeing them in action" but a couple of things that might be relevant and help out:

    Your Timer, it'd be better to put:
    Change attribute boolean switch to true
    Timer: after 5 seconds
    Change attribute boolean switch to false

    But even then, I'm not sure why you need a timer at all: if...

    -Game.SpawnRate changes to Game.SpawnRate - 0.1
    -Game.AddScore changes to 2

    ...are both single, one-off events, why use a timer at all? (Confused of Kent ;-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • Bolt2Bolt2 Member Posts: 41
    @Gyroscope

    Basically, it's a game where blocks fall from the top of the iPhone. You click on a particular type of block which is indicated.

    However, during the game a random gold block falls down. On touch, it will increase all the spawn rates, increasing difficulty, but also rewarding the player with 2 points instead of 1. It isn't meant to stay on forever, only 5 seconds.

    That's why there needs to be a timer.

    -Blackmill
Sign In or Register to comment.