Forum rules - please read before posting.

Possibility to copy triggers with action-list into other scene?

i would like to not always redo my action lists on triggers, for example cam change, when i do a new scene. is there a way to copy them to another scene or make sort of a template-prefab?

cheers

Comments

  • You can create project-wide, as opposed to in-scene, action lists. Right-click anywhere in your project view (where you want to store the file), Create->Adventure Creator->Action List. Then in your trigger, create an action Action List: Run, and set the source to Asset File. Then drag in that action list, or select it from a list.
  • But then again with this it´s impossible to use it for example as camchange as soon as the cameras are called differently since i have to update it in the global action list, no?

    Also the remember-trigger-script+prefs is not stored there.

    I imagine for this to work as i want it it has to be a prefab, where i break the prefab-connection as soon as i loaded it into the scene and then change its values, no? Would this make problems with AC? Gonna try now. 

    As example i refer to the video-tutorial.
  • I suggest that you use parameters, in that case. You can call the global action list from a local one,  specifying the exact camera you want to change to/from in the local action list.

    For anything that can't be remembered this way, you could use global variables.
  • Actions placed in asset files can still reference scene objects such as Cameras.  You'll notice that when you place a scene Camera in an asset-Action field, the Console will tell you that the Camera has a new "Constant ID" number assigned - this is AC's way of tracking scene objects from an asset file.  So long as you save the scene afterwards, it should be fine.

    See this tutorial for more on this topic.
  • edited August 2015
    What if we want to cleverly avoid needing an in-scene interaction per hotspot by having them instead send a message to the script on the affected object, which then calls the global action list... but with public variables exposed by the script passed as parameters to the action list? One can use AC.AdvGame.RunActionListAsset (ActionListAsset actionListAsset, parameterId, parameterValue) to run an actionListAsset with a single parameter. To pass more than one, I'm wondering whether one can (in C#) take the ActionListAsset and write something like

    actionListAsset.parameters[1].SetValue(gameObjectThatHasAConstantId)

    before running it to pass a second one. Would that harmfully affect the global state of the ActionListAsset, or just the action list instance I want to run? And if the former, should one do the above on an ActionList instance? If so, how?

    Extending AdvGame's RunActionListAsset() function to take an array of parameter values would be really cool, btw.

  • edited August 2015
    From testing, it looks like we can do that! Except you need to pass the constantID, not the game object itself (even though there is a SetValue(GameObject obj) function for ActionParameters - didn't work for me when I used it like above.)
  • Indeed - the GameObject parameter is for when you are working purely with scene-based objects.  Pass a ConstantID number whenever an asset file is involved, and you should be OK.
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.