Denizen/0.7/Interact Scripts/Commands: Difference between revisions

From Citizens Wiki
Line 143: Line 143:
These commands show some text to the player interacting, and usually to bystanders around. Text commands also have some auto-formatting, such as making sure no words will be cut off on long messages, and applying color codes. See: [[Color_Codes|Denizen Color Codes]]. Formatting for how NPCs and Players talk can be customized in the [[Denizen/config.yml]].
These commands show some text to the player interacting, and usually to bystanders around. Text commands also have some auto-formatting, such as making sure no words will be cut off on long messages, and applying color codes. See: [[Color_Codes|Denizen Color Codes]]. Formatting for how NPCs and Players talk can be customized in the [[Denizen/config.yml]].


*'''All Speech commands require either single ' ' or double " " around the text!'''
*'''All Speech commands require either single ' ' or double " " around the text''' If your text has an apostrophe (') in it, you '''MUST''' use double quotes " ".!!


You can use the following placeholders to fill in specific information:
You can use the following placeholders to fill in specific information:
Line 156: Line 156:
{{Denizen Command Color 2|lavender|
{{Denizen Command Color 2|lavender|
CHAT
CHAT
|["The text to chat."] (NPCID:[#]) (NOPLAYER)
|["The text to chat."] (NPCID:#) (NOPLAYER)
| Makes the Denizen talk to the player. This is the standard chat mechanism in Denizen. You can also change the NPC doing the talking by specifying a Denizen's C2 NPCID. If you would rather the Denizen NPC not speak to the Player directly, use the <tt>NOPLAYER</tt> argument.
| Makes the Denizen talk to the player. This is the standard chat mechanism in Denizen. You can also change the NPC doing the talking by specifying a Denizen's C2 NPCID. If you would rather the Denizen NPC not speak to the Player directly, use the <tt>NOPLAYER</tt> argument.
'''Example Usages'''
'''Example Usages'''
Line 167: Line 167:
{{Denizen Command Color 2|lavender|
{{Denizen Command Color 2|lavender|
WHISPER  
WHISPER  
|["The text to whisper."] (NPCID:[#]) (NOPLAYER)
|["The text to whisper."] (NPCID:#) (NOPLAYER)
| Whispers the text to the player. Really just an alternative to CHAT. By default, bystanders can't hear what the NPC whispers to the interacting Player. As with the <tt>CHAT</tt> command, NPCID can be specified. Using NOPLAYER is possible too, since it may be of use in some circumstances. But remember: by default, no bystanders can see the actual text the NPC Denizen whispers. This can be changed in the [[config.yml]].
| Whispers the text to the player. Really just an alternative to CHAT. By default, bystanders can't hear what the NPC whispers to the interacting Player. As with the <tt>CHAT</tt> command, NPCID can be specified. Using NOPLAYER is possible too, since it may be of use in some circumstances. But remember: by default, no bystanders can see the actual text the NPC Denizen whispers. This can be changed in the [[config.yml]].
'''Example Usages'''
'''Example Usages'''
Line 177: Line 177:
{{Denizen Command Color 2|lavender|
{{Denizen Command Color 2|lavender|
SHOUT  
SHOUT  
|["The text to chat."] (NPCID:[#]) (NOPLAYER)
|["The text to chat."] (NPCID:#) (NOPLAYER)
| Shouts the text to players nearby. The range that a bystander can hear an NPC Denizen shout is larger then that of a standard <tt>CHAT</tt>, so it also has some technical advantages. <tt>NPCID</tt> can be specified. Using <tt>NOPLAYER</tt> will drop reference to the Player when talking. You can still reference <PLAYER>, however, if need be. See the example below for an idea for usage.
| Shouts the text to players nearby. The range that a bystander can hear an NPC Denizen shout is larger then that of a standard <tt>CHAT</tt>, so it also has some technical advantages. <tt>NPCID</tt> can be specified. Using <tt>NOPLAYER</tt> will drop reference to the Player when talking. You can still reference <PLAYER>, however, if need be. See the example below for an idea for usage.
'''Example Usages'''
'''Example Usages'''
Line 187: Line 187:
{{Denizen Command Color 2|lavender|
{{Denizen Command Color 2|lavender|
EMOTE  
EMOTE  
|['The text to emote.'] (NPCID:[#])
|['The text to emote.'] (NPCID:#)
| Let's the Denizen NPC show emotion. Similar to the /me command in IRC, for example. Could be useful for describing to the player what an NPC Denizen may need, or how the NPC Denizen is feeling. <tt>NPCID</tt> can be specified to change the Denizen NPC doing the  'emote'.
| Let's the Denizen NPC show emotion. Similar to the /me command in IRC, for example. Could be useful for describing to the player what an NPC Denizen may need, or how the NPC Denizen is feeling. <tt>NPCID</tt> can be specified to change the Denizen NPC doing the  'emote'.
'''Example Usages'''
'''Example Usages'''

Revision as of 06:02, 21 August 2012

Interact Script Commands are used to make the Denizen perform actions in an Interact Script. They are written in a YAML sequence under the Script node of an Interact Trigger. A single entry in the sequence contains a Command and Modifiers. Some commands have no available modifiers.

Syntax

Syntax is very important for proper execution.

  • Placing a caret ^ in front of the command name causes that command to ignore the normal 0.5 second delay between commands.
  • The command must be upper-case (i.e CHAT not chat)
  • Modifiers are not case sensitive.
  • Modifiers in [Brackets] are required for the command to execute. [A or B] means either A or B is required.
  • Modifiers in (Parentheses) are optional, and generally change the default behavior of the command.
  • Modifiers that take a value are of the form MODIFIER:VALUE.
    • If the VALUE of the modifier contains a space, such as in the case of a NPC or script name, the whole modifier must be put in quotes.
Example: - TELEPORT BOOKMARK:Bob:Bobshouse is okay, but - TELEPORT 'BOOKMARK:Bob Jones:Bobshouse' requires the quotes to function properly.

Example:

Some Trigger:
  Script:
  - COMMAND1 MODIFIER1 MODIFIER2:VALUE
  - COMMAND2 'MODIFIER1:Value With Spaces'
  - ^COMMAND3 'This will run instantly after COMMAND2'

List of Commands

Script Flow

These commands have no external affect on the world, but can control the flow of scripts within Denizen. Though not required, and with the exception of WAIT, it is generally recommended to run these as Instant Commands to ensure smooth Script feedback to players.

Server

The commands below require [Vault] and a valid permissions system.

Speech

These commands show some text to the player interacting, and usually to bystanders around. Text commands also have some auto-formatting, such as making sure no words will be cut off on long messages, and applying color codes. See: Denizen Color Codes. Formatting for how NPCs and Players talk can be customized in the Denizen/config.yml.

  • All Speech commands require either single ' ' or double " " around the text If your text has an apostrophe (') in it, you MUST use double quotes " ".!!

You can use the following placeholders to fill in specific information:

  • <NPC> - The Denizens's name.
  • <PLAYER> - The interacting Player's name
  • <DISPLAYNAME> - The interacting Player's display name
  • <HEALTH> - The interacting Player's heath
  • <WORLD> - The name of the Denizen's world

If you use the NOPLAYER modifier on a text command the <PLAYER>, <DISPLAYNAME> and <HEALTH> tags are not available.

Movement

Denizen NPC commands are meant to help bring your Denizen to life by allowing fine-control of small movements. These are not necessarily meant for making the Denizen NPC do large/long activities, those will instead be done by the Activities, which is just now starting to be implemented into Denizen. The next 'large' update will focus on Activities.

World Interaction

Player Interaction