Skip to main content
Version: latest - a1.37.x βš–οΈ

Packages Guide

Packages are pieces/components of your server which will execute Lua scripts to interact to the game.

Folder Structure​

All Packages must go under Server/Packages/ folder. Each Package is a folder under that.

They can contain the following folders: Server, Client and Shared. Only Client and Shared folders will be sent and loaded by the clients when they connect.

Each Package must have a file called Index.lua inside Server, Client or Shared folders, this is the only file which will be triggered when the Package is loaded, this way this file is responsible for including other files and starting up your functionalities.

Server Folder
NanosWorldServer.exe
Packages/
β”œβ”€β”€ my-package-01/
β”‚ β”œβ”€β”€ Server/
β”‚ β”‚ β”œβ”€β”€ Index.lua
β”‚ β”‚ └── *.lua
β”‚ β”œβ”€β”€ Client/
β”‚ β”‚ └── *.lua
β”‚ β”œβ”€β”€ Shared/
β”‚ β”‚ └── *.lua
β”‚ └── Package.toml
β”œβ”€β”€ my-package-02/
β”‚ β”œβ”€β”€ Package.toml
β”‚ └── ...
Assets/
Config.toml

Package Configuration​

Packages have a configuration file in the root of the package folder, called Package.toml, in this file we can setup all pertinent settings related to the Package. Each Package Type has it's own configuration file format.

They all share the same header [meta], which contains the following settings:

_meta.toml
loading...
SettingDescription
titleFriendly name
authorContributor(s)
versionVersion - in the SemVer format X.Y.Z

Package Types​

We have 3 types of packages: script, game-mode and loading-screen, each one with with a specific functionality and an unique purpose:

script​

Script is a normal Package, you can load as many as you want.

Package.toml
loading...

game-mode​

GameModes are Like script but you can only load one game-mode package at once.

They are used when you are creating full games which cannot be loaded with other full games packages.

Package.toml
loading...

loading-screen​

Loading Screen is a special Package which will be loaded during player's loading screen.

It must have an index.html in the root. Please refer to Loading Screen for more information.

Package.toml
loading...

Settings Detailed​

SettingPackageΒ TypesDescription
force_no_map_packagescript
game-mode
Enabling this will force the map package (if any) to do NOT load
auto_cleanupscript
game-mode
Enabling this will destroy all entities spawned by this Package when it unloads
compatibility_versionscript
game-mode
The game version (major.minor) at the time this package was created, for granting backwards compatibility between breaking changes. See more here
packages_requirementsscript
game-mode
List of Packages dependencies used by this Package which need to be loaded first
assets_requirementsscript
game-mode
List of Asset Packs to be loaded when this package loads
compatible_mapsgame-modeList of Maps compatible/recommended to work with this Game Mode
custom_settingsgame-modeList of Custom Settings which can be set when starting a new game or passed through command line to the server. See more here

Custom Settings​

GameModes can define Custom Settings in the [custom_settings] section to be set when creating a new game through main menu, or set when starting the server with the command --custom_settings "var1 = value1, var2 = value2, ..."

The values defined can be accessed through the method Server.GetCustomSettings().

List of Types​

TypeDescription
booleanA toggleable checkbox
integerInteger numeric values
floatingFloating numeric values
selectList of string values displayed as a Dropdown
textText Box

Ignoring Client Folders​

Sometimes you want to ignore some folders from being sent to the clients (e.g. auto generated folders from Node.js HTML ones).

So, to make the server ignore it you just need to add an .ignore file in the root of that folder. Simple as that πŸ˜‰.

Logo Image​

It is possible to have a custom image to be displayed in the Vault. For that, add a file called Package.jpg besides the Package.toml with the image you wish. The recommended size is 300x150.