Pause actor's movement

DookiDooki Member Posts: 247
edited November -1 in Working with GS (Mac)
Hey all,

I have a free moving actor. Where I click the actor moves. He's a thief who travels from lock to lock and opens them. I want him to pause when collides with a lock before moving on to the next. I have it set up so that when he comes to a lock a progress bar animation plays (7 sec). So, I want him to pause, or not be able to leave, for 7 sec. I've played with putting a 7 sec timer into the mix but it does nothing. Any thoughts?

Thanks!

Comments

  • DookiDooki Member Posts: 247
    ..Oh, I also have a walking animation for this spy. Is there a way to spawn a different image (say crouching) while is in paused mode, then kick back in the walking animation when he's on the move again? Thanks!
  • quantumsheepquantumsheep Member Posts: 8,188
    You need a variable to distinguish between between normal walking and colliding with a lock.

    Let's call it 'lockpause'.

    In a controller actor, put in the rule:
    If actor collides with lock,
    Then for 7 seconds let lockpause = true
    Otherwise lockpause = false

    On your main character, have the rule:

    If lockpause = true
    Play 7 second crouching animation.

    In the 'otherwise' section put all your rules for normal movement and animation.

    That should do it.

    Hope it helps,

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    QS, I'm impressed with your restraint on this one!
  • quantumsheepquantumsheep Member Posts: 8,188
    Heh - it's not really the issue at hand though, mate ;)

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    When I see "pause" in the thread title and your name as the latest response I made an assumption. I should have known you are more complex than that! My bad!
  • quantumsheepquantumsheep Member Posts: 8,188
    I think the term 'fiddly' is more appropriate ;)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

  • DookiDooki Member Posts: 247
    Wow, thanks QS! Gotta put the kids to bed but will this out. Thanks again!
  • DookiDooki Member Posts: 247
    OK, I tried to set this up but got a black screen. Here is what i did:

    Controller-
    Rule
    When actor collides with lock
    -Timer 7 sec
    --Change Attribute: game.lockpause=true
    --Otherwise
    ---Change Attribute: game.lockpause=false

    Main actor-
    Rule
    Attribute: game.lockpause= true
    -Timer 7 sec
    --Animate (add images)
    --Otherwise
    ---Animate (Original walking animation)

    Note: Prior to this I had my animation attribute by itself. I found that if I included it within my movement rule the animation did not play.

    Thanks again!
  • DookiDooki Member Posts: 247
    Can anyone help me on this one? I am not sure if I understood GS's suggestion correctly. As is, I get a black screen when previewing. Thanks!
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Black screen usually means you have a syntax error. Check your parentheses, make sure you got all of you non-numerical stuff from pull down menus (you should never type in attribute names or "random" or "max" etc. Did you have an attribute that you deleted but left a rule in that calls for it?
  • DookiDooki Member Posts: 247
    Hey Thanks!
    Yup, I typed in "true,false." I did not have any attributes that used parentheses. Should I have? Can you tell me if what I set up (above) is indeed what QS recommended? Thanks!
Sign In or Register to comment.