In the first part of this series, we covered setting up the first room of your point-andclick adventure, including the engine, palette I
and walkable areas. We also interacted with objects, by looking at them and adding them to the inventory. The player can now use the wrench inventory item on some machine pieces to assemble a broken robot.
With the robot up and running, it’s time to give it a voice. Conversations are a natural part of any pointand-click game, providing useful hints. NPCs can also sometimes be persuaded to give players useful items.
Crafting characters
In the series so far, we’ve covered two of the main types of things with which your player can interact: items and hotspots. However, AGS also supports a third type: characters.
A character contains elements of both hotspots and objects. They can’t be picked up but they can be interacted with to have conversations. They can also move between rooms and carry their own inventory.
Look to the project tree at the top-right and expand Characters. You’ll see there the name of the main player character. By default, this is cRoger, but if you’ve been following this series, you may have changed his name to one of your own – cNate, for example.
OUR EXPERT
Nate Drake is a tech journalist specialising in cybersecurity and retro games. The first thing he did when discovering Linux in 2004 was play Beneath a Steel Sky. Be vigilant.
OUR EXPERT
Nate Drake is a tech journalist specialising in cybersecurity and retro games. The first thing he did when discovering Linux in 2004 was play Beneath a Steel Sky. Be vigilant.
QUICK TIP
You can also change the StartingRoom value for your player character. As you add more rooms to your game, this can be a good way to test out new rooms quickly. We’ll add another room in the final part of this series.
QUICK TIP
You can also change the StartingRoom value for your player character. As you add more rooms to your game, this can be a good way to test out new rooms quickly. We’ll add another room in the final part of this series.
Double-click on your character name. Under Selected Character Settings, you’ll see a notification saying this is the player’s character. This means when the game starts, you control this character and action begins in the character’s StartingRoom, as defined in the Properties grid at the bottom-right.
This is where we can add our lovable robot as a character, but at this stage, there’s a problem: currently, the fixed robot is an object. This is because in the previous tutorial, all we needed oFixedRobot to do was appear when the player used the wrench on the broken robot parts.
Luckily, this is easy to fix. First, return to Room1 in the project tree via double-clicking. Next, choose Edit This Room’s > Room > Objects > oFixedRobot. Rightclick and choose Delete. Click Yes to confirm.
Next, return to the project tree and right-click Characters. Choose New Character. Go to the properties grid and select RealName. This is the name that the editor will use to refer to your new character, so set this to something simple like Robot.
Next, you need to set the ScriptName. This is the name by which the character will be referred to in the actual game script, so set this to cRobot (or cRobot1 if you want to have more than one robot in your game).