Skip to content
Arthur Casals edited this page Aug 20, 2019 · 3 revisions

This page details the process of creating a new module with creatures, behaviors, and groups. It is highly adviseable that you understand how Terasology's behavior system works - it is explained here.

Context

We are going to show how to create a module from scratch, using existing creatures and creating new behaviors for them. In order to avoid clutterness we will use existing code as much as possible - be sure to follow the links as they appear.

Our objective is to create a group of creatures with the same behavior. We will use a variant of deers from the WildAnimals module for that. We also want that

For this case study:

  • We will use existing creatures from the WildAnimals module
  • We assume that you already prepared your development workspace, as described here
  • We are creating a new module in this tutorial, but you can also use an existing module as a basis.
  • Our module depend on other existing modules. If you don't know how to include other modules as dependencies of a new one, please check this page.

Getting started

We will create a new module called TutorialGroups and add Behaviors and WildAnimals as dependencies. Your module.txt file should look like this:

{
    "id" : "TutorialGroups",
    "version" : "0.1.0-SNAPSHOT",
    "author" : "casals",
    "displayName" : "TutorialGroups",
    "description" : "Tutorial module for the wiki case study",
    "dependencies" : [
            {"id" : "Behaviors", "minVersion" : "0.2.0-SNAPSHOT"},
            { "id": "WildAnimals", "minVersion": "0.2.0" }
        ],
    "serverSideOnly" : false
}