Forum rules - please read before posting.

Killing all other action lists

Hi,

I have an action list, that when triggered, needs to stop everything else in the game from running (no matter if it's in the middle) and just run itself. How can I achieve this?

Thanks!

Comments

  • The ActionList: Kill Action allows you to end only specific ActionLists.  To kill all, you must do this through script.

    Place this inside a new C# script class:

    public ActionList myActionList;

    void KillAndRun ()
    {
    }

    (Replacing "ActionList" with "ActionListAsset" if you want to run an ActionListAsset instead).

    Then place the script on an object in your scene, and use the Object: Call event Action when you want to run it, calling the script and running the KillAndFun function.
  • I need a little bit more guidance on how exactly to implement this.
    I have created an empty game object in the scene, add a script component to it, and copied the code you wrote inside (like seen in the pic).
    However the code "checker" highlights several terms as one which do not exist in current context.
    Am I in the right direction?

    Thanks

    image
  • You're referring to the Console?  What does it say, exactly?

    You need to place it inside the class brackets, not replace the entire file.  If you replaced all contents, best to delete it and try again - this time pasting the code beneath the first "{".
  • This is what the console says (pic).
    It seems like I can't just put this code in a new script component or something... It doesn't recognize what 'Interact' means, nor what 'ActionListAsset' means.
    Are you sure you meant for me to just:
    1) create an empty game object in the scene I would like to kill all action lists
    2) attach a new C# script component to said game object
    3) paste the code you wrote inside the class brackets

    And then try to call an event?
    I can't try to call the event because the console won't let me continue while the error in the pic is still there...
    image
  • Apologies.  Replace:

    public ActionList myActionList;

    with:

    public AC.ActionList myActionList;

    AC uses the "AC" namespace, meaning you have to either prefix any AC class with "AC.", or write "using AC;" at the top of any script that references it.
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.