-
-
Notifications
You must be signed in to change notification settings - Fork 101
Description
Describe the project you are working on:
A multiplayer versus game. Two of them actually, the one I'm currently working on, as well as a prior gamejam project.
Describe the problem or limitation you are having in your project:
In both games, I want to color objects based on their team. For any given object (player, projectile, item, ect.), there are a specific set of properties that need to be changed. For example, theming a lich means setting the color of its eyes and its light. Theming a projectile means setting the color on a MeshInstance and a particle effect.
I end up writing specific logic for every thing.
Describe how this feature / enhancement will help you overcome this problem or limitation:
I love Godot's AnimationPlayer
. The ability to wire it up to an arbitrary property of any node in the scene tree makes it an incredibly flexible tool.
Wouldn't it be awesome if your scripts could tap into this same flexibility?
You could write generic, flexible scripts that can be customized to specific scenes by pointing them at particular properties.
In my case, I could have a generic "themeable" script, and provide the paths to various properties I want to tweak on a particular object..
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
- Attach the following script to an object:
extends Spatial
export(NodePath, PROPERTY_PATH) var path
func _ready():
get_node(path).set_indexed(path.get_concatenated_subnames(), 2)
-
After clicking OK, you now see a property selector for that node:
-
Click on,
translation
.path
is now set toNodePath("MeshInstance:translation")
.
Describe implementation detail for your proposal (in code), if possible:
- Add a
PROPERTY_PATH
hint toexport(NodePath)
, which tells the editor it should point at a property. There's already a precedent for hints like this:
export(float, EASE) var transition_speed
export(Color, RGB) var col
export(Color, RGBA) var col
- Show the property selector (which is already implemented for
AnimationPlayer
) for NodePath properties exported with thePROPERTY_PATH
flag.
The rest of the functionality already exists.
Property/resources paths are already built in to NodePath
Arbitrary properties are already accessible in code via get_indexed and set_indexed.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
Not a few lines of script, but many lines repeated over and over. See above.
Is there a reason why this should be core and not an add-on in the asset library?:
Most of the functionality already exists in godot core, it just needs to be tied together.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status