Denizen/0.7/Interact Scripts/Interact Requirements: Difference between revisions
< Denizen | 0.7 | Interact Scripts
Line 1: | Line 1: | ||
== 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 10: | ||
</div> | </div> | ||
===Player 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%;"> | ||
{{Denizen Requiremnt Type Color|ivory| | {{Denizen Requiremnt Type Color|ivory| | ||
Line 46: | Line 46: | ||
</div> | </div> | ||
===WORLD 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%;"> | ||
{{Denizen Requiremnt Type Color|aliceblue| | {{Denizen Requiremnt Type Color|aliceblue| | ||
Line 74: | Line 74: | ||
</div> | </div> | ||
===SCRIPT 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%;"> | ||
{{Denizen Requiremnt Type Color|mintcream| | {{Denizen Requiremnt Type Color|mintcream| | ||
Line 94: | Line 94: | ||
</div> | </div> | ||
===VAULT 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%;"> | ||
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. | ||
Line 112: | Line 112: | ||
</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: |
Revision as of 01:01, 3 September 2012
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 Requirements
[Player Name] (Player Name) (Player Name) ...
|
[ITEM_NAME or #:#] (Quantity)
|
[ITEM_NAME or #:#] (Quantity)
|
[ITEM_NAME or #:#]
|
[Full or Hungry or Starving]
|
[# or higher] OR LEVEL [At least this Level #] [No more than this Level #]
|
[POTION_TYPE]
|
[> or < or =] [# or %]
|
WORLD REQUIREMENTS
[World Name] (World Name) (World Name) ...
|
[Day or Night or Dusk or Dawn or TIME 0-23999]
|
[Block Bookmark]
|
SCRIPT REQUIREMENTS
(# of times) [Script Name]
|
(# of times) [Script Name]
|
[Name of Activity]
|
(FlagName:Value OR FlagName #)
|
VAULT REQUIREMENTS
These requirements only work if you have Vault installed and a compatible permissions/economy plugin.
[permission.node]
|
[Group Name] (Group Name) (Group Name) ...
|
[Quantity]
|
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.