Difference between revisions of "Admin/NPC Dialog"

From Draccyserv Info
Jump to: navigation, search
(Essential Dialog)
 
Line 1: Line 1:
 
The dialog system for NPCs uses a combination of a [[Admin/Toolbook | Toolbook]] and a [http://draccyserv.com/admin/npc_dialog.php dedicated webpage]. The webpage is not accessible without a valid Admin login.
 
The dialog system for NPCs uses a combination of a [[Admin/Toolbook | Toolbook]] and a [http://draccyserv.com/admin/npc_dialog.php dedicated webpage]. The webpage is not accessible without a valid Admin login.
 +
 +
'''For a rundown of how NPCs work with quests, check out the [[Admin/NPC_Quest_Tutorial|NPC Quest Tutroial]]!'''
  
 
== Getting Started ==
 
== Getting Started ==

Latest revision as of 21:33, 18 May 2020

The dialog system for NPCs uses a combination of a Toolbook and a dedicated webpage. The webpage is not accessible without a valid Admin login.

For a rundown of how NPCs work with quests, check out the NPC Quest Tutroial!

Getting Started

Dialogconfigurator.png


The NPC Dialog Configurator webpage allows you to create NPC dialog files. You can attach these dialog sets to multiple NPCs.

Whenever you submit the form on this page using the button on the bottom, you can use the back button on your browser to return to the page without losing your inputs.

Don't refresh the page or you will reset the form and lose any unsaved work.

Naming your NPC

The name you type in will automatically be converted for its filename into lowercase with underscores replacing spaces. The name will appear as you typed it in-game for the NPC's entity name and dialog text.

It's important to note that if you type in an NPC name that already exists, the system will overwrite the existing file. This may be changed in a later revision, when loading tools are implemented.

You can apply most standard text effects found in Minecraft, including less practical ones like black text color or obfuscated text.

A standard color/format scheme for specific NPC roles (types of quests, shopkeepers, etc) is planned but not yet established.


Essential Dialog

Dialogline1.png


At the very minimum, an NPC must have text in the first Dialog section ("Dialog Line 1") for the chat to work correctly.

This is the block of text that first prints next to <npcname> in the chat box when the NPC is right-clicked.

There is also an optional "Farewell" message which will appear whenever the player walks away from the NPC.


Dialogfarewell.png


Expanding Dialog

At the most basic level, NPC dialog supports up to 10 sections in a dialog tree.

You can direct players to additional sections of dialog via the option mechanism at the end of any section of dialog.

Adding Options

Dialogoptions.png


At the end of each dialog section (paragraph box) there are three slots for player responses. These "clickables" are used to activate new sections of dialog when they're clicked with a mouse where they appear in the chat box in-game.

In the NPC dialog system, each option field is paired with a "Go to dialog section" value of 1-10. These values represent which section of dialog will appear when the option is clicked.

Example
If Section 1 has Option 1 filled in on the configurator, and that option's text reads "OK", and the Go to value is 4, the player will see "[ OK ]" after the first dialog section appears, and will see section 4 when they click on "[ OK ]".

You can have up to 3 options, making it possible to present players with multiple choices when interacting with dialog.

For options with short text length, the system will try to place the options on the same line together in-chat. Longer option text lengths will have a line break ahead of them.


Not all Admins need to understand the more advanced utility of this system. It is perfectly fine to simply point dialog lines from 1 to 2 to 3 using the first Option on each one if you just want to break up dialog into paragraphs.

As a slightly more complicated use of options, a simple "[ Yes ] [ No ]" presentation allows for some rudimentary multiple choice.



To skip the advanced stuff and get straight to implementing your basic NPC dialog, jump to the Dialog Book section.



Advanced Features

Dialog Loops

Using the Options, it's possible to refer to earlier sections of dialog. This allows for looping and other dialog tricks.

This technique can lead to instability in the dialog system if an option is configured to directly call back to the dialog section immediately previous. (such as section 8, option 2 pointing to section 7). This may also have problems if an option in one section points back to a section whose options pointed to it. From a technical standpoint, the instability occurs as the flags are added or removed between sections in an unexpected order.

To make sure loops work reliably, always have at least one additional section of dialog between the starting and ending sections in a loop structure.

Example
Dialog Section 3 has an option that points to Dialog Section 6.
Dialog Section 6 has an option that points to Dialog Section 7
Dialog Section 7 has an option that points back to Dialog Section 3.
The loop is stable because Dialog Section 7 acts as a buffer.

Special Operations

Dialogspecialops.png


Whenever a dialog section is triggered, it can optionally execute a number of special operations.

Change Trade
Switch NPC's Trade to another set
Complete Quest + Reset Quest
Use these to instantly complete a Quest or revoke one that has been completed. This can optionally be used to reroute dialog to alternate trees, although the results may be unpredictable.
In such applications, plan to end dialog after this is triggered so that the dialog tree can be restarted with the new quest flags established.
Give Item
You can specify the quantity of an Item given when the dialog section is triggered.
You can add lore text and/or rename the given item. Custom NBT is not yet implemented.
Clear Item
Removes a specified number of a specific item from the player's inventory.
You can filter for a specific lore text and/or a custom name. Custom NBT is not yet implemented.
Teleport Player(s)
Teleporting may result in an interrupted/incomplete dialog tree progression and other weirdness! Use with caution.
Run Special Function
Run a Special Function which could do just about anything (depends on what's available in the list).
Execute Raw Command
(not yet implemented)

Alternate Dialog Trees

Dialogtreeb.png


The primary dialog tree (A) is active when no special quest conditions are met.

Two alternate dialog trees (B and C) are triggered under conditions specific to quest completion.

Clicking the tabs at the top of the dialog section will allow you to switch between trees while creating your dialog.

These alternate trees will not be triggered unless the related quest requirements are met.

If Quest
Determines which quests must be complete for the dialog tree to appear
Dialog A will never trigger when any "If Quest" qualifiers are satisfied for B and/or C
Unless Quest
Determines which completed quests prevent the dialog tree from appearing
Use this to make sure B and C have opposite qualifiers or they might both appear simultaneously!
Having any "Unless Quest" qualifiers satisfied for B or C will have no impact on Dialog Tree A.
Example
Dialog Tree B needs "Happy Time" quest completed as an "If Quest" qualifier.
When the player has "Happy Time" completed, Dialog Tree B shows up when they right-click the NPC.
Dialog Tree A will automatically be disabled for a player with "Happy Time" completed.
Dialog Tree C needs "Sad Time" quest completed as an "If Quest" qualifier.
Dialog Tree B has "Sad Time" as an "Unless Quest" qualifier to prevent it from firing when Dialog Tree C is intended.
Dialog Tree C has "Happy Time" as an "Unless Quest" qualifier for the same reason in regards to Dialog tree B.

Dialog Book

The NPC Dialog Toolbook is automatically updated whenever there is new information submitted via the Configurator webpage.

The server refreshes this content every 60 seconds. Remember to wait a minute before checking for new entries.

Stand within 2 blocks of your target NPC to affect it with the clickable blue command links in this book. Be careful not to stand too close to other NPCs you aren't trying to target, as this will apply to any NPC in range.

Page 1
Refresh Book
Replace your copy with the current Edition.
The current Edition of the book is reflected on the webpage as well.
Page 1
Clear NPC dialogs
This will remove all possible dialog trees from the NPC.
Make sure you remove any existing dialog before applying a new one.
Page 2+
All links on additional pages represent individual dialog sets. Click an entry to give the NPC that name and dialog set.
The text of each line matches its filename, which is derived from the NPC name submitted on the Configurator webpage.

Dialogbook1.png Dialogbook2.png


Related Pages

NPC Main Page

Quest Creation

Recipe Creation

Special Functions

Item Name Reference

Clickables Info