Custom properties reflecting empty values in json file

i have created a custom property class with 4 properties. when i set it as one of the object’s properties, the values are empty. the default values are not reflected, unless i manually reset them. i have searched around the questions in this forum but still do not understand the resolution. appreciated the helps.

  • empty value issue
                 "properties":[
                        {
                         "name":"interact",
                         "propertytype":"Interactionitem",
                         "type":"class",
                         "value":
                            {

                            }
                        }],

Only changed values are saved. This allows distinguishing between overridden and default values, and avoids storing redundant information with the map. The idea is that for any value that isn’t explicitly set, you use the default, which is usually the engine default, or it can be hard-coded in your game, or it can read in (once!) from a type definitions file.

For non-custom-class properties, you can use the “Resolve object types and properties” export setting to output even those properties that haven’t been overridden. However, this does not yet work for custom class child values (issue #3411). So, for now, if you need to include the default values in your JSON, you’ll need to explicitly set them so that they no longer inherit the default value. This will, unfortunately, also mean that if you change the default, the older maps will not reflect the new value.

ah ok, thanks for the clarification.

hope we have a feature to enable this in the future.

It’s planned for Tiled 1.11 according to the roadmap.

1 Like