C.1 Moons
Updated a day agoCode Setup
- TBD
Editor Setup
DISCLAIMER
This page assumes you have already set up Unity and completed the following two pages:If you have not completed those steps, please do so before continuing.
Creating Your Moon Definition
-
In your Unity Project window, create a new folder for your moon.
- Example:
PathToContentContainer/Content/MyMoon.
- Example:
-
Inside that folder, create another folder named Registry.
- Example:
PathToContentContainer/Content/MyMoon/Registry.
- Example:
-
Inside the Registry folder, right-click and select:
Create → DawnLib → Definitions → Dusk Moon Definition. -
Make sure you have the following ready before proceeding:
- A SelectableLevel ScriptableObject with all necessary vanilla blank references configured.
- A valid Unity Scene properly set up for your moon.
Configuring the DuskMoonDefinition
Once you’ve created the DuskMoonDefinition, you’ll see several fields that need to be filled in.
Required Fields
| Field | Description |
|---|---|
| Config Entries | Place you can create various Config Entries in. |
| Namespace | A unique identifier prefix for your mod or content. Example: code_rebirth. |
| Key | Becomes autofilled in by reading the planet name in your SelectableLevel |
| SelectableLevel | Assign your existing SelectableLevel ScriptableObject here. |
| Pricing Strategy (optional) | Defines custom pricing logic for your moon that supercedes the cost field. |
| Terminal Predicate (optional) | Allows conditional logic for when the moon should appear in the terminal. |
| Cost | Cost of the moon, overriden by Pricing Strategy if created. |
| GenerateCostConfig | Generate a config for users to edit the cost |
| GenerateDisablePredicateConfig | Generates a config for users to get rid of the Terminal Predicate |
| GenerateDisablePricingStrategyConfig | Generates a config for users to get rid of the pricing strategy and rely purely on cost |
Setting Up Scene Data
The SceneDatas list determines which scenes are linked to this moon.
You must add at least one entry to this list.
For each SceneData entry:
- Drag your scene asset into the Scene Reference field.
- Set a Namespace for that scene (Key is auto-filled in).
- Example:
code_rebirth.
- Example:
- Configure the following optional parameters if needed:
- Landing Override – Custom scene used when the player lands.
- Leaving Override – Custom scene used when leaving the moon.
- Base Weight – Controls how often the scene appears relative to others.
- Weather Weights – Adjusts scene selection based on weather conditions (e.g., eclipsed, rainy, stormy).
Organizing and Bundling
After your scenes and definitions are configured:
-
Put your Scene asset into its own AssetBundle.
- Example:
oxydescene1.
- Example:
-
Put your DuskMoonDefinition (and any related assets) into a separate AssetBundle.
- Example:
oxydemoondefinition.
- Example:
-
Add both AssetBundles to the list of AssetBundles in your ContentContainer
(created during the Unity Setup stage).
Once that’s done, your content is registered!
Final Notes
Remember:
You can always contact @xuxiaolan on Discord for support, either through the Lethal Modding server or via direct messages, if you run into issues or have questions.
Pages
- A. Unity Setup
- B.1 Registering Content via Code
- B.2 Registering via Unity Editor
- C.1 Moons
- C.2 Interiors
- C.3 Weathers
- C.4 Enemies
- C.5 Inside/Outside Hazards
- C.6 Ship Upgrades/Decors
- C.7 Items
- C.8 Additional TileSets
- D.1 Achievements
- D.2 Vehicles
- D.3 Entity Replacements
- E.1 DawnLib SourceGenerator
- F.1 Utility Scripts