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

From Citizens Wiki
m (→‎World Interaction: Changed color.)
No edit summary
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
For more up-to-date information and full details on specific features (individual commands or tags, for example), check the [https://meta.denizenscript.com/ Meta Documentation].
If you want a full tutorial to help get you set up, check out the [https://guide.denizenscript.com/ Beginner's Guide] text website.
If you need quick help, visit our [https://discord.gg/Q6pZGSR Discord group].
<br><br><br>
<span style="font-family:natalya-alternate-one; font-size:300%; margin-right:-7px; margin-left:-10px;">This wiki is outdated, please view the tutorial videos/guide, meta documentation, or Discord group (all linked above) for up-to-date information!</span>
<br><br><br>
<div style="margin-right:2.0em; padding:10px; font-family:museo-sans; font-size:110%;">
<div style="margin-right:2.0em; padding:10px; font-family:museo-sans; font-size:110%;">
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 [[Denizen/Interact_Scripts/Triggers|Interact Trigger]]. A single entry in the sequence contains a Command and Modifiers. Some commands have no available modifiers.
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 [[Denizen/Interact_Scripts/Triggers|Interact Trigger]]. A single entry in the sequence contains a Command and Modifiers. Some commands have no available modifiers.
Line 117: Line 138:
{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
IF
IF
|(EXACTLY) (PLAYER or DENIZEN or GLOBAL) (-)[FLAG:Name or FLAG:Name:Value] (IS_NUMBER) ['SCRIPT:Script Run When Condition Met'] (QUEUETYPE:TRIGGER or QUEUETYPE:TASK) (APPEND) (ELSE 'SCRIPT:Script Run When Condition Not Met')
|(EXACTLY) (PLAYER or DENIZEN or GLOBAL) (-)[FLAG:Name or FLAG:Name:Value] (IS_NUMBER) ['SCRIPT:Script Run When Condition Met'] (QUEUE:TRIGGER or QUEUE:TASK) (APPEND) (ELSE 'SCRIPT:Script Run When Condition Not Met')
|Checks the value of a FLAG and runs a TASK script if the condition is met. By default the TASK script will run before the interact script continues.
|Checks the value of a FLAG and runs a TASK script if the condition is met. By default the TASK script will run before the interact script continues.
Modifiers:
Modifiers:
Line 126: Line 147:
*IS_NUMBER - The IF condition is met only if the value of the flag is an integer or double.
*IS_NUMBER - The IF condition is met only if the value of the flag is an integer or double.
*APPEND - Runs the TASK after this script completes, instead of before the next command.
*APPEND - Runs the TASK after this script completes, instead of before the next command.
*QUEUETYPE - Specify which queue to run the commands, defaults to the executing queue type.
*QUEUE - Specify which queue to run the commands in, defaults to the executing queue type.
*ELSE - Choose a TASK script to run when the IF condition is not met.
*ELSE - Choose a TASK script to run when the IF condition is not met.
'''Example Usages'''
'''Example Usages'''
Line 248: Line 269:
*All Speech commands '''require quotes''' (single (' ') or double (" ")) around the text. If your text has an apostrophe (') in it, you '''MUST''' use double quotes (" ")!!
*All Speech commands '''require quotes''' (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:
There are various placeholders you can use to fill in specific information. The basic ones are:
*<NPC> - The Denizens's name.
*<NPC> - The Denizens's name.
*<PLAYER> - The interacting Player's name
*<PLAYER> - The interacting Player's name
Line 256: Line 277:


If you use the NOPLAYER modifier on a text command the <PLAYER>, <DISPLAYNAME> and <HEALTH> tags are not available.
If you use the NOPLAYER modifier on a text command the <PLAYER>, <DISPLAYNAME> and <HEALTH> tags are not available.
A list of all available placeholders can be found in [[Replaceables]].


{{Denizen Command Color 2|lavender|
{{Denizen Command Color 2|lavender|
Line 432: Line 455:
====World Interaction====
====World Interaction====


{{Denizen Command Color 2|lightgoldenyellow|
{{Denizen Command Color 2|lightgoldenrodyellow|
DROP
DROP
| [ID or ID:Data or MATERIAL or MATERIAL:Data] (QTY:#) (BOOKMARK:LocationBookmark)
| [ID or ID:Data or MATERIAL or MATERIAL:Data or XP] (QTY:#) (BOOKMARK:LocationBookmark)
| Drop an item at the Denizen's location, or at a location bookmark if one is specified.
| Drop an item at the Denizen's location, or at a location bookmark if one is specified.
'''Example Usages'''
'''Example Usages'''
Line 440: Line 463:
- DROP DIAMOND QTY:3
- DROP DIAMOND QTY:3
- DROP 18:3 QTY:1 BOOKMARK:LargeTree
- DROP 18:3 QTY:1 BOOKMARK:LargeTree
- DROP XP QTY:10
</pre>
</pre>
}}
}}


{{Denizen Command Color 2|lightgoldenyellow|
{{Denizen Command Color 2|lightgoldenrodyellow|
LISTEN KILL
LISTEN KILL
|[TYPE:GROUP or TYPE:PLAYER or TYPE:ENTITY or TYPE:NPC] [NAME:Name or NPCID:#] (QTY:#) [SCRIPT:Task Script]
|[TYPE:GROUP or TYPE:PLAYER or TYPE:ENTITY or TYPE:NPC] [NAME:Name or NPCID:#] (QTY:#) [SCRIPT:Task Script] (ID:Name)
| This command starts the Denizen listening for the player to kill the specified number of specified targets, then runs a task script. Use the NAME:Name modifier when specifying a group name, player name, or [[Types|entity type]] (like 'ZOMBIE'). Use NPCID:# modifier when using TYPE:NPC.  
| This command starts the Denizen listening for the player to kill the specified number of specified targets, then runs a task script. Use the NAME:Name modifier when specifying a group name, player name, or [[Types|entity type]] (like 'ZOMBIE'). Use NPCID:# modifier when using TYPE:NPC.
Optional Modifiers:
Optional Modifiers:
*QTY: - The number things the player must kill before the script is run.
*QTY: - The number things the player must kill before the script is run.
*ID: - The name of the kill listener; without it, the listener will take on the name of the script run upon completion.
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- LISTEN KILL TYPE:ENTITY NAME:ZOMBIE QTY:5 SCRIPT:ZombitReward
- LISTEN KILL TYPE:ENTITY NAME:ZOMBIE QTY:5 SCRIPT:ZombieReward
- LISTEN KILL TYPE:NPC NPCID:12 'SCRIPT:Kill Boss Reward'
- LISTEN KILL ID:BossListener TYPE:NPC NPCID:12 'SCRIPT:Kill Boss Reward'
</pre>
</pre>
}}
}}


{{Denizen Command Color 2|lightgoldenyellow|
{{Denizen Command Color 2|lightgoldenrodyellow|
SPAWN
SPAWN
|[ENTITY_TYPE] (QTY:#) (BOOKMARK:LocationBookmark) ('BOOKMARK:Denizen Name:LocationBookmark') (SPREAD:#) ('EFFECT:[POTION_EFFECT] [LEVEL]') ('OPTION:[OPTIONS]')
|[ENTITY_TYPE] (QTY:#) (BOOKMARK:LocationBookmark) ('BOOKMARK:Denizen Name:LocationBookmark') (SPREAD:#) ('EFFECT:[POTION_EFFECT] [LEVEL]') ('OPTION:[OPTIONS]')
Line 484: Line 509:
}}
}}


{{Denizen Command Color 2|lightgoldenyellow|
{{Denizen Command Color 2|lightgoldenrodyellow|
STRIKE
STRIKE
|(DENIZEN) (BOOKMARK:LocationBookmark) ('BOOKMARK:Denizen Name:LocationBookmark') (NODAMAGE) (NPCID:#)
|(DENIZEN) (BOOKMARK:LocationBookmark) ('BOOKMARK:Denizen Name:LocationBookmark') (NODAMAGE) (NPCID:#)
Line 505: Line 530:
}}
}}


{{Denizen Command Color 2|lightgoldenyellow|
{{Denizen Command Color 2|lightgoldenrodyellow|
SWITCH
SWITCH
|[BOOKMARK:BlockBookmark] or [BOOKMARK:DenizenName:BlockBookmark] (DURATION:#)
|[BOOKMARK:BlockBookmark] or [BOOKMARK:DenizenName:BlockBookmark] (DURATION:#)
Line 519: Line 544:
}}
}}


{{Denizen Command Color 2|lightgoldenyellow|
{{Denizen Command Color 2|lightgoldenrodyellow|
WEATHER
WEATHER
| [SUNNY or STORMY or PRECIPITATING]  
| [SUNNY or STORMY or PRECIPITATING]  
Line 640: Line 665:
</pre>
</pre>
}}
}}
[[Category:Denizen 0.7]]

Latest revision as of 19:02, 3 September 2021

For more up-to-date information and full details on specific features (individual commands or tags, for example), check the Meta Documentation.

If you want a full tutorial to help get you set up, check out the Beginner's Guide text website.

If you need quick help, visit our Discord group.




This wiki is outdated, please view the tutorial videos/guide, meta documentation, or Discord group (all linked above) for up-to-date information!








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 effect 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 quotes (single (' ') or double (" ")) around the text. If your text has an apostrophe (') in it, you MUST use double quotes (" ")!!

There are various placeholders you can use to fill in specific information. The basic ones are:

  • <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.

A list of all available placeholders can be found in Replaceables.

Denizen Interaction

Denizen interaction commands are meant to help bring your Denizen to life by allowing fine control of movement and actions during scripts. These are not meant for making the Denizen do continuous movement and actions, that should instead be done via Activities.

World Interaction

Player Interaction

These commands default to affecting the interacting player. Most have modifiers to affect the executing Denizen instead.