Replicator behaviour with CHOP?

Hi, this is my first post. I´m making my first steps with TD, having fun so far.

Today I noticed the following when replicating a CHOP:
I have a null CHOP out connected to a logic CHOP in. I add a merge CHOP. I add a replicator COMP, select logic CHOP as master and provide a simple 4 element table DAT as template, and set the script to automatically connect it to the merge CHOP by inserting “c.outputConnectors[0].connect(op(“merge1”));” in the replicator callback DAT script. When I push “recreate all operators” and I get the 4 expected replicas. So far so good. But when I press “recreate all operators” again, I get 4 extra connections from the null CHOP to the merge CHOP…If I press it again, I get 4 more…So if I change something in the table and need to remake the replicas I have to delete the null connections…
I attached a simple file, just try to click in “recreate… All” button to check what I mean.
¿am I missing something? ¿is this normal?

Thanks in advice…

Cheers!
testreplicatorchop.1.toe (4.21 KB)

scripting output connectors is always tricky.

When you re-create all ops, you’re first deleting the initial set, then re-replicating. If you delete the original ops, then their connections fall back t the original null. Which is why you’re getting a continued stack of connectors.

To see this happen try this.

Delete your item ops, notice that you now have four connections to your null102, now re-create ops in the replicator, you now have for connections from your null 102, and the new four connections from your newly replicated ops.

Instead of a merge, you might try skipping the process of scripting your operator connections and instead using a select CHOP with using the following to pattern match:

item*

This will match all ops with starting with item, and any digit that follows.

select_chop.tox (1.26 KB)

Very clear explanation.
Thanks Matthew.

Salud

Welcome to the community!