NPCs can have dialog in Quake3_Quake1 (monster_any::talkdialog).
Their dialog can trigger events or remove a wall (killtarget). trigger_dialog can change their dialog.
The talk dialog is mouse driven. Selecting a topic may fire a trigger event, remove a wall, initiate an attack or a swarm attack or permanently change their dialog.
Dialog fields in the map say with monster_guard:
- "talkname" "johnson"
- "talkdialog" "dialog/map_mymap_johnson.txt"
- "talkpic" "dialog/guard_gold" (either .png or .jpg)
- "peaceful" set this to 1 (or 4 to have the character slowly face you when near)
The text can be in the talkdialog field or if it ends with .txt, it specifies an external .txt file like dialog/map_mymap_johnson.txt".
When close to a character with dialog, the player is shown a message to interact.
The total entity would look like this in the .map file:
{
"classname" "monster_guard"
"talkpic" "dialog/guard_gold"
"skin" "3" // gold skin
"talkname" "johnson"
"peaceful" "4"
"angles" "0 225 0"
"talkdialog" "dialog/map_mymap_johnson.txt"
"origin" "-589.812 -497.21 -8"
}
Dialog File Simple Example
The format is:
- topic1 topic2 topic3|Hello, I am your character introduction.
- <topic1>This is me discussing topic1.
- <topic2>This is me discussing topic2.
- <bye>This is me saying bye.
The contents of this .txt file would look like so:
topic1 topic2 topic3|Hello, I am your character introduction.
<topic1>This is me discussing topic1.
<topic2>This is me discussing topic2.
<bye>This is me saying bye.
Dialog Directives
You can cause a topic to
- fire a trigger using "#" (pound) : <topic1:#door1>Door opened
- remove an entity using "-" (minus): <topic1:-boulder1>boulder gone
- terminate discussion using "!bye": <topic1:!bye>You have offended me. Get lost, jerkface!
- cause all monsters to attack using "!fight":<topic1:!fight>You'll die for that.
You can also cause a topic to change future dialogs (typically you should add !bye):
- change future dialogs using "@": <topic1:@dialog/map_mymap_dialog2.txt !bye>After you do it, come back and see me.
Directives can be combined.
Dialog File Example :: dialog/map_mymap_johnson.txt
assist don't_assist bye|I am Johnson and this is the New Pompeii Control Center at Stormkeep.
Do you wish to assist us? Or would you like to go on your way?
<assist:#door1 @dialog/map_mymap_johnson_assist.txt !bye>
Grab any supples here that you want.
When ready, proceed to the transporter in the next room.
<don't_assist:-exitdoor1 @dialog/map_mymap_johnson_dont_assist.txt !bye>
Too bad for us. I have deployed a transporter back to your base.
Have a safe trip!
<bye>
Good luck!
Triggering Dialog Change
So you have a button that kills the Chthon. A guy in the beginning of the map gave you the quest.
Let's say the func_button fires "plat1".
You can create an entity as such to change the dialog which will also fire when the button is pushed:
{
"classname" "trigger_dialog"
"targetname" "plat1"
"target" "guy"
"talkdialog" "dialog/map_mymap_guy2.txt" // change dialog to this
"origin" "-48 3425 413"
}
Summary
The dialog system in Quake3_Quake1 is flexible and straightforward. The setup is easy to modify and restarting a map reloads external dialog. This makes editing it/adjusting it very easy.
Additional note, the entire conversion can be viewed at all times, scrolling up/down with arrow keys.
[todo: a topic can reveal another topic)