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

From Citizens Wiki
(Documented DROP command and fixed 2 typos.)
(Sorted the commands alphabetically in each category, with aufdemrand's permission.)
Line 30: Line 30:


{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
ENGAGE
CANCELTASK
|(DURATION:#) (NPCID:#)
|['SCRIPT:Name of Script']
| <p>Blocks player interaction from triggering the NPC. This may be useful if a long script required the player to listen or watch a series of events and you didn't want the Player to be able to interact while these commands were being taken out. Use with either a <tt>DURATION</tt> or <tt>DISENGAGE</tt>. <tt>DURATION</tt> will automatically <tt>DISENGAGE</tt> after the specified amount of seconds. If no <code>NPCID</code> is included, the Denizen triggered is used. Remember: While <tt>ENGAGED</tt>, no scripts will trigger, so be diligent in using!</p>
|Cancels a task that has been scheduled for the interacting player using RUNTASK DELAY
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- ENGAGE
- CANCELTASK SCRIPT:RaceEnd
- (Other Commands)
</pre>
- DISENGAGE
}}


- ENGAGE DURATION:12
{{Denizen Command Color 2|mintcream|
- ENGAGE NPCID:2</pre>
COOLDOWN
|[# or DURATION:#] (GLOBAL) ('SCRIPT:Name of Script')
|Sets a cooldown period for this script. Defaults to the currently running script and the interacting player. Until the script has cooled down, it will not be selected to run again. Requires a number of seconds to be specified with or without the DURATION: modifier name.
Modifiers:
*GLOBAL makes the script unavailable to everyone, instead of just the interacting player.
*SCRIPT: Sets the cooldown a different script.
'''Example Usages'''
<pre>
- COOLDOWN 60
- COOLDOWN GLOBAL 100
- COOLDOWN 'SCRIPT:A Different Script' 600
- COOLDOWN DURATION:15
</pre>
}}
}}
{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
DISENGAGE
DISENGAGE
Line 55: Line 68:
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
ZAP
ENGAGE
|(Step #) ('SCRIPT:Name of Script') (DURATION:#) (RANDOM:#-#)
|(DURATION:#) (NPCID:#)
| <p>A very powerful command, indeed. This is how Scripts progress through their steps. It is not done automatically, instead, you get to decide how to progress. ZAP used alone will simply progress the Player to the next step in the Script. Note: Denizen does not check whether the step exists, so you can use that to your advantage in an Overlay Script Assignment. If an Integer is used, that step will be used.</p>
| <p>Blocks player interaction from triggering the NPC. This may be useful if a long script required the player to listen or watch a series of events and you didn't want the Player to be able to interact while these commands were being taken out. Use with either a <tt>DURATION</tt> or <tt>DISENGAGE</tt>. <tt>DURATION</tt> will automatically <tt>DISENGAGE</tt> after the specified amount of seconds. If no <code>NPCID</code> is included, the Denizen triggered is used. Remember: While <tt>ENGAGED</tt>, no scripts will trigger, so be diligent in using!</p>
<p>Specify a <tt>SCRIPT</tt> to change the active step for a Player in a specific Script. If not specified, the triggering Script is used. A <tt>DURATION</tt> can be set to provide an automatic "DEZAP" of sorts, reverting the step back after a specific amount of seconds, unless, in that duration another ZAP command has taken place. This can be used as a 'timeout' of sorts. <tt>RANDOM</tt> can be used to let chance select the step to progress the Player to. If one Integer is included, steps 1 through the chosen number will be randomly selected. You can also use a range of numbers if two Integers are used.</p>
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- ZAP
- ENGAGE
- ZAP 5
- (Other Commands)
- ZAP RANOMD:6
- DISENGAGE
- ZAP RANDOM:3-6 DURATION:60
 
- ZAP 6 'SCRIPT:Another Script'
- ENGAGE DURATION:12
</pre>
- ENGAGE NPCID:2</pre>
}}
 
{{Denizen Command Color 2|mintcream|
FAIL
|('SCRIPT:Name of Script')
| <p>Marks a script as 'Failed' to check against with the <tt>FAILED</tt> requirement. This is identical to the <tt>FINISH</tt> command, except keeps track of 'fails' instead. Again, this is kind of like a built-in flag for scripts, and acts much like a Counter, ie. You can <tt>FAIL</tt> a script multiple times and it will keep track of the total number, unless <tt>RESET</tt>. Note: A script can be both 'finished' and 'failed', the two commands work independently.</p>
'''Example Usages'''
<pre>- FAIL
- FAIL 'SCRIPT:Magic Feathers'</pre>
}}
}}
{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
WAIT
FINISH
|[# of Seconds] (QUEUE:TASK) (QUEUE:TRIGGER)
|('SCRIPT:Name of Script')
| <p>Pauses a Queue for a specified amount of seconds. If no <tt>QUEUE</tt> is specified, the sending queue is used. For example, if the command is sent from an Interact (Triggered) Script, the queue that will be held is the 'Trigger Queue'. Could be useful in advanced usage situations when using both Task Scripts and Interact Scripts together.</p>
| <p>Marks a script as 'Finished' to check against with the <tt>FINISHED</tt> requirement. This is kind of like a built-in flag for scripts, and acts much like a Counter, ie. You can <tt>FINISH</tt> a script multiple times and it will keep track of the total number, unless <tt>RESET</tt>.</p>
'''Example Usages'''
'''Example Usages'''
<pre>- WAIT 6
<pre>- FINISH
- WAIT 30 QUEUE:TASK</pre>
- FINISH 'SCRIPT:Another Script'</pre>
}}
}}
{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
FLAG
FLAG
Line 90: Line 114:
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
FINISH
IF
|('SCRIPT:Name of Script')
|(EXACTLY) (GLOBAL) (-)[FLAG:Value] [FLAG]  '[SCRIPT:Task Script to Run]' (QUEUETYPE:TRIGGER) (QUEUETYPE:TASK) (APPEND)
| <p>Marks a script as 'Finished' to check against with the <tt>FINISHED</tt> requirement. This is kind of like a built-in flag for scripts, and acts much like a Counter, ie. You can <tt>FINISH</tt> a script multiple times and it will keep track of the total number, unless <tt>RESET</tt>.</p>
|Checks the value of a FLAG and runs a TASK script if it passes. By default the TASK script will run before the interact script continues.
Modifiers:
*EXACTLY - For integer flags only passes if the value matches exactly. By default passes if value is greater than or equal.
*GLOBAL - check a GLOBAL flag instead of a flag on this player
*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.
'''Example Usages'''
'''Example Usages'''
<pre>- FINISH
<pre>
- FINISH 'SCRIPT:Another Script'</pre>
- IF FLAG:BossDead SCRIPT:Reward APPEND
- IF EXACTLY FLAG:Stage:4 SCRIPT:Stage4Instructions
</pre>
}}
}}
{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
FAIL
RANDOM
|('SCRIPT:Name of Script')
|[#]
| <p>Marks a script as 'Failed' to check against with the <tt>FAILED</tt> requirement. This is identical to the <tt>FINISH</tt> command, except keeps track of 'fails' instead. Again, this is kind of like a built-in flag for scripts, and acts much like a Counter, ie. You can <tt>FAIL</tt> a script multiple times and it will keep track of the total number, unless <tt>RESET</tt>. Note: A script can be both 'finished' and 'failed', the two commands work independently.</p>
|Selects a single command to run from the next # lines in the script and discards the rest.
'''Example Usages'''
'''Example Usages'''
<pre>- FAIL
<pre>
- FAIL 'SCRIPT:Magic Feathers'</pre>
- CHAT "I'm going to say the name of an animal"
- RANDOM 3
- CHAT "Cow"
- CHAT "Zebra"
- CHAT "Elephant"
- CHAT "Wasn't that fun?"
</pre>
}}
}}
{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
RESET
RESET
Line 116: Line 156:
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|mintcream|
 
COOLDOWN
|[# or DURATION:#] (GLOBAL) ('SCRIPT:Name of Script')
|Sets a cooldown period for this script. Defaults to the currently running script and the interacting player. Until the script has cooled down, it will not be selected to run again. Requires a number of seconds to be specified with or without the DURATION: modifier name.
Modifiers:
*GLOBAL makes the script unavailable to everyone, instead of just the interacting player.
*SCRIPT: Sets the cooldown a different script.
'''Example Usages'''
<pre>
- COOLDOWN 60
- COOLDOWN GLOBAL 100
- COOLDOWN 'SCRIPT:A Different Script' 600
- COOLDOWN DURATION:15
</pre>
}}
{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
RUNTASK
RUNTASK
Line 144: Line 170:
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
CANCELTASK
WAIT
|['SCRIPT:Name of Script']  
|[# of Seconds] (QUEUE:TASK) (QUEUE:TRIGGER)
|Cancels a task that has been scheduled for the interacting player using RUNTASK DELAY
| <p>Pauses a Queue for a specified amount of seconds. If no <tt>QUEUE</tt> is specified, the sending queue is used. For example, if the command is sent from an Interact (Triggered) Script, the queue that will be held is the 'Trigger Queue'. Could be useful in advanced usage situations when using both Task Scripts and Interact Scripts together.</p>
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>- WAIT 6
- CANCELTASK SCRIPT:RaceEnd
- WAIT 30 QUEUE:TASK</pre>
</pre>
}}
}}
{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
RANDOM
ZAP
|[#]
|(Step #) ('SCRIPT:Name of Script') (DURATION:#) (RANDOM:#-#)
|Selects a single command to run from the next # lines in the script and discards the rest.
| <p>A very powerful command, indeed. This is how Scripts progress through their steps. It is not done automatically, instead, you get to decide how to progress. ZAP used alone will simply progress the Player to the next step in the Script. Note: Denizen does not check whether the step exists, so you can use that to your advantage in an Overlay Script Assignment. If an Integer is used, that step will be used.</p>
<p>Specify a <tt>SCRIPT</tt> to change the active step for a Player in a specific Script. If not specified, the triggering Script is used. A <tt>DURATION</tt> can be set to provide an automatic "DEZAP" of sorts, reverting the step back after a specific amount of seconds, unless, in that duration another ZAP command has taken place. This can be used as a 'timeout' of sorts. <tt>RANDOM</tt> can be used to let chance select the step to progress the Player to. If one Integer is included, steps 1 through the chosen number will be randomly selected. You can also use a range of numbers if two Integers are used.</p>
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- CHAT "I'm going to say the name of an animal"
- ZAP
- RANDOM 3
- ZAP 5
- CHAT "Cow"
- ZAP RANOMD:6
- CHAT "Zebra"
- ZAP RANDOM:3-6 DURATION:60
- CHAT "Elephant"
- ZAP 6 'SCRIPT:Another Script'
- CHAT "Wasn't that fun?"
</pre>
</pre>
}}
{{Denizen Command Color 2|mintcream|
IF
|(EXACTLY) (GLOBAL) (-)[FLAG:Value] [FLAG]  '[SCRIPT:Task Script to Run]' (QUEUETYPE:TRIGGER) (QUEUETYPE:TASK) (APPEND)
|Checks the value of a FLAG and runs a TASK script if it passes. By default the TASK script will run before the interact script continues.
Modifiers:
*EXACTLY - For integer flags only passes if the value matches exactly. By default passes if value is greater than or equal.
*GLOBAL - check a GLOBAL flag instead of a flag on this player
*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.
'''Example Usages'''
<pre>
- IF FLAG:BossDead SCRIPT:Reward APPEND
- IF EXACTLY FLAG:Stage:4 SCRIPT:Stage4Instructions
</pre>
}}
}}
</div>
</div>
Line 200: Line 212:
The commands below require [[http://dev.bukkit.org/server-mods/vault/ Vault]] and a valid permissions system.
The commands below require [[http://dev.bukkit.org/server-mods/vault/ Vault]] and a valid permissions system.
</div>
</div>
{{Denizen Command Color 2| aliceblue|
{{Denizen Command Color 2| aliceblue|
PERMISS
PERMISS
Line 238: Line 251:


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.
{{Denizen Command Color 2|lavender|
ANNOUNCE
|['The text to announce.']
| Sends the text as a sever announcement to all players, regardless of their place in the world. Could be especially useful for any kind of administration script.
'''Example Usages'''
<pre>
- ANNOUNCE "<PLAYER> has found a secret!"
</pre>
}}


{{Denizen Command Color 2|lavender|
{{Denizen Command Color 2|lavender|
Line 250: Line 273:
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|lavender|
 
WHISPER
|["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]].
'''Example Usages'''
<pre>
- WHISPER "The password is.. 42."
- WHISPER NPCID:2 "Hey, I didn't want to blurt this out so everyone could hear, but..."
</pre>
}}
{{Denizen Command Color 2|lavender|
SHOUT
|["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.
'''Example Usages'''
<pre>
- SHOUT "EEEK! a spider!"
- SHOUT NOPLAYER "<PLAYER> is a thief! Get him!"
</pre>
}}
{{Denizen Command Color 2|lavender|
{{Denizen Command Color 2|lavender|
EMOTE  
EMOTE  
Line 281: Line 285:
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|lavender|
HINT
|(SHORT)
| If called from an Interact Script Step with a Chat Trigger, this will output a list of all possible things the player can say to activate a chat trigger.
Modifiers:
*SHORT
::The Denizen will only say the list of trigger words, instead of the full sentence.
'''Example Usages'''
<pre>
- HINT
- HINT SHORT
</pre>
}}
{{Denizen Command Color 2|lavender|
{{Denizen Command Color 2|lavender|
NARRATE
NARRATE
Line 290: Line 309:
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|lavender|
{{Denizen Command Color 2|lavender|
ANNOUNCE
SHOUT
|['The text to announce.']
|["The text to chat."] (NPCID:#) (NOPLAYER)
| Sends the text as a sever announcement to all players, regardless of their place in the world. Could be especially useful for any kind of administration script.
| 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'''
<pre>
<pre>
- ANNOUNCE "<PLAYER> has found a secret!"
- SHOUT "EEEK! a spider!"
- SHOUT NOPLAYER "<PLAYER> is a thief! Get him!"
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|lavender|
{{Denizen Command Color 2|lavender|
HINT
WHISPER
|(SHORT)
|["The text to whisper."] (NPCID:#) (NOPLAYER)
| If called from an Interact Script Step with a Chat Trigger, this will output a list of all possible things the player can say to activate a chat trigger.
| 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]].
Modifiers:
*SHORT
::The Denizen will only say the list of trigger words, instead of the full sentence.
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- HINT
- WHISPER "The password is.. 42."
- HINT SHORT
- WHISPER NPCID:2 "Hey, I didn't want to blurt this out so everyone could hear, but..."
</pre>
</pre>
}}
}}
Line 328: Line 347:


{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
WALKTO
PAUSE
|[BOOKMARK:LocationBookmark or 'BOOKMARK:DenizenName:LocationBookmark' or PLAYER]  (SPEED:#)
|(DURATION:#)
|Makes the denizen walk to the specified location bookmark, or to the interacting player. Interrupts any current movement, and pauses the NPC pathing if active.
|Causes the Denizen to stop any pathing or activities. Useful for keeping it in place during an interaction.
Modifiers:
Modifiers:
* SPEED: is the movement speed, generally should be between 0.1 and 1.5
*DURATION:  
::Automatically RESUME after the specified number of seconds.
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- WALKTO PLAYER
- PAUSE
- WALKTO 'BOOKMARK:Gary:GarysHouse'
- PAUSE DURATION:30
</pre>
</pre>
}}
}}


{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
WALK
RESUME
|(FORWARD:#) (NORTH:#) (SOUTH:#) (EAST:#) (WEST:#) (UP:#) (DOWN:#) (X:#) (Y:#) (Z:#) (SPEED:#)
|
|Makes the denizen walk some distance from its current position.  Interrupts any current movement, and pauses the NPC pathing if active. All provided directions are added into one movement. Decimal and negative values are accepted.
|Cancels a previous PAUSE command.
Modifiers:
* SPEED: is the movement speed, generally should be between 0.1 and 1.5
* FORWARD: makes the Denizen walk in whatever direction it is currently facing. Combine LOOK CLOSE and a negative value to walk directly away from the player.
* +X is the same as EAST
* +Y is the same as UP
* +Z is the same as NORTH
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- WALK NORTH;4 EAST:2.5
- RESUME
- WALK FORWARD:1
</pre>
</pre>
}}
}}
Line 372: Line 385:


{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
PAUSE
WALK
|(DURATION:#)
|(FORWARD:#) (NORTH:#) (SOUTH:#) (EAST:#) (WEST:#) (UP:#) (DOWN:#) (X:#) (Y:#) (Z:#) (SPEED:#)
|Causes the Denizen to stop any pathing or activities. Useful for keeping it in place during an interaction.
|Makes the denizen walk some distance from its current position.  Interrupts any current movement, and pauses the NPC pathing if active. All provided directions are added into one movement. Decimal and negative values are accepted.  
Modifiers:
Modifiers:
*DURATION:  
* SPEED: is the movement speed, generally should be between 0.1 and 1.5
::Automatically RESUME after the specified number of seconds.
* FORWARD: makes the Denizen walk in whatever direction it is currently facing. Combine LOOK CLOSE and a negative value to walk directly away from the player.
* +X is the same as EAST
* +Y is the same as UP
* +Z is the same as NORTH
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- PAUSE
- WALK NORTH;4 EAST:2.5
- PAUSE DURATION:30
- WALK FORWARD:1
</pre>
</pre>
}}
}}


{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
RESUME
WALKTO
|
|[BOOKMARK:LocationBookmark or 'BOOKMARK:DenizenName:LocationBookmark' or PLAYER]  (SPEED:#)
|Cancels a previous PAUSE command.
|Makes the denizen walk to the specified location bookmark, or to the interacting player. Interrupts any current movement, and pauses the NPC pathing if active.
Modifiers:
* SPEED: is the movement speed, generally should be between 0.1 and 1.5
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- RESUME
- WALKTO PLAYER
- WALKTO 'BOOKMARK:Gary:GarysHouse'
</pre>
</pre>
}}
}}
Line 407: Line 426:
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|wheat|
{{Denizen Command Color 2|wheat|
SWITCH
LISTEN KILL
|[BOOKMARK:BlockBookmark] or [BOOKMARK:DenizenName:BlockBookmark] (DURATION:#)
|[TYPE:GROUP or TYPE:PLAYER or TYPE:ENTITY or TYPE:NPC] [NAME:Name or NPCID:#] (QTY:#) [SCRIPT:Task Script]
| This command will activate a button, switch or pressure plate at the designated '''block''' bookmark.
| 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.  
Modifiers:
Optional Modifiers:
*DURATION:#
*QTY: - The number things the player must kill before the script is run.
:: Will switch the device again after the specified number of seconds.
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- SWITCH BOOKMARK:LightSwitch DURATION:30
- LISTEN KILL TYPE:ENTITY NAME:ZOMBIE QTY:5 SCRIPT:ZombitReward
- SWITCH BOOKMARK:Jimbo:JimbosButton
- LISTEN KILL TYPE:NPC NPCID:12 'SCRIPT:Kill Boss Reward'
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|wheat|
{{Denizen Command Color 2|wheat|
SPAWN
SPAWN
Line 447: Line 467:
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|wheat|
 
WEATHER
| [SUNNY or STORMY or PRECIPITATING]
| Changes the Denizen's world's weather to the designated type.
'''Example Usages'''
<pre>
- WEATHER SUNNY
</pre>
}}
{{Denizen Command Color 2|wheat|
{{Denizen Command Color 2|wheat|
STRIKE
STRIKE
Line 476: Line 488:
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|wheat|
{{Denizen Command Color 2|wheat|
LISTEN KILL
SWITCH
|[TYPE:GROUP or TYPE:PLAYER or TYPE:ENTITY or TYPE:NPC] [NAME:Name or NPCID:#] (QTY:#) [SCRIPT:Task Script]
|[BOOKMARK:BlockBookmark] or [BOOKMARK:DenizenName:BlockBookmark] (DURATION:#)
| 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 will activate a button, switch or pressure plate at the designated '''block''' bookmark.
Optional Modifiers:
Modifiers:
*QTY: - The number things the player must kill before the script is run.
*DURATION:#
:: Will switch the device again after the specified number of seconds.
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- LISTEN KILL TYPE:ENTITY NAME:ZOMBIE QTY:5 SCRIPT:ZombitReward
- SWITCH BOOKMARK:LightSwitch DURATION:30
- LISTEN KILL TYPE:NPC NPCID:12 'SCRIPT:Kill Boss Reward'
- SWITCH BOOKMARK:Jimbo:JimbosButton
</pre>
</pre>
}}
}}


====Player Interaction====
{{Denizen Command Color 2|wheat|
These commands default to affecting the interacting player. Most have modifiers to affect the executing Denizen instead.
WEATHER
{{Denizen Command Color 2|palegreen|
| [SUNNY or STORMY or PRECIPITATING]  
GIVE
| Changes the Denizen's world's weather to the designated type.
|[MONEY or XP or HEROESEXP or MATERIAL:#] (QTY:#)
|
Gives something to the Player. If QTY: is not specified default is 1. You can also give Minecraft XP by using 'XP'.
Using HEROESEXP type will give the Player (or Hero) Questing Experience. Note: This requires HEROES to be installed on your server!
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- GIVE MONEY QTY:10
- WEATHER SUNNY
- GIVE 17:2 QTY:3
- GIVE LEAVES:2
- GIVE HEROESEXP QTY:25
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|palegreen|
TAKE
| [MONEY or ITEMINHAND or ID or ID:Data or MATERIAL:Data or MATERIAL] (QTY:#)
|
Takes something from the Player. If QTY: is not specified default is 1.


'''Example Usages'''
====Player Interaction====
<pre>
These commands default to affecting the interacting player. Most have modifiers to affect the executing Denizen instead.
- TAKE MONEY QTY:1000
- TAKE 17:2 QTY:1
- TAKE LOG:2
- TAKE ITEMINHAND
</pre>
}}


{{Denizen Command Color 2|palegreen|
{{Denizen Command Color 2|palegreen|
Line 539: Line 535:
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|palegreen|
FEED
|(AMOUNT:#)
|Feeds the interacting player. Provides food and saturation.
Modifiers:
AMOUNT: The amount to feed. Default is 20.
'''Example Usages'''
<pre>
- FEED
- FEED 5
</pre>
}}
{{Denizen Command Color 2|palegreen|
GIVE
|[MONEY or XP or HEROESEXP or MATERIAL:#] (QTY:#)
|
Gives something to the Player. If QTY: is not specified default is 1. You can also give Minecraft XP by using 'XP'.
Using HEROESEXP type will give the Player (or Hero) Questing Experience. Note: This requires HEROES to be installed on your server!
'''Example Usages'''
<pre>
- GIVE MONEY QTY:10
- GIVE 17:2 QTY:3
- GIVE LEAVES:2
- GIVE HEROESEXP QTY:25
</pre>
}}
{{Denizen Command Color 2|palegreen|
{{Denizen Command Color 2|palegreen|
TELEPORT
HARM
|(DENIZEN) [BOOKMARK:LocationBookmark or 'BOOKMARK:Denizen Name:LocationBookmark']
|(DENIZEN) (AMOUNT:#)
|Teleports the interacting to player or denizen to the specified bookmark.
|Hurts the the interacting player.
Modifiers:
Modifiers:
*DENIZEN
*DENIZEN
::Teleport the Denizen instead of the player.
::Hurts the Denizen instead of the player.
*AMOUNT:
::The amount to hurt, if not specified defaults to 1 point.
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- TELEPORT BOOKMARK:FarAwayPlace
- HARM AMOUNT:5
- TELEPORT DENIZEN 'BOOKMARK:Jim:JimsBasement'
- HARM DENIZEN
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|palegreen|
{{Denizen Command Color 2|palegreen|
HEAL
HEAL
Line 567: Line 595:
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|palegreen|
{{Denizen Command Color 2|palegreen|
FEED
TAKE
|(AMOUNT:#)
| [MONEY or ITEMINHAND or ID or ID:Data or MATERIAL:Data or MATERIAL] (QTY:#)
|Feeds the interacting player. Provides food and saturation.
|
Modifiers:
Takes something from the Player. If QTY: is not specified default is 1.
AMOUNT: The amount to feed. Default is 20.
 
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- FEED
- TAKE MONEY QTY:1000
- FEED 5
- TAKE 17:2 QTY:1
- TAKE LOG:2
- TAKE ITEMINHAND
</pre>
</pre>
}}
}}
{{Denizen Command Color 2|palegreen|
{{Denizen Command Color 2|palegreen|
HARM
TELEPORT
|(DENIZEN) (AMOUNT:#)
|(DENIZEN) [BOOKMARK:LocationBookmark or 'BOOKMARK:Denizen Name:LocationBookmark']
|Hurts the the interacting player.
|Teleports the interacting to player or denizen to the specified bookmark.
Modifiers:
Modifiers:
*DENIZEN
*DENIZEN
::Hurts the Denizen instead of the player.
::Teleport the Denizen instead of the player.
*AMOUNT:
::The amount to hurt, if not specified defaults to 1 point.
'''Example Usages'''
'''Example Usages'''
<pre>
<pre>
- HARM AMOUNT:5
- TELEPORT BOOKMARK:FarAwayPlace
- HARM DENIZEN
- TELEPORT DENIZEN 'BOOKMARK:Jim:JimsBasement'
</pre>
</pre>
}}
}}

Revision as of 14:16, 30 September 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 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 (" ")!!

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

Movement commands are meant to help bring your Denizen to life by allowing fine control of movement during scripts. These are not meant for making the Denizen do continuous movement, 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.