Validation: Configuration
Version note: This guide is validated for Grid Building 5.0.8.
The first point of validation in 5.0.8 should be confirmed during the initial project setup. When you enable the plugin:
- Go to Project → Project Settings → Plugins and enable the plugin.
- In Project → Project Tools, select Set up default import actions.
- Check the Output Panel for confirmation that defaults have been successfully added.
- Reload the project (Project → Reload Current Project) and check the Input Map to confirm the 15+ actions have been loaded.
2. GBInjectorSystem Validation
GBInjectorSystem is the primary node responsible for wiring dependencies across the scene.
You should call run_validation() on the injector in your setup scene (or manually trigger it in the inspector if supported) to verify:
composition_containeris assigned.- All dependencies can be resolved.
- Required scene nodes (
GBLevelContext,GBOwner, etc.) are reachable. - Placed objects have correct
collision_layerfor targeting (see Troubleshooting).
| |
3. PlacementValidator (Runtime Readiness)
In 5.0.8, PlacementValidator handles the internal evaluation logic. It can be used to manually validate rules against a context if you are not using the standard building system.
Core Validation Classes
- PlacementValidator: The main class that orchestrates validation. It takes a list of rules and evaluates them against the current placement context.
- ValidationResults: A data container that captures the outcome of validation.
- GBConfigurationValidator: Static methods for centralized configuration validation at editor and runtime.
ValidationResults
| Member | Type | Description |
|---|---|---|
is_successful() | bool method | True if no blocking issues were found. |
get_errors() | Array[String] method | List of critical errors that prevent operation. |
_errors | Array[String] private | Internal storage for errors. |
Note: ValidationResults uses method-based access (is_successful(), get_errors()) rather than direct property access. There is no issues or warnings property - use get_errors() for error strings.
Tips
- Keep configuration validation fast; it runs during entity creation or system startup.
- Differentiate between Invalid Configuration (developer error, e.g., missing resource) and Invalid Placement (player error, e.g., placing inside a wall).
- Use
ValidationResultsto combine results from multiple rules into a single report. - Ensure base
placement_rulesreference external.tresfiles. Embedded subresources may deserialize as empty in exported builds. See Web Export Guide.