#
# This is the simple assignment script for
# the Example Chat Trigger script. To assign
# this example to an NPC, type:
#
# /npc assign --set Talker
#
'Talker':
type: Assignment
actions:
on assignment:
- trigger name:chat toggle:true
interact scripts:
- 10 Example Chat Trigger
#
# This is the interact script for the Talker NPC.
# It explains the usage of 'chat triggers' in
# a dscript.
#
'Example Chat Trigger':
type: interact
#
# It is important to see how steps affect the
# chat triggers.
#
steps:
# This is the first step. Your default step is denoted
# with a * character at the end of the name.
'first step*':
# This defines the trigger type. In this example
# were using the 'chat trigger'
chat trigger:
# NPCs can have multiple chat triggers in 1 step. This
# step uses numbers to diffenciate the triggers.
'1':
# The trigger node is used to define that the NPC
# listens for. The trigger word is defined within
# the /../'s. Anything outside of the slashes will
# be displayed in the response.
trigger: /Hello/, Mr. Talker!
# These commands will be executed when the user
# says 'Hello' to the NPC.
script:
- chat "Oh, hi there <PLAYER.NAME>"
- chat "See how I responded to you saying 'hello' to me?"
# This is the beginning of the second chat trigger
# within the first step of the script.
'2':
# This defines the trigger word for the second
# chat trigger.
trigger: Let's /move/ on.
# This set of commands will be executed when
# the user says 'move' to the NPC. The last
# command causes the player to move to the
# second step of the script
script:
- chat "Okay, now we'll move onto the second step."
- chat "Now, the second set of chat triggers will work"
- zap 'step:second step'
# This defines the second step. These triggers will not
# trigger unless the player has moved on to this step.
# Once they have, triggers in the other step will not
# trigger.
'second step':
chat trigger:
# In this step, the triggers have words for names
# as opposed to numbers, either way works.
'first':
trigger: Oh, /wow/, this is fancy!
script:
- chat "Now that you are on the second step, I listen for this chat triggers."
- chat "Also, I no longer listen for the first step chat triggers"
'second':
trigger: Time to go /back/ to the first step.
script:
- chat "Now we'll go back to the first step, so that those trigger are active"
- chat "The second step chat triggers will no longer be listened for."
- zap 'step:first step*'