Replicator Comp - Create a Replicant for each row with cell value as name

Hi! I’m currently messing around with the Replicator Comp, and wanted to create a Replicant for each row of the ‘null1’ table on the left of my screenshot. It seems like the ‘Column by Index’ only creates a replicant per unique str value… Is there a way create a replicant for each row even when the string values are not unique?

Btw, passing this string value to each replicant is important in this project, as I will use it to decide the color of an object created by the Replicant.

Here is my project file:
coloranalyse_v2.63.toe (10.6 KB)

Thank you for your time!
Maxi

Hi Maxi,

In TD, you cannot have indeed two operators with the same name. That is why whenever you try to do so, TD will append a number automatically, which is handy because you can then reference things by number, or programmatically using the .digits attribute.

I checked your project and you use that for some things, so a possible solution here is to go the same route, but instead of relying on the name of the operator, you can simply create a custom string parameter for your reference node for the replicator, which will store the targeted name and gives you full flexibility.

Naturally, you will need to handle the case for UNKNOWN colors to avoid errors in the references, so I’ve add one extra row (as black color) in your “reference_colors” for it, but of course you can do further logic to handle that in any way you want.

Furthermore, when you replicate stuff you would want to have the least amount of nodes replicated for efficiency, so I would recommend to get rid of the inner DAT select and create a color custom parameter instead, which gets populated based on the color name.

One last thing I noticed is that your select1 in the master replicator had a reference to “me.digits”, but I think you rather want parent().digits there to get the correct column.

Find attached a version of your project with this changes:

coloranalyse_v2.toe (16.7 KB)

Various other optimizations are possible, but I’ll let you keep on playing and experimenting, which is the best way to learn things :slight_smile:

Best,
Darien