Switching Player character mid-game

Adventure Creator supports having multiple Player characters that you can swap control over mid-game, allowing you to create a game such as Day Of The Tentacle.

Begin by defining your characters, which you can do from the Settings Manager. Underneath Character settings set Player switching to Allow.

Then click Add new player as many times as you have Player characters. Each time you do, a new Player field will become available. Drag your Player prefabs into them.

The first of these Players will be marked as the Default. Click the Make default next to any other to mark that as the default Player instead. The Default Player character will be controlled when your game begins. Note that the switching of characters across saved games is handled automatically.

You can switch Player character mid-game by using the Player: Switch Action:

Only one Player can ever be present in a scene at a time, so you will have to choose both how the new Player is loaded in, and what becomes of the old Player.

When a Player is removed from the scene and control given to another, Adventure Creator records their state (inventory, position and so on) automatically. Once such a record of position exists, you can set the Action's New Player position to Restore Previous to restore it.

You may also wish to have an NPC in a scene to become the new Player character, and have the old Player be replaced by another NPC. If these NPCs look identical to the Players they are swapped with, the effect will be seamless.

A Player can be converted to an NPC via the cog menu to the top of his Inspector:

Once an NPC variant of the Player has been created, make him a prefab and assign him as the Player's Associated NPC prefab:

The Action can then be configured to rely on this NPC prefab automatically: including spawning him in if necessary:

NOTE: In order to have the NPC's state saved, attach the Remember NPC and Remember Transform components. Check Retain in prefab in both Inspectors, and Save scene presence? on the latter - following the steps outlined in the Manual's "Saving asset references" chapter.

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!