Denizen Script Language Explanations

Language Explanations explain components of Denizen in a more direct and technical way than The Beginner's Guide.

Showing 1 out of 77 language explanations...
NameAssignment Script Containers
DescriptionAssignment script-containers provide functionality to NPCs by 'assignment' of the container. Assignment
scripts are meant to be used when customizing the normal behavior of NPCs. This can be used on a 'per-NPC' basis,
but the encouraged approach is to design assignment scripts in a way that they can be used for multiple NPCs,
perhaps with the use of constants or flags to determine specific information required by the scripts.

Features unique to assignment script-containers include 'actions' and 'interact script' assignment.
Like any script, the ability to run local utility scripts can be accomplished as well. This allows fully
interactive NPCs to be built purely with Assignment Scripts, and for advanced situations, world scripts and
interact scripts can provide more functionality.
See also Language:interact script containers

Assignments scripts can be automatically disabled by adding "enabled: false" as a root key (supports any load-time-parseable tags).
This will disable any "actions" on the script (but not interact scripts steps - disable the interact for that).

Basic structure of an assignment script:


    type: assignment

    # | All assignment scripts MUST have this key!
        on <action>:
        - ...

    # | Most assignment scripts should exclude this key, but it's available.
    default constants:
        <constant_name>: <value>
        - ...

    # | MOST assignment scripts should have this key!
    interact scripts:
    - <interact_script_name>

Though note that almost always you should include the 'actions:' key, usually with the 'on assignment:' action (if using triggers).
Refer to Action:assignment.
GroupScript Container System