Example mod · theonaris.examples.planet-system 1.0.0
Planet System
A custom star system: the planet Ember with a heightmap, painted ground that says what it is made of, a sea, clouds and stormy weather, and its airless moon Cinder added from a script. Shows the map file's "system" section, planets.define and the planets queries.
Download Planet System (953 KB)
Install: put the .zip (or the unpacked folder) in your mods folder: in the game, Mods → Open folder. Then start the game and allow the permissions.
A map that brings its own star system instead of building on one of the game's worlds.
content/maps/twin-worlds.json— the map, with a"system"section: the sun, a weather preset ("stormy"with two fields changed) and the planet Ember: radius, absolute position, gravity, air, a sea, a heightmap (textures/ember-height.png, any grey PNG — the game converts it to the 16-bit format the terrain needs), two painted ground layers that each say which ground they are ("ground": "grass"/"rock"— texture names are never guessed), and clouds with their own coverage picture.scripts/shared.lua— adds the moon Cinder withplanets.definewhile the scripts load. It is a shared script so the server and every player add the same moon.scripts/server.lua— printsplanets.list()and the air at the spawn when the map starts (maps.onEnter), and definesclearSkies()for the host to call (planets.trySetWeather("clear")).
Try it
- Install the mod and start the game. Twin Worlds appears on the map selection screen.
- Pick it and play. You start 900 m above Ember, with its airless moon Cinder in the sky. The mod's log lists both planets and the air at the spawn.
- To calm the storms for everyone, the host runs
clearSkies(): in the script editor's Console on this mod's Server copy, or as/lua theonaris.examples.planet-system clearSkies()in the developer console.
The pictures were generated for this example. Replace them with your own PNGs of the same names.
See Planets for every field.
All files
| File | Size |
|---|---|
content/maps/twin-worlds.json | 2 KB |
mod.json | 769 B |
preview.png | 6 KB |
README.md | 2 KB |
scripts/server.lua | 863 B |
scripts/shared.lua | 961 B |
textures/cinder-ash.png | 106 KB |
textures/ember-clouds.png | 189 KB |
textures/ember-grass.png | 203 KB |
textures/ember-height.png | 211 KB |
textures/ember-rock.png | 235 KB |