Is there a scene initialize attribute and player input disable?

ccbx4321ccbx4321 Member Posts: 43
edited November -1 in Working with GS (Mac)
There is a great community here. You've all been way helpful in the past and I hope you guys can help me out with this as well.

I essentially want a scene to initialize and run a rule to completion. I'd like a "intro/story line animation" to play essentially. I believe I can get the animations and the like working how I'd like. But when I create a "rule" I'd like to run for the task the only triggers I can find are based off of "attributes" and it seems "player input". At this point in the game, I don't want the player to have input anything yet, just for this rule to run it's course only once to play the initial scene animation, then have the game begin. I may use it on other scenes as well. Is there a way to do this? Like:

If scene1 initializes:
Then run rule1 once to completion

I was trying to look through the attributes but didn't think anything in there fit what I was looking for. Is there some clever workaround I'll need to pull this off?

While we're at it, I had another question regarding disabling player input. Is there a way to toggle player input on/off? I'd like these animation sequences to be undisturbed (i.e., it would look pretty lame if the animation sequence is playing and the player starts setting off elements from the ACTUAL game during the sequence. I'd like to essentially have something like this:

Game initializes
Player input disabled
Animation sequence plays
Input re-enabled
Game play begins

Any help would be appreciated! Thanks!

-Caleb

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I would use a timer and set it to "FOR" instead of every or after. Then check "run to completion." You would just need to know how long your animation sequence is. Set the time to that amount and then drop an animation behavior in and load you images that make up your animation sequence. If you have multiple animation sequences you can drop a timer within a timer. The "outer" timer would be set to AFTER to delay the start of the animation and the "inner" timer would be set to "FOR" just like I mentioned above.

    Hope this helps!
  • ccbx4321ccbx4321 Member Posts: 43
    Thanks scitunes, I think that's a good way of going about and doing it. If there's any other techniques anyone can think of feel free to post. Any suggestions are MORE than welcome.

    Also does anyone know if it's possible to disable/re-enable player input (like whether they're able to click or "touch" on an ipod)?
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey,

    The best way, I think, is to have a global game attribute (boolean) called "busy", or something like that.

    Then, in all of your rules for player input, add a condition that says do this rule only is game.busy is FALSE.

    Whenever you you need to disable player input, simply set game.busy to TRUE.

    I use this all the time for little popups and the like, during the game.

    Hope this helps!
  • quantumsheepquantumsheep Member Posts: 8,188
    Yep - that's a good way to do it.

    For Scargo! (submitted to the app store yesterday, folks!) I have a countdown that needs to complete before the race begins. Once the countdown is complete I set the boolean variable I created, 'countdowncomplete' to true. It starts off false.

    For player input, therefore, I create the rule 'if countdowncomplete is true' then add the player input below that.

    That ensures that while the countdown is, er, counting down, that I cannot input anything, but when it's done, player input is enabled.

    Hope that helps,

    QS :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • ccbx4321ccbx4321 Member Posts: 43
    Hey that's a great idea guys, thanks! I tinkered around a bit with it with attributes and think I've got it working how I'd like.

    In regards to scitunes post though. I've been toying with animations and timers to see what I can get running. I'm running into into trouble running an animation with the "EVERY" say...5 seconds setting. It plays the first frame of the animation and then resets the actor to original, (unless I unselect "restore actors image when done", then the first frame just hangs there on screen). I suppose I could just loop the animation, but I wanted a pause in between. I ended up just telling the animation to play the last frame over and over again (like 80 times) and then looping to get the pause I wanted, but I just felt using the every 5 seconds setting would be better if I could get it working. Any ideas?

    Thanks again for the attributes tip guys. It's working so far. Hope I don't hit any snags with it down the road! :D
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey,

    You have an actor, and you want its animation to play every 5 seconds?

    OK, it's a little convoluted, but here is how that is done:

    In the actor, you need to add an attribute ( boolean) called, let's say, "pleaseAnimate" and check its checkbox.

    Then, over in the behaviors panel, you're going to need to add a Timer and a Rule.

    First, the Timer:

    Set it to EVERY 5 seconds, and check Run to Completion.
    Within that Timer add a Change Attribute and set it to: self.pleaseAnimate to TRUE

    Next, the Rule:

    When self.pleaseAnimate is TRUE

    Then add an Animate Behavior. (This is where your animation frames go)
    For convenience, set the Speed of the animation to match the # of images, that way the animation
    will take 1 second. Uncheck Loop. Uncheck Restore actor image when done.

    After the Animate Behavior, within the same Rule, add a Timer:

    set it to:

    AFTER 1(or however long your animation is) seconds, check Run to Completion
    add a Change Attribute to the Timer and set it to: self.pleaseAnimate to FALSE

    That's it!
    That is how I would do it.

    Hope this helps!

    Joe
Sign In or Register to comment.