Denizen/0.7/Example Scripts/Beginner Scripts: Difference between revisions

From Citizens Wiki

< Denizen‎ | 0.7

No edit summary
No edit summary
Line 5: Line 5:
<span style="font-family:natalya-alternate-one; font-size:650%; margin-right:-7px; margin-left:-10px;">S</span>ometimes the best way to learn is by looking at some examples. The following beginner scripts use basic denizen commands and requirements to provide some nice basic functionality for your Denizens.
<span style="font-family:natalya-alternate-one; font-size:650%; margin-right:-7px; margin-left:-10px;">S</span>ometimes the best way to learn is by looking at some examples. The following beginner scripts use basic denizen commands and requirements to provide some nice basic functionality for your Denizens.


Example scripts are provided with both the assignments and the scripts in the same box. Be sure and put the text in the correct file in your plugins folder.
<div style="padding:20px; font-family:camingodos-web; font-size:110%; background-color:#EEDDEE; border-style:dotted; border-width:1px; width:55%; font-weight:500;">Example scripts are provided with both the assignments and the scripts in the same box. Be sure and put the text in the correct file in your plugins folder.
* Assignments should always be appended to plugins\Denizen\assignments.yml
* Assignments should always be appended to plugins\Denizen\assignments.yml
* Scripts can be placed in any .yml file in the plugins\Denizen\scripts\ directory. Remember: You can have multiple scripts per file!
* Scripts can be placed in any .yml file in the plugins\Denizen\scripts\ directory. Remember: You can have multiple scripts per file!
</div>
</div>
</div>


===A small random conversation===
<div style="margin-right:2.0em; padding:10px; font-family:camingodos-web; font-size:110%;">





Revision as of 21:48, 16 September 2012

Sometimes the best way to learn is by looking at some examples. The following beginner scripts use basic denizen commands and requirements to provide some nice basic functionality for your Denizens.

Example scripts are provided with both the assignments and the scripts in the same box. Be sure and put the text in the correct file in your plugins folder.
  • Assignments should always be appended to plugins\Denizen\assignments.yml
  • Scripts can be placed in any .yml file in the plugins\Denizen\scripts\ directory. Remember: You can have multiple scripts per file!


A small random conversation


Joe the Builder

This is the script from the start-up kit. It's 2 interact scripts assigned to 1 Denizen named Steve. He will respond different to a right-click by a player depending on whether or not the player has the modifyworld.* permission.

Basic Repeatable Fetch Quest

Here is the fastest way to do a repeatable 'fetch' quest. Useful for custom crafting-type NPCs. Once the player agrees to help, he can turn in the items as often as he wants to receive the reward.

Basic Unrepeatable Fetch Quest

By adding 3 lines to the script above, it becomes un-repeatable.

The Race

Coach wants you to RUN, BOY! This script uses a TASK script and a Location trigger to make a timed race for the player. Good example of ZAP and RUNTASK/CANCELTASK command usage. Be sure and define a Location Bookmark called 'theTree' using the /denizen bookmark location command.