Globals
This page documents how your mod script can interface with Dungeondraft. You can pass and receive data using the Globals such as the Tools or the World to perform tasks.
Core
Functions and properties in this section are available to all scripts.
Properties
Provides access to every tool in Dungeondraft by name. For example, you can access the Object Tool by indexing the variable in this mannerGlobal.Editor.Tools["ObjectTool"]
.
Valid tool names are:
- SelectTool
- TextTool
- PrefabTool
- FloorShapeTool
- PatternShapeTool
- WallTool
- PortalTool
- RoofTool
- PathTool
- ObjectTool
- ScatterTool
- CaveBrush
- WaterBrush
- TerrainBrush
- MaterialBrush
- Environment
- LightTool
- MapSettings
- TraceImage
Editor
Functions and properties in this category are related to the tools and user interface of Dungeondraft. They are accessed through Global.Editor.VariableName.
World
Global.World
Functions and properties in this category are related to the map. They are accessed through Global.World.VariableName.
WorldUI
Global.WorldUI
The class where many of the on map UI elements are accessed. They are accessed through Global.WorldUI.
Exporter
Global.Exporter
The class used to export maps to various image and data formats.
Level
The class used to hold and modify the map itself. Most easily accessible through Globa.World.GetCurrentLevel() and other Global.World properties.Root
This name is base directory of the mod a script is packaged in. It is helpful for locating other files inside a mod, like a PNG file for icons. For example, you can assign a variable to a PNG filename by combining the Root name with a known relative path like so:
Camera
Global.Camera
The object that frames the area of the map to display to the window.
Header
Global.Header
The object that holds meta information about each map.
Functions
ToolPanel Global.Editor.Toolset.CreateModTool(Reference script_instance, String category, String id, String name, String icon)
The category is the set of tools the new tool will show under. Valid options are:
- Design
- Terrain
- Objects
- Effects
- Settings
The id is the internal tool name, while the name is displayed to the end user.
The icon is the path to a PNG to use as the button.
Script
Functions in this category are specialized for modding Dungeondraft. They are accessed through Script.VariableName.
Functions
Returns an Array of Strings of unique IDs of all active mods.Tool Script
Functions and properties in this section are available only to tool scripts.
Script
Functions
Returns an Array of Strings populated by the path to all the assets of that category.Valid categories are Asset Categories