Duplicate Resources without manually making them unique

Godot Version:

4.4

Question

I mostly use Godot’s Resource class to create dialogue. Suppose we have multiple NPCs and for the sake of brevity, we duplicate lots of them.
As supposed to, they all have the same dialogue as they share the same resource:

We could, for each instance, select the option make unique, so they do not share the same resource anymore. However, there is one problem with this approach:

The more Nodes you have on your scene, the more resources you have to duplicate, and if those resources also have subresources, then you have to make them unique as well.
So we can also try and check Make Local to Scene, but it seems it only works for instantiated Nodes, not duplicated ones.

I have also tried duplicating through code so the resource duplicates itself, but I did not get far either.

My question is pretty simple: is there a more elegant way of duplicating Resources without having to make them all unique manually? Also, do make unique and make local sound similar to you? Up until writing this, I was so confused because they seemed almost identical to me.

Why do you want to duplicate resources? Maybe there is a better way to solve your root problem, and so far it sounds like dupliate resources aren’t solving you issue as “Local to Scene” and scripting .duplicate will both easily duplicate your resources.

“Local to Scene” is certainly the easiest way to duplicate a resource when instantiated. “Make Unique” is for the editor, it saves a copy of the resource inside the .tscn file aka “built-in”.

To duplicate through scripts your nodes can use my_resource = my_resource.duplicate() on _ready or through some kind of tool script.

As mentioned before, I have tried these approaches, and the reference still ends up getting shared. The only way to mitigate the issue is to make unique for each resource you have on a node (and its nested resources if you have any), but this is pretty error prone and I could easily override any data this way.

Those are the best ways to do it. What are you really trying to solve?