Paketleitfaden
Pakete sind Teile/Komponenten deines Servers, die beispielsweise Lua-Skripte ausführen, um mit dem Spiel zu interagieren.
Ordnerstruktur
All Packages must go under Server/Packages/
folder. Each Package is a folder under that.
Ein Paket muss dabei folgende Ordner enthalten: Server
, Client
und Shared
. Nur Client und Shared Ordner werden an die Clients gesendet und geladen, sobald diese sich mit dem Server verbinden.
Jedes Package (Paket) muss eine Datei namens Index.lua
besitzen. Dabei sollte die Datei in den Ordnern Server, Client oder Shared hinterlegt werden. Dies ist die einzige Datei, welche ausgelöst wird, sobald das Paket geladen wird. Auf dieser Weise ist diese Datei verantwortlich für die Aufnahme anderer Dateien und das Starten der Funktionalitäten.
NanosWorldServer.exe
Packages/
├── my-package-01/
│ ├── Server/
│ │ ├── Index.lua
│ │ └── *.lua
│ ├── Client/
│ │ └── *.lua
│ ├── Shared/
│ │ └── *.lua
│ └── Package.toml
├── my-package-02/
│ ├── Package.toml
│ └── ...
Assets/
Config.toml
Paketkonfiguration
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:
loading...
Einstellung | Beschreibung |
---|---|
title | Friendly name |
autor | Contributor(s) |
version | Version - in the SemVer format X.Y.Z |
Paketarten
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.
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.
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.
loading...
Einstellungen detailliert
Einstellung | Package Types | Beschreibung |
---|---|---|
force_no_map_package | script game-mode | Enabling this will force the map package (if any) to do NOT load |
auto_cleanup | script game-mode | Aktivieren wird alle Entitäten dieses Pakets zerstören, wenn es entlädt |
compatibility_version | script 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_requirements | script game-mode | List of Packages dependencies used by this Package which need to be loaded first |
assets_requirements | script game-mode | Liste der zu ladenden Asset-Pakete beim Laden dieses Pakets |
compatible_maps | game-mode | List of Maps compatible/recommended to work with this Game Mode |
custom_settings | game-mode | List 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
Type | Beschreibung |
---|---|
boolean | A toggleable checkbox |
integer | Integer numeric values |
floating | Floating numeric values |
text | Text 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
.