Referencing scene objects with ActionList assets

As the name suggests, ActionList assets are ActionLists that are stored in asset files. They exist independent of any scene, but can still manipulate objects within a scene. This is useful because it means that many designers can work on the scene simultaneously - if they construct ActionLists purely out of asset files, then their work won't conflict.

In this tutorial, we'll create an ActionList asset that momentarily cuts to a camera that looks over the whole scene from above. We'll expand on this concept in later tutorials, but for now, we'll just call the one camera.

Begin by creating a new ActionList asset by choosing Create -> Adventure Creator -> ActionList from the top toolbar.

The new asset will be created within your Project Window, so rename it to something appropriate, like Cut to overhead camera.

Next, we'll create the Actions necessary. Using the Inspector window, create a new Action of the type Camera: Switch, leaving the settings as their default.

Add an Engine: Pause game Action, and set the Wait time to 2 seconds:

Finally, add one more Camera: Switch Action, and check Return to last gameplay?.

We'll need to go back to our first Action and assign our overhead camera. But first, we need to actually create such a camera. Within the Scene Manager, double-click on the GameCamera icon to create a new camera.

Rename it OverheadCam, and position it such that it looks down over the scene.

Then, assign it to the 1st Action's New camera field by dragging it into the field as normal. You'll notice that a ConstantID number is now recorded beneath it. This number is used by the ActionList to remember the camera reference when the scene is closed. Here, the number is 376838:

Be sure to save the scene: the ID number is generated by automatically adding the ConstantID script to the camera object. The scene will need to be saved, to ensure the script remains attached to the camera.

Our ActionList asset is now ready. Provided that this scene is open when it's run, it'll cut to our OverheadCam for two seconds, and then cut back. ActionList assets can be called by using the Engine: Run ActionList Action, or by changing the Source field in scene-based ActionLists to Asset File.

Adventure Creator and this website are copyright Chris Burton, ICEBOX Studios

Go to top
Do NOT follow this link or you will be banned from the site!