Denizen/0.7/Before Using Denizen: Difference between revisions

From Citizens Wiki

< Denizen‎ | 0.7

No edit summary
Line 43: Line 43:
</div>
</div>


==== saves.yml ====
===={{color|red|white|saves.yml}}====
<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%;">
This file is not meant to be edited by hand, Denizen will create and populate this file automatically as needed. It stores important information such as player progression, flags, Denizen location and block bookmarks, active activity script progression and more. If you absolutely need to make changes by hand, it's best to stop the server, edit, and then restart your server, as this file is constantly being written to by Denizen which will overwrite any changes you make.
This file is not meant to be edited by hand, Denizen will create and populate this file automatically as needed. It stores important information such as player progression, flags, Denizen location and block bookmarks, active activity script progression and more. If you absolutely need to make changes by hand, it's best to stop the server, edit, and then restart your server, as this file is constantly being written to by Denizen which will overwrite any changes you make.
Line 50: Line 50:
</div>
</div>


==== read-only-scripts.yml ====
===={{color|red|white|read-only-scripts.yml}}====
<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%;">
This is another files that Denizen creates and should not be edited by hand. This is a combination of the files contained in the scripts folder that Denizen reads from.
This is another files that Denizen creates and should not be edited by hand. This is a combination of the files contained in the scripts folder that Denizen reads from.

Revision as of 07:49, 21 August 2012

Welcome to Denizen! Grand adventure awaits, but let's get the basics out of the way first. On this page you will find instructions for installing Denizen, description of what the various files are used for, and a brief overview of what this is all about.

Getting started with Denizen

Denizen is in BETA! Expect a few bugs here and there! If you are having problems, /denizen debug is your friend! We're always willing to help out in #denizen-dev on EsperNET as well. If you do come across any errors beyond bad command syntax, please report them to the Github Issues page for Denizens.

Denizen is not a drag-and-go type of plugin. In fact, Denizen won't do anything unless you assign and define scripts to NPCs. It's highly customizable. In order to write awesome scripts, you will need to read the entirety of this wiki page and think outside the box! I'm always around IRC to help out and provide suggestions, but please don't ask about the basics unless you have consulted here first.

Some Denizen commands and requirements REQUIRE you to have Vault installed with a compatible Permissions System and and Economy System. If the commands deals with money or permissions, chances are you will need Vault in order to utilize it.

The easiest way to use Denizen for the first time is to download the Start-up Kit with sample .yml configuration files and scripts. This includes the default config file, sample scripts, and sample assignments to get you started.

Denizen relies on a few files to run properly, so let's first go over the file structure.

File Structure

Denizen File Structure

Denizen requires the use of a few different YML files to operate properly. This includes a config.yml, assignments.yml, scripts, and saves.yml.

denizen.jar

I've gotten a few questions about where to place the Denizen JAR file. It should be treated like any other bukkit plugin and be placed in your craftbukkit/plugins/ folder. Please note that while a lot of plugins will automatically generate a folder to go along with it, Denizen does not, and this should be either created by hand and populated, or generated by copying the Start-up Kit with sample .yml configuration files and scripts.

config.yml

The Denizen config.yml contains nodes to alter the stock behavior and look of Denizen. You'll notice that Denizen does not create its own config.yml. Why is this? Denizen stores its entire config inside memory, so it's not necessary to have a copy inside the Denizen folder unless you need to change the defaults. You can use the config.yml to override those defaults. Not having Denizen write to the config.yml itself (as well as scripts files) ensures that upon a /denizen reload, the config.yml, between a save and reload, is never changed when you don't want it to. This also keeps code comments inside the YML files stay intact, exactly the way you left them from last edit allowing you to leave yourself and others detailed notes and ideas.

This file can be reloaded from disk to Denizen memory at any time by using /denizen reload. Some changes in the config.yml may require a restart of the server. This includes interact_delay_in_ticks, but is not limited to that config node.

See: Denizen/config.yml for a stock copy and explanation of all available options.

assignments.yml

This YML is where you can define all the options and information for your Denizen NPCs. This will be explained further along in this document, but the most common information in this file is [Interact Script Assignments], [Activity Script Schedule], and [Custom Interact Texts].

This file can be reloaded from disk into Denizen memory at any time by using /denizen reload

See: #A basic assignment for information on how to get started with assignments.

saves.yml

This file is not meant to be edited by hand, Denizen will create and populate this file automatically as needed. It stores important information such as player progression, flags, Denizen location and block bookmarks, active activity script progression and more. If you absolutely need to make changes by hand, it's best to stop the server, edit, and then restart your server, as this file is constantly being written to by Denizen which will overwrite any changes you make.

To reiterate: This file saves periodically, and automatically, upon progression and a server stop, and should only be edited by hand when the server is off or Denizen is disabled.

read-only-scripts.yml

This is another files that Denizen creates and should not be edited by hand. This is a combination of the files contained in the scripts folder that Denizen reads from.

This file is populated on a server restart, or by using the /denizen reload command.

/scripts/ folder

This folder is where Denizen will read all the script information from. Upon a server load or /denizen reload, the files are combined and put into the read-only-scripts.yml for the Denizen to read from. This allows better organization of scripts to be maintained, since the amount of scripts can easily get into the triple digits.

The files in the plugins/Denizen/scripts/ folder can be named whatever you please, as long as they end in .yml. Be sure not to duplicate script names from file to file as this will cause problems. All scripts in the scripts folder are merged into read-only-scripts.yml, so there will be an issue if two scripts are named the same.

See: A basic Interact Script for information on how to get started with scripts.

How it works

Denizen is an extension of Citizens 2.0 that adds an incredible amount of interactivity and automation. In Denizen, scripts are assigned to Citizens NPCs that make them do things. These NPCs must have been given the Denizen Trait to function, see Denizen/In_Game_Commands. Scripts are assigned in the assignments.yml file mentioned above. The scripts themselves can be placed in any file in the /scripts/ folder.

There are 2 major types of script:

  • Interact Scripts - these scripts run commands when a player interacts with a Denizen in some way. Different commands can be run based on player and world conditions.
  • Activity Scripts - these scripts give the Denizen continuous jobs or activities to make them feel more alive.

It is highly suggested you start with the Start-up Kit. This contains some scripts and a pre-configured assignments.yml. Place the provided files in the locations mentioned above, and start up your server.

  • The first thing to do is make a NPC by using the /npc commands.
  • Name your NPC something that matches an assignment in the assignments.yml.
  • Next assign the 'denizen' trait using the /trait command.
  • The Denizen is now set to run its scripts!

If any interact script you are using has a 'proximity', 'location', or 'damage trigger', these must be turned on. They are off by default for performance reasons. See Denizen/In_Game_Commands for more info.