Obviously I failed in describing my problem clearly Thanks for the answer, I`ll try to point out what I mean in a more understandable way:
I want the system to check first which family-instance has the family instance variable =2, and then spawn only those enemies for which the variable is =2. I`ll give you another example:
There are three enemies: Bug-enemy, robot-enemy and weirdo-enemy. I want them to spawn randomly. I could use a code like this, which is very inefficient:
System: Every 5 seconds -> Set randomnumber=choose(1,2,3)
If randomnumber=1-> Spawn bug-enemy
If randomnumber=2-> Spawn robot-enemy
If randomnumber=3-> Spawn weirdo-enemy
This code is very inefficient. I want to use a more elegant way by creating a family called "Enemies" and the family instance variable "Enemy_ID". The values of this family instance variable are 1 for the bug-, 2 for the robot- and 3 for the weirdo-enemy. I want the code to look something like this:
System: Every 5 seconds -> set randomnumber=choose(1,2,3)
If randomnumber=Enemies.Enemy_ID-> Spawn only the enemy, whose Enemy_ID=randomnumber
Is it more clear what I mean now? How do I have to adjust the second code in order to make it work correctly?