Forum rules - please read before posting.

How to start a custom Action list from c# code?

edited May 2015 in Technical Q&A
I need to fire an action list from inside the code of PlayerInteraction.cs. What is the right syntax? And: Are there special things to think about? I need this for a function that is not implemented in AC at this moment (playing sounds while cycling the interaction items). Thanks for help!

Comments

  • If it's scene based (i.e. Cutscene / Interaction):

    myCutscene.Interact ();

    If it's an ActionList asset file:

    AC.AdvGame.RunActionListAsset (myActionListAsset);
  • edited May 2015
    Thank you, thats it! For all other people having problems to run the ActionListAsset file - like this it worked for me:

    1) Create your custom ActionList file in any folder called "Resources" by right mouse click > create > Adventure Creator > Action List. By the way, this folder could be in any other sub-folder.

    2) To get this running, it seems not to be important to set the correct directory for "Custom action scripts" in the Adventure Creator Game Editor > Menue "Actions" to this folder.

    3) You have to load the ActionListAsset file, before you can use it with the code that Chris showed above. Try something like this:

    ActionListAsset myActionListAsset = (ActionListAsset) Resources.Load ("myActionListAssetFilename") as ActionListAsset;
    AC.AdvGame.RunActionListAsset(myActionListAsset);


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.