BioWare Atari
BioWare Info BioWare Games Support Forums Visit the BioWare Store
Neverwinter Nights Home
Neverwinter Nights Home

Using Dialogue With Placeables and Triggers

Intended Audience: For Builders
By David Gaider

[Printer Friendly / Syntax Highlight]

There are lots of effects that a savvy DM can simulate just by using a bit of dialogue in conjunction with a placeable or trigger. You can have ambient descriptions of an area or object appear, start a 'dialogue' with a strange object that allows the player options of interacting with it, have someone on the other side of a door speak through it, inform players of events that occur... there are lots of possibilities.

The first thing you should know is what your options are. The following are commands that can be used to initiate dialogue or display text:

Action Speak String and SpeakString
The only difference between these two actions is that ActionSpeakString puts the command into the action queue (meaning it will not be performed until previous actions in the queue, such as ActionWait or ActionMoveToObject, have been completed) and SpeakString is performed immediately.
What it does: causes a line of text to be displayed over the performer of the command. This is displayed to the player as normal dialogue, the text appearing beside the name of the object and its portrait (if applicable).
Advantages: A "volume" can be applied to the text by placing the appropriate TALKVOLUME_* constant in the command. TALKVOLUME_TALK is the default and is heard by all at normal range. TALKVOLUME_SHOUT is heard by all in the module. TALKVOLUME_WHISPER is heard by all at close range. TALKVOLUME_SILENT_TALK and TALKVOLUME_SILENT_SHOUT are variants on the normal talk and shout... but they will only be displayed to and heard by non-players.
Part of having a volume is that the text is 'heard' by objects in the game. Creatures within hearing range will turn their heads to notice, and if you are doing any text-recognition scripting via SetListenPattern and GetListenPatternNumber (such as combat 'shouts'), SpeakString can be used for that purpose.

ActionStartConversation
What it does: the commands the performing object to initiate dialogue with the target. It will set off the target's OnDialogue event (if they have one, which PC's do not). If no dialogue file resref is specified, the one attached to the creature or object will be used (the one you specified in the toolset). The token in the conversation will always be the target object.
Advantages: You can start a full conversation this way, with response choices and multiple starting conditions and scripts running off of it. You can also specify in the main command whether or not this is a private conversation... if it is, then only the target will see the text displayed on-screen (great for interacting with objects, since other players wouldn't 'hear' this conversation).

BeginConversation
What it does: this command is normally only used in the OnDialogue event of creatures. This is the command that tells them to start dialogue with the player that just clicked on them. Using it on an object does not set off their OnDialogue event. If the target of the action is not specified, the object that initiated their OnDialogue event will be used.
Advantages: Can be used for NPC to NPC conversations... otherwise ActionStartConversation should always be used outside of the OnDialogue event.

FloatingTextStringOnCreature
What it does: when you perform many actions in the game, you will notice that the text that appears over the player's head floats upward and fades away. This command does the same thing. The text also shows in the player's chat display... it does not show as originating from any creature, nor does it show any portrait. The text simply displays in yellow, as most ambient text does.
Advantages: great for ambient text or simulating a written display of an action, since it does not prefix the text with a name or even look like dialogue in the display.
One Thing to Be Aware of: Floating text, by default, is ONLY able to be seen by the creature that it is floating over. If you set the command 'display to faction', then members of the same faction will also see the text displayed. This does mean that floating text is really only useful on PC creatures, since no non-PC creature of object can be set to the PC faction.

SpeakOneLinerConversation
What it does: it acts very much like ActionStartConversation, but its purpose is more specific. It is meant to access the dialogue file, but only for a single line with no responses or links.
Advantages: You can still script the starting conditions for the dialogue file, so you can have a whole selection of single-liners that the speaker can choose from... and you can still use action scripts off of those lines. The speaker does not turn to any target before speaking... and the object identified in the command (if one is) becomes the reference for any tokens used in the dialogue (even if they are not present).

Making A Placeable Object Display Text
For the example I'm going to use here, we're going to make a placeable object signpost display text for the player that clicks on it.

**IMPORTANT!** If you are going to have any placeable object interact with others in this way, make sure the 'Static' box is unchecked! If a placeable object is static, it is intended to be merely part of the background art and unselectable. Most placeable objects are marked static by default!

So select a signpost from the placeable object list and place it down. Then go into its properties and make sure 'Static' is unselected. Since I want the player to be able to click on the signpost, check the 'Useable' box.

Go into its script section and put the following script under the OnUsed event:

NWScript:

Now when you are in the game and click on the signpost, it will display that text next to its portrait (which is, by default, a signpost) and name. Naturally you can always change the portrait to whatever you like, as well as the name, and the display will be different.

Making a Trigger Display Floating Text
In this example, we want it so that when a player crosses into a laid-down trigger, a piece of ambient text appears over their head.

Go into the trigger menu and select 'Generic Trigger'. This will allow you to draw the bounds of the trigger box. If I wanted to display a description of something the player sees in a room, for example, I might put this just inside a door.

Then go to the scripts section of the trigger. Since we want the text to appear when the player enters the trigger, we'll put the script in the OnEnter event. Some things to consider: do we want it to display only for PC's, or every entering creature? Do we want it to display every time a PC enters, or only once? For now, I'll have the text appear on anyone who enters the trigger... but only the first time.

NWScript:

When the player steps into the trigger in-game, the text will appear over their heads and float up, fading. It will also display in their chat display window in yellow.

Note that triggers can't use SpeakString or ActionSpeakString. They simply can't speak, period. It can, however, tell another object to speak... whether that object be an invisible object right on it or elsewhere. If I had a nearby placeable object with the tag "DISPLAY_HERE" (which had its 'Static' box unchecked, remember) and I wanted the trigger to make it display the above text, I would use this script:

NWScript:

Having an Object Display Text When a PC Comes Near
In this example, I'm going to lay down an invisible object (that the players can neither see, hilight nor touch) that is going to display text when a player comes within 10 meters.

First, select the Invisible Object from the placeable object menu and lay it down. Go into its properties and make sure 'Static' is unchecked. I don't want the player to be able to click on it, so leave 'Useable' unchecked. Change the name of the object to 'Unknown Person' and leave the portrait blank.

Go into its scripts section. Put the following script into its OnHeartbeat event:

NWScript:

In the game, when the player gets within 10 meters of the object, the text will be displayed on-screen... and in the chat display window it will read "Unknown Person: Psst! Come over here!". That text will repeat every 6 seconds (every heartbeat) that the PC remains within range.
I could further develop the script by adding to the above script... say, checking to see if the player comes within 3 meters and spawning in the 'appearing' Unknown Person on top of the placeable object.

One thing you might notice is that the placeable object is pretty small... and text displaying over it appears pretty low to the ground (depending on how zoomed-in the camera is). Here's a trick to place it higher: before placing the invisible object, select another placeable object that is about as high as you need the invisible object to be. Place it, first. Then when you select the invisible object from the menu, place the cursor directly 'over' the first object before clicking to set it down. It will appear on top of the first object. Now delete the first object and your invisible placeable floats in mid-air (and will stay there).

Having a Placeable Object Start a Dialogue
Let's say that I want an object that the player can select and get an interactive dialogue... or perhaps the object actually speaks.

First, go into the placeable objects list and pick out an object. Select a pedestal, for instance, and place it in the module. Go into its properties and ensure that 'Static' is unchecked and 'Useable' is checked.

Go to the advanced tab. Write in a name for the dialogue file we are going to create and press Edit. You can start with a line like "There is some fine writing on the pedestal which is in a strange language. Do you try to decipher it?" You could then continue to give responses and make the dialogue as long as you like, just as normal dialogue.

Go into the scripts tab and place the following script under OnUsed:

NWScript:

In the game, when the player clicks on the pedestal, he will approach it and the dialogue will ensue normally. Since I specified TRUE in the bPrivateConversation parameter of the command, only he will see the dialogue... another player standing next to him would see and hear nothing.

If I didn't care whether the text displayed, I could simply have written ActionStartConversation(oPC), since the "" just means that the attached dialogue file is used.

Starting a Conversation With a Door
Let's say I want to simulate this: the player selects a door to open but finds it locked. A voice speaks from the other side: "What's the password?"

First, place the door normally. Go into its properties and change the name. The great thing about a door's name is that it doesn't show up anywhere (even on Examine) except in dialogue... so let's change it to "Guard on other side", since that's what the player will see.

Mark the door as 'plot' so it can't be broken down (although you could certainly let it be, and even script consequences for attempting to bash in the OnDamaged or OnPhysicalAttacked events). Go into the lock tab and check the 'Locked' box. If you don't want it pickable, check the 'Key required to lock or unlock' box (although, again, you can leave it if you wish).

Go into the advanced tab and put a name into conversation and press Edit. We can make the first line "What's the password?" and continue as we wish... whenever the point in the dialogue is reached where the guard agrees to open the door, place this script in that node's 'Actions Taken' section:

NWScript:

Now we have to place the script that starts the conversation. Place the following script in the OnFailToOpen event:

NWScript:

In the game, then, the player will click on the door and approach it. He will get the 'door rattle' sound when the door fails to open, and suddenly the dialogue will appear. He will see the portrait of the door and 'Guard on other side' at the top... with the text "What's the password?" displayed. When the dialogue point is reached for the door to open, it is unlocked and swings open... the player can now use the transition beyond.

 

 

Mass Effect Now Available
Neverwinter Nights 2 Forums
Hide/Show

English
Deutsch
Français
Español
Italiano

Hide/Show

View Latest Screenshots 

View Latest Screenshots
Hide/Show

Multiplayer Games at Neverwinter Connections

Today
Schedule a Game...



Current time is: (set time)
Sat, 19 July 2008 07:17PM

Hide/Show

Buy Premium Modules

Top NWN: HotU Modules:
1. TORTURED HEARTS II.
2. More...

Top NWN: SoU Modules:
1. TORTURED HEARTS II.
2. More...

Top CEP Modules:
1. The Lord of Terror The Diablo Campa...
2. More...

Top Modules - NWVault:
1. Hall of Fame
2. More...

Total Modules: 4423

Hide/Show

4,052,294 BioWare Users:
  103 Logged In
  16 Hidden
  452 Guests

1858 Playing Online
  100% NWN
  101% NWN: SoU
  101% NWN: HotU

544 Registered Guilds

7,708,368 posts in forums

Newest Forum Topics:
1. Question about download content (Mass Effect PC Version General Discussion (Spoilers will be moved))

2. 1Up review and E3 screens (Dragon Age: Origins General Discussion)

3. Collision Boxes not showing ? (NWN2: Builders - NWN2 Toolset)

4. Name Generation in Character Cre... (NWN2: Custom Content)

5. Will Characters Leave? (Dragon Age: Origins General Discussion)