I did not write my full requirement, because I thought: instead of telling me how to solve the whole problem (at which point I may seem lazy to find it out on myself), I only asked about one specific thing I thought I would need to solve it.
My full requirement is:
There are 30 heads. 30 tails.
Create one random head. Create one random tail.
Now check if they belong to eachother.
I found the solution and it I had to use family instances, just as you said.
I created only 1 big family (instead of a heads and tails family)
The big family received 2 instances from me: "head" and "name".
on start of layout:
global var: CreateAHead=1
- >create instance from big family
- > if head = 0: destroy
- > if head = 1: remember the "name" in another glob var and turn on yet another glob var: "CreateATail" (and set glob var "CreateAHead" to 0)
With the create a tail-part I did the same as above.
Final step: if name of head = name of body: it is a match.
If you think this is very cumbersome, let me know, because I always want to improve my events.
(just edited this, corrected my English and added a line in the "-> if head = 1: remember the "name"...-sentence.