Godot-proposals: Make grouping exported variables easier

Created on 24 Jul 2020  路  3Comments  路  Source: godotengine/godot-proposals

Describe the project you are working on:
2d space game

Describe the problem or limitation you are having in your project:
My nodes (e.g. planets, stars) have a LOT of exported variables, often thematically grouped (eg. physical properties and cosmetic stuff, ship physics and AI stuff and cargo...)

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
We already have a workaround to group the exported variables, https://docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_exports.html#adding-script-categories , but it is... NOT pleasant to use.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
The syntax proposed in PR #40669 is the following: cosmetic (section, "sectionname"): followed by an indent and any variable declarations wanted.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
It can be worked around, but it takes TOO many lines of script (circa 10 per each variable, times 10 variables, that's around 100 lines just for that - and in another project, I have nodes with 20 variables...)

Is there a reason why this should be core and not an add-on in the asset library?:
I don't think addons can do such deep injections into the inspector, AND the same NEEDS to apply to remote scene tree debugging, where the issue is exacerbated by also showing non-exposed variables.

editor gdscript

Most helpful comment

All 3 comments

Make grouping related variables easier.

Sorry, but this is not a description of the feature or how it would be implemented... Could you at least copy-paste the syntax proposed in the PR related to this proposal. This is the thing that should be discussed, not "making something easier", which isn't really a proposal...

Whoops, it was fairly late and I didn't notice I put it in the wrong place :P - updated.

Was this page helpful?
0 / 5 - 0 ratings