Creating a "Back" button during close-ups

Some adventure games have moments when the Player is given a close-up view of an object to scrutinise, such as a paper-covered desk or a map. 3D games usually do this by cutting the camera in the same scene, while 2D games usually switch to a specially-made scene. Both techniques are possible in Adventure Creator by using Menus and MenuActionLists.

Let's assume our game is in 3D, and that our close-up involves cutting the camera. The principle for scene-switching is very similar.

Our ActionList (whether it be a Cutscene or Interaction) will probably look something like this:

The Camera: Switch Action cuts the camera to one that focuses on our object to examine. The Player: Constrain Action locks Player movement in all four directions, so that gameplay is reduced to interacting with Hotspots.

It'll be in this ActionList that we'll turn on our "Back" button. But first, we need to create the Menu for it. Go to the Menu Manager. Assuming you are using a new Menu Manager asset, create a new menu and give the name Back. If you are relying on the demo game's Menu Manager, be sure to duplicate the asset and use that instead - otherwise it will be overwritten when you update Adventure Creator.

You should now see a small box inside your Game window. If you don't, choose one of the Organise room objects buttons within the Scene Manager to create a GameEngine prefab in your scene.

We'll leave most of the Menu's properties as they are: we want manual control over when it appears, and we don't want it to pause the game when it's enabled. Just change the Position to Manual, and use the sliders beneath it to position it towards the lower-right corner of the screen.

Next we'll make the button itself. Choose Button from the list of Element types at the bottom of the Manager, and click Add new. Name the button BackButton.

Rather than using a label for our button, let's give it a texture instead. Remove the text in the Button text box, and set it's Background texture to arrow-down.png, which is available in Assets -> AdventureCreator -> Graphics -> Textures.

If your arrow is too large, you can reduce it by changing the button's Size field to Manual, and reducing the slider values. Your button should look something like this:

We should give some visual feedback when the player's mouse hovers over it, so give it a Highlight texture as well. The green.png texture works well, and it's found in the same folder as the arrow.

Now that we've made our Button, lets go back to our ActionList that creates the close-up, and tell the Menu to turn on. After the Player: Constrain, add a new Action called Menu: Change state. Leave the Change type as Turn On Menu, and enter the name of our new Menu, Back, into the Menu to turn on box.

The Button will now appear during our close-up, and now we'll need to end the close-up when we click on it. Back in the BackButton's properties, change the Click type to Run Action List.

We need to give it an ActionList to run when clicked, but since Menus work independently from scenes, we can't supply a scene-based ActionList like a Cutscene. Instead, we'll create an ActionList that lives in an asset file.

Create a new folder in your game's folder, and name it MenuActionLists. Inside this folder, create an ActionList asset by choosing Create -> Adventure Creator -> ActionList in the Project window.

Name this new asset Exit Close-up.

In this ActionList, we'll want to return to normal gameplay: we'll resume control over the Player prefab, disable the Back menu, and cut the camera back to the regular one.

In the Inspector for this file, create the Player: Constrain Action and enable all four movement locks.

Then make a Menu: Change state Action, set the Change type to Turn Off Menu, and the Menu to turn off as Back.

Lastly, make the Camera: Switch Action..

..and drag the GameCamera into the New camera field.

Notice how a Recorded ConstantID label appears beneath the field. When ActionList assets affect scene-based GameObjects, they rely on Constant ID numbers to identify them. Such a number is generated by adding the Constant ID component to the GameObject. If an object does not have one when added to an asset-based Action's field, AC will generate one automatically.

However, this will only allow for the cutting back of only one camera. To choose which camera we cut back to, we can make use of Variables. A more complex tutorial on creating "close-up buttons" is covered in the 3D tutorial, here.

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!