Custom Counter Help Needed

Hey guys.
I'm trying to create a system where when the start button is pressed a counter counts from 1-1000 but in the space of 10 seconds. I want to have a rule where when the screen is touched, the counter stops and displays the current number that was displayed when you hit the screen. I have the counter working with numbers 1-1000 but I can't seem to stop it. Any suggestions would be greatly appreciated :)
Thanks, Charlie.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Here's a demo.

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

  • CharlieG97CharlieG97 Member Posts: 52
    Here's a demo.
    Thanks, i'll take a look when im home :)

  • CharlieG97CharlieG97 Member Posts: 52
    Here's a demo.
    Hey that works well except the counter needs to start when the start button is pressed, not straight away. E.g, if i press play then wait 3 seconds before hitting the button the counter starts at 300.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    In the counter display actor, move the Interpolate behavior into the When game.countdown is true rule.

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

  • CharlieG97CharlieG97 Member Posts: 52
    In the counter display actor, move the Interpolate behavior into the When game.countdown is true rule.
    Awesome thanks for the help :)

  • CharlieG97CharlieG97 Member Posts: 52
    In the counter display actor, move the Interpolate behavior into the When game.countdown is true rule.
    just one more thing I'm having trouble with...on the counter under interpolate it says interpolate: self.counterTarget - how did you get the self.counterTarget? It's not in the list anywhere when I click the 'a' dropdown menu. I'm trying to c/p the rule but it says invalid path. Sorry if this is a noboy question but I only just started working with GameSalad.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited November 2013
    That's okay. GameSalad has built-in actor, scene, and game attributes but you can also add your own. "Self" attributes are actor attributes. Open the actor and you will see a small + button at the bottom of the attribute panel. Click the +, choose integer for the attribute type, and then name the attribute anything you like (e.g. counterTarget).

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

  • CharlieG97CharlieG97 Member Posts: 52
    That's okay. GameSalad has built-in actor, scene, and game attributes but you can also add your own. "Self" attributes are actor attributes. Open the actor and you will see a small + button at the bottom of the attribute panel. Click the +, choose integer for the attribute type, and then name the attribute anything you like (e.g. counterTarget).
    I meant where it says invalid path as shown in the image at the link below
    http://imgur.com/oWjzUpg
    How can i make it read self.counterTarget?
  • CharlieG97CharlieG97 Member Posts: 52
    edited November 2013
    Can you constrain something to itself. For example I have a counter and for example when a button is pressed I want to constrain it to its current value and display it, effectively pausing the counter.
    Using the same value (game.counter) for the before and after in the constrain attribute function doesn't seem to work.
  • SocksSocks London, UK.Member Posts: 12,822
    edited November 2013
    No, you can't constrain something to itself, there would be no point doing it even if you could as all you are saying is make value X = value X when it already equals value X !.

    It's like saying make 18 = 18.
  • CharlieG97CharlieG97 Member Posts: 52
    No, you can't constrain something to itself, there would be no point doing it even if you could as all you are saying is make value X = value X when it already equals value X !.

    It's like saying make 18 = 18.
    The problem is I have a counter which interpolates from 0 to 1100 over 11 seconds. When touch is pressed I need the counter to display its current value. Is there any way to 'pause' the interpolation and display the value on touch?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited November 2013
    [merged your two threads since they were about the same topic]

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited November 2013
    I meant where it says invalid path as shown in the image at the link below
    http://imgur.com/oWjzUpg
    How can i make it read self.counterTarget?
    You have to select the attribute from the drop-down menu instead of just typing its name in. I don't use the Windows version of Creator enough to be able to tell you more.

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

Sign In or Register to comment.