Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
. Moons Editor Setup
Updated 3 months agoCreating Your Moon Definition
-
In your Unity Project window, create a new folder for your moon.
- Example:
PathToContentContainer/Content/Moons/MyMoon.
- Example:
-
Inside that folder, create another folder named Registry.
- Example:
PathToContentContainer/Content/Moons/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. |
| Terminal Predicate (optional) | Allows conditional logic for when the moon should appear in the terminal. |
| Pricing Strategy (optional) | Defines custom pricing logic for your moon that supercedes the cost field. |
| Cost | Cost of the moon, overriden by Pricing Strategy if created. |
| Outside Enemies Spawn Probability Range | Range of outside enemies that spawn each cycle, vanilla has it hardcoded to 3 by default. |
| Generate Enemy PowerCount Configs | Creates a config to edit the power count of inside, outside and daytime enemies. |
| Generate Enemy SpawnCurve Configs | Creates a config to edit the animation curves for enemy spawn weights. |
| Generate Enemy Spawn Probability Range Configs | Creates a config to edit the random range of enemies that spawn for each cycle for inside outside and daytime enemies. |
| Generate MinMax Scrap Config | Creates a config to edit the min and max scrap amounts of a moon. |
| Generate Time Config | Creates a config to edit the time speed multiplier of the moon. |
| Generate Cost Config | Creates a config to edit the cost of the moon. |
| Generate Disable Predicate Config | Creates a config to get rid of the Terminal Predicate affecting the moon. |
| Generate Disable Pricing Strategy Config | Creates a config 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 ONLY the moon definition's AssetBundle to the list of AssetBundles in your ContentContainer
(created during the Unity Setup stage).
Once that’s done, your content is registered!
Pages
- A. Unity Setup
- B.1 Registering Content via Code
- B.2 Registering via Unity Editor
- C.3 Weathers
- C.4 Enemies
- C.5 Inside/Outside Hazards
- C.6 Ship Upgrades/Decors
- C.7 Items
- C.8 Additional TileSets
- C.9 Terminal Commands
- C.A.1 Footsteps
- C. Interiors
- C. Moons
- D.1 Achievements
- D.2 Vehicles
- D.3 Entity Replacements
- E.1 DawnLib SourceGenerator
- F.1 Utility Scripts
- F.2 Unity Editor Tricks
- . Interiors Code Setup
- . Interiors Editor Setup
- . Moons Code Setup
- . Moons Editor Setup