Fools Rush In - Part Seventeen

The other kind of conversation we want to be able to implement is 'player-instigated' conversation. If the character is set up correctly when the player puts her reticle over an NPC character it becomes bracketed, indicating the NPC can be interacted with. We want the player to be able to choose to talk to our characters as and when she feels like it.

To do this we have look at conversation nodes again. It's actually a pretty simple thing to turn a ode into a multiple choice node, we simply have to satisfy two conditions. Firstly we need to add more than one NextNode statement and define two or more alternative destinations. Secondly we have to define the Player as the speaker for each of those alternate destinations.

Let's take Lucy as an example. Let's say we want to specify a mechanism by which we can give her orders. In our story the player will be of Sergeant rank, subordinate to Agnes but senior to all of the others.

Starting with something simple, we'll give the player the power to order Lucy to follow her around and also to stay put.

The first node in the system looks like this:

[orders]
speaker=Player
SpokenMax=0
LongText= 
NextNode=Follow
NextNode=Stay

We're using SpokenMax=0 this time, which means there is no limit to the number of times this node can be repeatedly used. The node has two NextNode statements, their values are the names of the nodes that are available to choose from.

These two optional nodes look like this:

[Follow]
Speaker=Player
ShortText=Follow me.
LongText=Follow me, Lucy. We have to go somewhere.
ExitEvent=LucyFollow

[Stay]
Speaker=Player
ShortText=Stay here.
LongText=Hold this position, Lucy. Wait for my order.
ExitEvent=LucyStay

Let's try it in-game.

When we highlight Lucy with the reticle and press the 'Use' key we're presented with the two options we wrote in the conversation file. The text for the options is the value of the ShortText line. In-game the options are numbered and the player chooses what to say by pressing the corresponding number on the keyboard.

Let's press 1, the option for 'Follow me'.

On pressing the choice key the LongText string is displayed. In the node [Follow] we also added an ExitEvent line, generating the event name LucyFollow immediately after the LongText is displayed.

At the moment we're not doing anything with that event, but the important thing is that we now have a method for talking to the system as a direct result of the players conversation options, creating a new method for interactivity.

Additionally, we can handle that event in Lucy's current script file, which gives us a method of varying the responses to that event depending on where we are along the timeline. For example, if we write a handler for the LucyFollow event in Lucy's Intro script file then we might just have her nod her head and follow along. On the other hand, we can write another LucyFollow event handler in Lucy's script that runs during the artillery strike. In that script through a dialoginitiate command she can tell you to get lost when you order her to follow you (on account of all the big explosions going on outside). Although it is by no means the kind of user friendly graphical interface of say Deus Ex's Conedit, what we have here is a very flexible and powerful system of tying in scripted speech and events with input from the player.

Let's write a handler for our example.

ontrigger LucyFollow gotolabel Follow

sleep

:Follow
gotoactorplayer
sleep 5
gotolabel Follow

So when Lucy gets the LucyFollow event from the conversation option, her script jumps to the Follow label and sends the bot to the Players position. On attaining the players position, it sleeps for five seconds before again locating the player and moving to her position.

Game test:

Come hither, my dear.

Here we are on the ramp.

She might be slow, but she's persistent.

Here we are on holiday in the Carribean.

Right, so that works. Setting up behaviours for other conversation options are done in a similar fashion, generate an event, set up a handler.

That pretty much completes the toolkit we need to write the remainder of the script and NPC behaviours. Glancing over the plan there are a couple of things that are outstanding.

Changing the Player Character's model turned out to ridiculously easy. The players model is determined by an entry in the game's main .ini file and it was simply a question of editing that line to reference another class, a custom variation of one of the Angel's models. We'll have to keep an eye on this though. Eventually we'll want to look at making it easy for someone to install our modification on their system, preferably within ruining the installation of the original game.

It's time to turn that corner I was talking about in the previous Fools Rush In article. Our skeletal mod is at an advanced enough stage so that we can concentrate almost exclusively on scriptwriting.

Creating Emotion in Games describes 32 Emotioneering™ techniques. Freeman hints that he uses many more than those outlined in the book but cites space considerations for this limited subset. I'm going to try and cover all 32 techniques but some in more detail than others.

Here's a list:

Our new plan took some thinking about, I initially thought to work through each 'scene', detailing each as I progressed and maybe that's how I will work behind the scope of these articles. There are two projects going on here however, firstly there's the mod but also the criticism of Emotioneering™ itself, so I've decided to write these articles in terms of an examination of each technique. We'll start doing that next time.

Comments: on the _blackbored

Next: Part Eighteen