Denizen/0.7/Interact Scripts/Interact Requirements: Difference between revisions
< Denizen | 0.7 | Interact Scripts
No edit summary |
|||
(15 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> | |||
== Requirements == | |||
<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%;"> | ||
Requirements set criteria for your scripts to check against. They provide a powerful way to have a variety of interaction possibilities with Denizen NPCs. Imagine NPCs that will offer you some fish when hungry, or a shopkeeper that can sell you goods. These are two of many things made possible with the use of Requirements. | Requirements set criteria for your scripts to check against. They provide a powerful way to have a variety of interaction possibilities with Denizen NPCs. Imagine NPCs that will offer you some fish when hungry, or a shopkeeper that can sell you goods. These are two of many things made possible with the use of Requirements. | ||
Line 10: | Line 31: | ||
</div> | </div> | ||
===Player=== | |||
<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%;"> | ||
{{Denizen | |||
[[Interact_Script_Requirements# | {{Denizen Requirement Type Color|ivory| | ||
| <nowiki>[ | [[Interact_Script_Requirements#Durability|DURABILITY]] | ||
| <nowiki>[> or < or =] [# or %]</nowiki> | |||
}} | }} | ||
{{Denizen Requirement Type Color|ivory| | |||
{{Denizen | |||
[[Interact_Script_Requirements#Holding|HOLDING]] | [[Interact_Script_Requirements#Holding|HOLDING]] | ||
| <nowiki>[ITEM_NAME or #:#] (Quantity)</nowiki> | | <nowiki>[ITEM_NAME or #:#] (Quantity)</nowiki> | ||
}} | }} | ||
{{Denizen Requirement Type Color|ivory| | |||
{{Denizen | |||
[[Interact_Script_Requirements#Hunger|HUNGER]] | [[Interact_Script_Requirements#Hunger|HUNGER]] | ||
| <nowiki>[Full or Hungry or Starving]</nowiki> | | <nowiki>[Full or Hungry or Starving]</nowiki> | ||
}} | }} | ||
{{Denizen | |||
[[Interact_Script_Requirements# | {{Denizen Requirement Type Color|ivory| | ||
[[Interact_Script_Requirements#Item|ITEM]] | |||
| <nowiki>[ITEM_NAME or #:#] (Quantity)</nowiki> | |||
}} | |||
{{Denizen Requirement Type Color|ivory| | |||
[[Interact_Script_Requirements#Level|LEVEL]] | |||
| <nowiki>[# or higher] OR LEVEL [At least this Level #] [No more than this Level #]</nowiki> | | <nowiki>[# or higher] OR LEVEL [At least this Level #] [No more than this Level #]</nowiki> | ||
}} | }} | ||
{{Denizen | |||
[[Interact_Script_Requirements# | {{Denizen Requirement Type Color|ivory| | ||
[[Interact_Script_Requirements#Name|NAME]] | |||
| <nowiki>[Player Name] (Player Name) (Player Name) ...</nowiki> | |||
}} | |||
{{Denizen Requirement Type Color|ivory| | |||
[[Interact_Script_Requirements#Owner|OWNER]] | |||
| | |||
}} | |||
{{Denizen Requirement Type Color|ivory| | |||
[[Interact_Script_Requirements#Potioneffect|POTIONEFFECT]] | |||
| <nowiki>[POTION_TYPE]</nowiki> | | <nowiki>[POTION_TYPE]</nowiki> | ||
}} | }} | ||
{{Denizen | |||
[[Interact_Script_Requirements#Wearing| | {{Denizen Requirement Type Color|ivory| | ||
| <nowiki>[ | [[Interact_Script_Requirements#Sneaking|SNEAKING]] | ||
| | |||
}} | |||
{{Denizen Requirement Type Color|ivory| | |||
[[Interact_Script_Requirements#Wearing|WEARING]] | |||
| <nowiki>[ITEM_NAME or #:#]</nowiki> | |||
}} | }} | ||
</div> | </div> | ||
===World=== | |||
<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%;"> | ||
{{Denizen | {{Denizen Requirement Type Color|aliceblue| | ||
[[Interact_Script_Requirements# | [[Interact_Script_Requirements#Isliquid|ISLIQUID]] | ||
| <nowiki>[ | | <nowiki>[BOOKMARK:Block Bookmark]</nowiki> | ||
}} | |||
{{Denizen Requirement Type Color|aliceblue| | |||
[[Interact_Script_Requirements#Ispowered|ISPOWERED]] | |||
| <nowiki>[BOOKMARK:Block Bookmark]</nowiki> | |||
}} | }} | ||
{{Denizen | |||
[[Interact_Script_Requirements# | {{Denizen Requirement Type Color|aliceblue| | ||
| | [[Interact_Script_Requirements#Precipitating|PRECIPITATING]] | ||
| | |||
}} | }} | ||
{{Denizen | |||
[[Interact_Script_Requirements# | {{Denizen Requirement Type Color|aliceblue| | ||
| | [[Interact_Script_Requirements#Stormy|STORMY]] | ||
| | |||
}} | }} | ||
{{Denizen | |||
{{Denizen Requirement Type Color|aliceblue| | |||
[[Interact_Script_Requirements#Sunny|SUNNY]] | [[Interact_Script_Requirements#Sunny|SUNNY]] | ||
| | | | ||
}} | }} | ||
{{Denizen | |||
[[Interact_Script_Requirements# | {{Denizen Requirement Type Color|aliceblue| | ||
| | [[Interact_Script_Requirements#Time|TIME]] | ||
| <nowiki>[Day or Night or Dusk or Dawn or TIME 0-23999] </nowiki> | |||
}} | }} | ||
{{Denizen | |||
[[Interact_Script_Requirements# | {{Denizen Requirement Type Color|aliceblue| | ||
| | [[Interact_Script_Requirements#World|WORLD]] | ||
| <nowiki>[World Name] (World Name) (World Name) ...</nowiki> | |||
}} | }} | ||
</div> | </div> | ||
===Script=== | |||
<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%;"> | ||
{{Denizen | {{Denizen Requirement Type Color|mintcream| | ||
[[Interact_Script_Requirements# | [[Interact_Script_Requirements#Activity|ACTIVITY]] | ||
| | | [Name of Activity] | ||
}} | }} | ||
{{Denizen | |||
{{Denizen Requirement Type Color|mintcream| | |||
[[Interact_Script_Requirements#Failed|FAILED]] | [[Interact_Script_Requirements#Failed|FAILED]] | ||
| <nowiki>(# of times) [Script Name]</nowiki> | | <nowiki>(# of times) [Script Name]</nowiki> | ||
}} | }} | ||
{{Denizen | |||
[[Interact_Script_Requirements# | {{Denizen Requirement Type Color|mintcream| | ||
| [Name | [[Interact_Script_Requirements#Finished|FINISHED]] | ||
| <nowiki>(# of times) [Script Name]</nowiki> | |||
}} | }} | ||
{{Denizen | |||
[[Interact_Script_Requirements# | {{Denizen Requirement Type Color|mintcream| | ||
| | [[Interact_Script_Requirements#Flagged|FLAGGED]] | ||
| [FlagName:FlagValue or FlagName] (EXACTLY) (PLAYER or DENIZEN or GLOBAL) | |||
}} | |||
{{Denizen Requirement Type Color|mintcream| | |||
[[Interact_Script_Requirements#Script|SCRIPT]] | |||
| [FINISHED or FAILED or STEP] (STEP:#) (QTY:#) (EXACTLY) [SCRIPT:scriptname] | |||
}} | }} | ||
</div> | </div> | ||
===Permission/Economy=== | |||
<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%;"> | ||
These requirements only work if you have Vault installed and a compatible permissions/economy plugin. | These requirements only work if you have Vault installed and a compatible permissions/economy plugin. | ||
{{Denizen | {{Denizen Requirement Type Color|whitesmoke| | ||
[[Interact_Script_Requirements# | [[Interact_Script_Requirements#Group|GROUP]] | ||
| <nowiki>[Group Name] (Group Name) (Group Name) ...</nowiki> | | <nowiki>[Group Name] (Group Name) (Group Name) ...</nowiki> | ||
}} | }} | ||
{{Denizen | |||
{{Denizen Requirement Type Color|whitesmoke| | |||
[[Interact_Script_Requirements#Money|MONEY]] | [[Interact_Script_Requirements#Money|MONEY]] | ||
| [Quantity] | | [Quantity] | ||
}} | |||
{{Denizen Requirement Type Color|whitesmoke| | |||
[[Interact_Script_Requirements#Permission|PERMISSION]] | |||
| [permission.node] | |||
}} | }} | ||
</div> | </div> | ||
===Negative Requirements === | |||
<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%;"> | ||
Requirements can also be 'negative' requirements. In the Requirements List, just place a '-' in front of the requirement to inverse its logic. For example, 'HOLDING IRON_SWORD' would require the player to be holding an Iron Sword. '-HOLDING IRON_SWORD' would require the player to NOT be holding an Iron Sword. All requirements have a negative alternative, even ones whose function may overlap, such as '-WEATHER Precipitating' and 'WEATHER Sunny', which technically do the same thing. If anything, it can add to script readability. The negative requirement '-' should not be confused with the 'list item -' with a trailing space in front of each Requirement in the List, as that is standard YAML list format. See below: | Requirements can also be 'negative' requirements. In the Requirements List, just place a '-' in front of the requirement to inverse its logic. For example, 'HOLDING IRON_SWORD' would require the player to be holding an Iron Sword. '-HOLDING IRON_SWORD' would require the player to NOT be holding an Iron Sword. All requirements have a negative alternative, even ones whose function may overlap, such as '-WEATHER Precipitating' and 'WEATHER Sunny', which technically do the same thing. If anything, it can add to script readability. The negative requirement '-' should not be confused with the 'list item -' with a trailing space in front of each Requirement in the List, as that is standard YAML list format. See below: | ||
Line 127: | Line 186: | ||
Negative requirements can completely change the original example around. In this 'revised' example, for this script to trigger, time needs to be day, the weather in the current world must NOT be storming, and the player have less than 1000000 units of currency on them. | Negative requirements can completely change the original example around. In this 'revised' example, for this script to trigger, time needs to be day, the weather in the current world must NOT be storming, and the player have less than 1000000 units of currency on them. | ||
</div> | </div> | ||
[[Category:Denizen 0.7]] |
Latest revision as of 18:56, 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!
Requirements
Requirements set criteria for your scripts to check against. They provide a powerful way to have a variety of interaction possibilities with Denizen NPCs. Imagine NPCs that will offer you some fish when hungry, or a shopkeeper that can sell you goods. These are two of many things made possible with the use of Requirements.
Note: Requirements from 0.6 are in-tact for 0.7, but will now be referred to as 'Legacy Requirements'. They will be slowly replaced with new commands that will override functionality. The new systems allows for improved tolerence better debugging, as well as make it easy for other plugin programmers to extend Denizen. Just a heads up. This page will keep you informed of any changes.
[] indicates required field, () indicates an optional field, | indicates alternative usage.
Click on any requirement to get more information and example usages.
Player
[> or < or =] [# or %]
|
[ITEM_NAME or #:#] (Quantity)
|
[Full or Hungry or Starving]
|
[ITEM_NAME or #:#] (Quantity)
|
[# or higher] OR LEVEL [At least this Level #] [No more than this Level #]
|
[Player Name] (Player Name) (Player Name) ...
|
[POTION_TYPE]
|
[ITEM_NAME or #:#]
|
World
[BOOKMARK:Block Bookmark]
|
[BOOKMARK:Block Bookmark]
|
[Day or Night or Dusk or Dawn or TIME 0-23999]
|
[World Name] (World Name) (World Name) ...
|
Script
[Name of Activity]
|
(# of times) [Script Name]
|
(# of times) [Script Name]
|
[FlagName:FlagValue or FlagName] (EXACTLY) (PLAYER or DENIZEN or GLOBAL)
|
[FINISHED or FAILED or STEP] (STEP:#) (QTY:#) (EXACTLY) [SCRIPT:scriptname]
|
Permission/Economy
These requirements only work if you have Vault installed and a compatible permissions/economy plugin.
[Group Name] (Group Name) (Group Name) ...
|
[Quantity]
|
[permission.node]
|
Negative Requirements
Requirements can also be 'negative' requirements. In the Requirements List, just place a '-' in front of the requirement to inverse its logic. For example, 'HOLDING IRON_SWORD' would require the player to be holding an Iron Sword. '-HOLDING IRON_SWORD' would require the player to NOT be holding an Iron Sword. All requirements have a negative alternative, even ones whose function may overlap, such as '-WEATHER Precipitating' and 'WEATHER Sunny', which technically do the same thing. If anything, it can add to script readability. The negative requirement '-' should not be confused with the 'list item -' with a trailing space in front of each Requirement in the List, as that is standard YAML list format. See below:
Requirements:
Mode: All
List:
- -TIME Night
- -MONEY 1000000
- -STORMY
Negative requirements can completely change the original example around. In this 'revised' example, for this script to trigger, time needs to be day, the weather in the current world must NOT be storming, and the player have less than 1000000 units of currency on them.