Got this idea, I want to create an Enemy Family that control movement and a lot of other families to control the way of attack of my enemies. For now I just created the EnemyMelee Family. Now, I want this:
If EnemyMelee is near the Player (Im using Line of Sight Behaviour on family EnemyMelee) and Enemy isnt Death (a variable called enemyState on family Enemy) attack it. This seems to work well
But my problem is when the EnemyMelee is not near the player and Enemy is not death. It doesnt seems to work using the old trick pick familyA, pick familyB by familyB.UID = familyA.UID for picking multiple families. With the code as it is now, It just work for the enemy with the lower UID, It doesnt work with others enemies.
Im using this code:
Here's an example of the behaviour: http://www.xhelos.com/c2/example/index.html
Here's the capx: http://www.xhelos.com/c2/example/solofile.capx
I really need to make this work on differents families. My idea is that is to create differents kinds of family to control their AI. For example create a enemyShooter Family and a enemyBoss family, so I just put the enemies in their respectives families and they win a new behaviour. That's why I cant put all the code in one family.
Using the Pick instance with UID doesnt work also.
What can be wrong with this code?