Forum rules - please read before posting.

Action list to continue running across scenes in the background

Basicaly I have this problem:
I want an item to be putted in the fridge and to be remembered that is in the fridge across scenes.

At the moment when the item is in the fridge, it runs an external action list with an Engine Wait Action and a variable to change its state.If the player changes scenes the item will never freeze in the fridge.

Also the same when the item will freeze and the player picks it up (the frozen item) runs a background action list with an Engine Wait Action and a variable to change its state back to unfrozen again.When the player changes scene the item it will remain forever frozen in the player's inventory.

I tried to put the same Action Lists to all the scenes with the same Constant ID 

ItemInTheFridge - Action list
ItemOutOfTheFridge - Action list

...but it doesn't work.
I even tried to put a variable to check if the item is frozen/unfrozen in each scene to resume the Action lists and also nothing there.

What am I doing wrong?
Is is possible to have a background action list to run across scenes without stopping?

Thank you

Comments

  • ActionLists cannot survive scene changes, no.  If I understand your meaning correctly, you're looking to have a "background timer" that changes a variable's value after a set time, regardless of the open scene - correct?

    ActionLists cannot be paused mid-Action, so having a timer via a single Engine: Wait Action wouldn't be appropriate.  Instead, you should store the "time left" as an Integer variable, and reduce it's value by 1 every 1 second.  Each time, check if it's reached zero yet - and run whatever change you're after.  If you precede all this with an initial value check of >0, you can determine if it needs to run at all.

    Something like this:
    image

    If you then run this at the start of each scene, it should only run if the timer is non-zero.
  • Thank you Chris. How exactly can I implement this? When I am changing scene the counter stops. Where exactly do I need to put it to make it work?
  • Place it in an ActionList asset, and re-run it when entering a new scene.  It doesn't need to be paused/resumed, it'll just carry on ticking down until the timer reaches zero.

    Of course, you need to also create the "Timer" integer variable.  As it was more of an example, I'd suggest playing with it in a separate scene to learn the principle of how it works before trying to implement it properly in the game.
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.