Forum rules - please read before posting.

Timers/Countdowns/Parallel Actions


I am trying to do a bit of an unorthodox thing (maybe?) and I'm trying to see if I can achieve it with pure AC functionality (i.e without writing any custom scripts).

I've got a scene where a couple of scripted events need to happen on a timer. Roughly the flow in the scene is like this:

- Play scene intro cutscene
- Start a 60 second countdown
- Let the player play/interact with the scene during that time
- When the countdown ends interrupt/override normal play and run some actionlist/cutscene

The way I thought about doing this is to end my OnStart cutscene with an Engine: Run in Parallel Action which triggers an interaction called "Countdown"

The Countdown action has a Wait action which after 60 seconds* sets a scene variable called "SceneFlow" to a new value (say Phase2)

Then in my OnVarChanged interaction I check for when SceneFlow has been changed to Phase2 and when that happens I run the corresponding interaction

This "almost" works apart from the fact that my Countdown interaction does not actually run "in parallel" i.e. it actually blocks gameplay. So the sequence of events happens correctly however when the countdown is running the player can't actually interact with the scene.

How can I fix this? Am I going about it the right way? Is there a better way to do this sort of thing?


*sub question: is there a way to increase the Wait action value to beyond 10? right now to do a 60 second wait I have to sequence 6 Wait actions back to back.


  • edited September 2015
    Is your Countdown interaction set to run in background?

    And by increase more than 10, you mean the run in parrallel? If so yes, find the ActionParallel scrip and modify line 66 to:

    numSockets = EditorGUILayout.IntSlider ("# of outputs:", numSockets, 1, X)

    X being the number you want to use.

    However, i think that set to high, then it may slow down scene load - Chris can tell you canfirm if this is the case.
  • Ah, awesome... yup I was certain I had seen that option somewhere but couldn't remember where it was (it's on the actual interaction object)

    And yeah setting it to "Run in Background" seems to have the desired effect (I don't even need to start the interaction "in parallel" using a Run in Parallel action)

    I do have a weird issue where the dialogue will play super quickly if there's another dialogue happening already, but I should be able to find a way to address that

    About the 60 second wait, sorry, I wasn't very clear with that question.

    So, I don't want to start 60 interactions in parallel (that'd be crazy as you say!) I just want to use an Engine: Pause Game action to make my countdown last 60 seconds. Unless I am missing something the max value you can set the Engine Pause Game action to is 10 seconds at the moment. Possibly I can tweak that by changing the action script directly but I like to check here before I do that sort of thing that I am not actually just trying to do the wrong thing (which usually is the case :) )
  • The pause Action's limit was removed in the more recent releases.
  • Ah right, cool, good to hear. Yeah I am still on 1.42c due to fear of upgrading as I am getting close to release.

    I'll probably have to bite the bullet and do it though, alongside a Unity 5 upgrade, as my target platform is browser and the Unity 4 webplayer is not supported any more by the major browsers so I am hoping I can switch to WebGL... sounds like that's a can of worms in itself but unfortunately it's one I'll have to deal with sooner or later...
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.