Forum rules - please read before posting.

Repeatedly execute/check variable in an action list.

How would I have an action list repeatedly execute a check, which variable in a switch is active?

How can I make this action list run at all times?

Thanks.

Comments

  • You can define an ActionList asset that runs when the game begins in the Settings Manager. You could make this run in the background, and loop in on itself when complete.

    However, if you're just trying to detect a change in variable, it's better to rely on the OnVariableChange custom event hook.

    The following script, when placed in the scene, will run an ActionList asset when a global variable with a given ID number is changed:
    http://pasteall.org/1531263/csharp

  • Thanks Chris. I'm going with the first option, since the others seem a bigger sidetrack learning project at this stage.

    So I have created an ActionList asset that runs when the game begins:

    https://imgur.com/2hDObAR

    This tells another action list to run based on variable switch. I am trying to get this other action list to go back to the previous after running, but its getting stuck, as seen below:

    https://imgur.com/qOlPbtw

    What am I doing wrong here?

  • Your ActionList: Run in parallel Actions have no effect, since each of them only have one output. This Action is used to run multiple chains of Actions, within the same ActionList, simultaneously - so it requires more than one output to be effective.

    You say it's "getting stuck", but what exactly is going on? Are you hearing the sound play? If the Variable value is correct, then the second ActionList should run - but only if you are within the scene that it is placed in.

    The second ActionList will run instantly, since you do not have Wait until finish? checked in your Sound: Play Action. I don't know of your exact intent, but the logic flow should cause that to be run every frame, as opposed to only once the sound has finished playing.

    Since the ActionList that actually has an effect on anything is scene-based, there's also no need to perform this from your ActionList on start game asset file. Assigning it as your scene's OnStart cutscene/asset file should be enough, since it only has an effect when in one particular scene.

  • Thanks for this information Chris!

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.