Skip to content

Initializing a Module

vampcat edited this page Nov 26, 2018 · 3 revisions

Modules

All the content in Destination Sol is provided in the form of "Modules". This allows content creators to easily add content to the game, without messing around with the engine itself. Modules can be created by anyone and don't have to be checked by anyone to run in your local game. The official modules are kept in here. Each module contains a faction, which is a group of assets (ships, items, guns), that are related in the game. Usually a module defines a few ships, guns, projectiles, etc, that are aesthetically or thematically cohesive.

Locally, modules in Destination Sol are situated under the /modules/ directory. To add your own module, simply navigate to the root of your Destination Sol workspace, open a command line there. Run ./groovyw module create <moduleName>, where <moduleName> is the name of your new module. Note that you might need to change the remote of your new module, because the default remote, origin, points to https://github.com/DestinationSol/<moduleName>. You can do this by creating a new repo under your own account, and then using git remote add origin https://github.com/<userName>/<moduleName>.

Module JSON

The module.json in the root of your module file contains basic information about the module, like the following required fields:

  • id: a unique string that will be used as the namespace for the module. Note: This must be the same as the name of the directory your module is in
  • version: The current version of your module. Feel free to update this as you feel your module evolves
  • displayName: a user-friendly version of the id, used to represent your module in-game.
  • description: a user-friendly concise description of the contents of the module
  • dependencies: Any module yours uses for assets. Most modules depend on core for some sound assets. Note: Dependencies will be fetched from the official module repositories when invoking ./groovyw module recurse <module>

For this tutorial, we'll use the mechanical module as reference. This is what the module.json file for mechanical looks like:

{
    "id" : "mechanical",
    "version" : "0.0.1",
    "displayName" : "Mechanical Faction",
    "description" : "Ships and other content to enable the mechanical faction in-game.",
    "dependencies" :  [
        {
            "id" : "core"
        },
        {
            "id" : "deepspace"
        },
        {
            "id" : "tribe"
        }
    ]
}

To actually add content to the module you just created, head over to the Adding content to Modules page.