Create Object Tool
Editor tool for creating scene objects via toolbar groups. Provides categorized buttons (Environment, Level, BeamNG, Other Classes) with click-to-place creation, build functions for default field setu
Editor tool for creating scene objects via toolbar groups. Provides categorized buttons (Environment, Level, BeamNG, Other Classes) with click-to-place creation, build functions for default field setup, and custom class instantiation.
Public API (Module)
| Function | Signature | Description |
|---|---|---|
M.onEditorInitialized | () | Registers edit mode, toolbar, preferences, and group setup |
M.onEditorRegisterPreferences | (prefsRegistry) | Registers createObjectTool.general preferences |
M.onEditorDeactivated | () | Pops CreateObjectTool action map |
M.onEditorGui | () | Pops action map when popup not open |
M.initGroups | () | Initializes all create object group categories |
M.selectClass | () | Triggers class selection in "Other Classes" popup |
M.navigateList | (up) | Keyboard navigation in class list popup |
Editor API (attached at init)
| Function | Signature | Description |
|---|---|---|
editor.addObjectCreateGroup(name, icon, classes) | Register a custom create group | |
editor.getObjectCreateGroup(name) | → table | Get group by name |
editor.getAllObjectCreateGroups() | → table | Get all create groups |
editor.makeCreateObjectItem(icon, classname, title, buildFunc, singleInstance) | → table | Build a toolbar item descriptor |
editor.getObjectCreateItem(classname) | → table | Find create item by classname |
editor.createObjectInstance(classname, createObjectItem) | → instance | Create and register an object |
editor.getCurrentSelectedParent() | → SimObject | Get current parent (selected SimSet or MissionGroup) |
editor.createCustomClassObject(clsName, parentNode) | → instance | Create any SimObject-derived class |
editor.stopCreatingObjects() | Exit create mode, return to select mode |
Default Create Groups
| Group | Objects |
|---|---|
| Environment | SkyBox, CloudLayer, ScatterSky, Sun, WaterBlock, SFXEmitter, SFXSpace, Precipitation, ParticleEmitterNode, PointLight, SpotLight, GroundCover, TerrainBlock, GroundPlane, WaterPlane |
| Level | SimGroup, Camera, LevelInfo, TimeOfDay, Zone, Portal, PlayerSpawnSphere, ObserverSpawnSphere, OcclusionVolume, TSStatic |
| BeamNG | BeamNGTrigger, BeamNGBooster, BeamNGParking, BeamNGWaypoint, BeamNGEnvTrigger, BeamNGPointOfInterest, BeamNGGameplayArea |
| Other Classes | Searchable list of all SimObject-derived classes |
Usage Example
-- Add a custom create group
editor.addObjectCreateGroup("Custom", editor.icons.star, {
editor.makeCreateObjectItem(editor.icons.cube, "TSStatic", "My Shape", function(obj)
obj:setField("shapeName", 0, "/path/to/shape.dae")
end)
})Notes
- Click-to-place: object follows mouse cursor, click to place, Ctrl+scroll to rotate around up axis
singleInstance = truecreates on button press only (no viewport click needed)- Hidden classes (MeshRoad, DecalRoad, River) shown disabled with "Use X Editor" tooltip
- Build functions set initial fields and register them for undo/redo serialization
- Preferences:
infiniteCreateByClick,verticalToolbar,classFrecency(MRU tracking)
See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Crawl Data Editor
Editor tool for creating and managing crawl gameplay data - trails, paths, boundaries, and starting positions used by the crawl game mode. Provides tabbed editing interface with separate edit modes fo
DataBlock Editor
Editor window for browsing, creating, deleting, and saving SimDataBlock objects. Provides a two-tab interface (Existing/New) with inspector integration.