OK! Hard mode #godot challenge question:

Is there any way to set up a Resource with a signal that has a call bound?

By default, defining signals works fine but they cannot be bound in the editor. I have been using trashy workarounds. I would prefer to just bind the signal.

Ugh, the only answer I got to this was on BlueSky and was "why would you ever want something easy and useful? You should just do backflips like everyone else!"

I guess I'm glad for the silence here on Mastodon, at least it's not people telling me to not ask the question.

This is probably not Godot-specific, but I can't help except notice that whenever I ask a Godot question, 95% of the answers are about how I shouldn't have asked.

And then like 5% are "here's how:" and it's super easy.

Be part of the 5%.

Since it seems people don't know why you'd want this:

You have a Resource class: Potion.

How do you tell each type what it does?

Easiest way would be to bind arbitrary functions and args on a on_drunk Signal.

Otherwise you have to duplicate that functionality and it's either flabby or brittle. #godot

@view shouldn't potion should just be a node type? Why do you need it to be a resource?

@thebestnom Why would an inventory item be a node? It's a data object, not a functional scene object.

You just have a generic "item" node that shows an icon, links to a resource, and lets you choose whether to use it or sell it.