Skip to content

MapObj Parameters - #65

Open
Scutlet wants to merge 16 commits into
MapStudioProject:mainfrom
Scutlet:feature/mapobj-param-ext
Open

MapObj Parameters#65
Scutlet wants to merge 16 commits into
MapStudioProject:mainfrom
Scutlet:feature/mapobj-param-ext

Conversation

@Scutlet

@Scutlet Scutlet commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Changes the way MapObj Parameters can be edited, providing more background information and limited validation. Moves all the hardcoded parameter descriptions to several JSON files.
DX mapObjs are not included as they were not present previously.

panel-metro

Supports parameter descriptions, default values, validation (min/max)

Details validation

Defines parameter types: float (default), int, bool, bytes, time, enum. Under the hood everything remains a float, only the widget changes. It's always possible to revert back to the old layout through a toggle ("Raw")

Details panel

Local overrides. This way, parameters can be documented on the go. An edit button is included as a shortcut to the user folder. Errors in the file format are displayed.

Details user-files file-error

Shows supported game versions. A toggle allows hiding unsupported parameters. This only really affects the Item Box Double-parameter.

Details game-versions

Search for mapObj aliases in the asset list and outliner. E.g. When searching for "Thwomp", lists "Dossun".
- NB: Requires Toolbox.core and MapStudio.UI to be updated (see separate PR's there as well)

Details alias-search-assets alias-search-outliner
JSON Example The same info is included in the user folder.
    ...
    "3026": {
        "name": "DL_Metro",
        "description": "A subway train with a variable number of wagons.",
        "aliases": [ "Train", "Subway" ],
        "usages": [ "U Super Bell Subway" ],
        "versionU": "Animal",
        "param_0": {
            "name": "Number of trains",
            "description": "Number of wagons. The locomotive has a boost panel at the front.",
            "type": "int",
            "default": 6,
            "minValue": 1
        },
        "param_1": {
            "default": 5
        },
        "param_2": {
            "default": 5
        },
        "param_3": {
            "default": 6
        },
        "param_4": {
            "name": "First respawn delay",
            "description": "The duration after which the train respawns in its starting position. The train will respawn at path point 0 of its assigned rail path when the timer ends, even if it's still moving on its path. If 0, the train doesn't respawn. For path-loops this means it keeps going.",
            "type": "time",
            "default": 0,
            "minValue": 0
        },
        "param_5": {
            "name": "Consecutive respawn delay",
            "description": "Identical to the previous parameter, but instead for every respawn after the first.",
            "type": "time",
            "default": 0,
            "minValue": 0
        },
        "param_6": {
            "name": "Train color",
            "type": "enum",
            "default": 1,
            "enum": {
                0: "Red",
                1: "Blue"
            }
        },
        "param_7": {
            "default": 1
        }
    }
    ...
JSON description
    "3026": { // MapObj ID
        "name": "DL_Metro", // MapObj name
        "description": "A subway train with a variable number of wagons.",
        "aliases": ["Train", "Subway"], // Additional search terms in the asset viewer and outliner
        "usages": ["U Super Bell Subway"],
        "versionU": 0, // Wii U version this mapObj was introduced in (Default 0/"base"). -1 means unsupported in Wii U
        "versionDX": "base", // Same as above, but for Deluxe
        "param_0": {
            "name": "Number of trains",
            "description": "Number of wagons. The locomotive has a boost panel at the front.",
            "samples": [0.0, 3.0], // Example values
            "versionU": 0, // Same as for the mapObj, but instead specifically for this parameter
            "versionDX": 1, // Same as for the mapObj, but instead specifically for this parameter
            "type": "int", // Determines which widget to use. Valid values include, int, float, bool, time, enum, bytes
            "default": 0, // Default value when creating a new object
            "minValue": 0,
            "maxValue": null,
            "enum": { // Predetermined values with special meaning
                0: "Red",
                1: "Blue",
            }
        },
        // Unused parameters can be skipped. E.g., skip "param_1"
        "param_2": {} // Empty parameters are marked as 'used', but won't have any documentation
        ...
        "param_7": {}
    },

Any value can be left out, meaning you'll only need to define the docs you wish to add.
E.g., the following is valid:

    "3026": {
        "description": "Trains are fun!",
        "param_6": {
            "name": "Train Hue"
        }
    }

or even

    "3026": {
        "param_4": {}
    }

Scutlet added 16 commits August 15, 2026 00:15
Fixed broken text keys
Added an index to the Unused map obj parameters.
Parse parameters from JSON archive. Params are not yet used anywhere.
Merge multiple archives together. This way, archives can be split up and users can load their own on top of the default ones.
Not sure why there's two identical copies of TurboStudio.txt. Synced the two.

Modified the param UI in order to load different widgets based on the parameter type. It can currently display float, int, bytes, and checkbox widgets.
Utilised the new table layout in favour of the older column-style.
Display "number of frames/delay" parameters as m:ss.mmm. Each frame is approximately 16.667ms, so not all timer values are valid. Invalid ms are always rounded down.

Display enum parameters
Allow searching for MapObj aliases (modifies MapStudio.UI)

Refactored Meta so it's attached to the ObjDefinition instead of the MapObj itself.
Added the paramDB to the GlobalSettings

Fixed a bug where all string[] elements from the JSON were not loaded properly.
Also utilize aliases in the object selector.
Related commits in MapStudio.UI and Toolbox.Core

Included submodule updates for these.
Utilise default paramaters from meta files.
Fixed naming for unused/undocumented parameters.
Summerize them in a tooltip.
Refactored how supportU/DX are calculated to better support overriding.

Renamed Frame to Time.
Show description and tags/aliases of mapObjs in a new collapsible menu.

Modified platforms to show DLC/modded status for both U/DX. Platform support can be specified for both parameters and mapObjs.
Added a toggle for hiding unsupported parameters on the current platform.

Added a reset button for each parameter.
Added missing translation keys.
Moved warning icon onto the info-label.
Fixed table layout & indentation.
Added button to open user meta folder.
Added error popups when parsing meta files fails. Also write it in the tool's console.
Added missing import for DX base objects.
Added docs to the user parameter folder.
Removed the original ParamDatabase and filled all JSON files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant