How Do I Create A Timer Lock On An Actor?

FallingBoxStudiosFallingBoxStudios Freelance Graphic DesignerMember Posts: 822
edited September 2013 in Working with GS (Mac)
What I mean by a "Timer Lock" is: Your character walks automatically and you have to hold on the screen to stop walking, (Kind of like the Chillingo game "This Could Hurt") and if you push on the screen you can stay still for as long as you want but to a minimum of 3 seconds, so if you press the screen once you can't keep walking again until its been 3 seconds, how do I do this? - Hunter Afia

Comments

  • KevinCrossKevinCross London, UKMember Posts: 1,894
    I've already sent you a file for this! What I've sent you and the dozens of PMs back and forth gives you what you need.
  • FallingBoxStudiosFallingBoxStudios Freelance Graphic Designer Member Posts: 822
    @KevinCross sorry man your method seemed a little difficult, but I will send you the pictures now.
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    Really?!

    Fair enough. I use a similar method for double clicks and there's very little to it, as you know from seeing the template I sent. Aside from building the game for you that's the best I can offer.
  • FallingBoxStudiosFallingBoxStudios Freelance Graphic Designer Member Posts: 822
    @KevinCross Are you sure theres not another way of doing it?
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    There's always dozens of ways to doing something in GameSalad, but the one I sent you involved very little coding. One timer, a change attribute and a rule is all it takes. If someone can build an even simpler version for you then cool.
  • DepressedPandaDepressedPanda Member Posts: 215
    With all due respect he gave you a perfectly working solution, probably took a good amount of time to help you, and you just tell him it's too complicated?

    Perhaps it's time you breakdown that code and learn it yourself so it's not too complicated? You can't reasonably request that people dumb down their code for you....
  • FallingBoxStudiosFallingBoxStudios Freelance Graphic Designer Member Posts: 822
    @DepressedPanda you don't know but I'm still trying to work with him, I just sent him an email and I'm trying to do something different compare to what he sent me so I still need help placing what he sent me into my current project...
  • DepressedPandaDepressedPanda Member Posts: 215
    It's never a problem to get help and request it, however it seems your project is beyond the basic newbie GS type of stuff. Grab the book or grab a tutorial. If you can't code something by yourself, that's cool, ask. But you should have the knowledge to edit his code into what you want instead of him doing all the work. Just my two cents. Bowing out of this thread as I've said my peace. Good luck with your project my friend and see ya around the boards!
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    @depressedpanda +1 dude. This is why I don't do the here's a sample template stuff. People need to learn.
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    edited September 2013
    What was originally sent was a button (file below) that you couldn't press again until 3 seconds passed, this could have been adapted easily enough by putting your movement rules in the right place to stop moving when the attribute is flagged as locked

    You've already mentioned in a PM that you've added it in your game and it works, but when you release the touch it starts moving again, and I think as previously mentioned to solve this all you need to do is move your current stop movement behavours from your touch rule and put it in its own rule, which stops moving if the locked attribute is true.

    After 3 seconds the locked attribute is automatically set back to false and your actor should continue moving.

    http://www.kevincross.co.uk/wp-content/uploads/2013/09/Locked-Actor.zip
  • FallingBoxStudiosFallingBoxStudios Freelance Graphic Designer Member Posts: 822
    What you did not see in the video was there was no "stop acceleration" rule, there was only an "if mouse is up - accelerate to the right of the screen" so what do I have to move?
  • FallingBoxStudiosFallingBoxStudios Freelance Graphic Designer Member Posts: 822
    @KevinCross What you did not see in the video was there was no "stop acceleration" rule, there was only an "if mouse is up - accelerate to the right of the screen" so what do I have to move?
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    No video or link was sent in your email, and I'm on my phone which is why I said screenshots would be preferred.

    Now that you've got the 3 second timer lock working your real question for this post is "how do you stop acceleration in a rule?". For that I don't know, maybe constraining it in position?

    Your rule would look like this:

    If locked attribute is true
    Stop movement

    I can't remember what I called the attribute and you would need to find the behavior that stops acceleration, but only when the attribute is true.

    This rule would not be nested in a touched or released rule.
  • FallingBoxStudiosFallingBoxStudios Freelance Graphic Designer Member Posts: 822
    @KevinCross Hey, it does not seem to be working, but no problem I will find out one way or another, I would just like to thank you for taking your time to help me with this problem, It must have been frustrating and at the end I just wasted your time, so thanks anyway :).
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    Ok that's cool. Sorry it didn't help in the end but good luck finding the solution you're after. I'm looking forward to seeing the final game.
Sign In or Register to comment.