I'm already facing a problem actually. I need to select one of the enemies at random, so after selecting the enemy family just as you stated, how could I do that?
In my code I made
pick enemy where enemy.number=randomValue (targetArcher in my code)
so that I select only one instance at random
but as now it could be any sort of enemy (as I'm just selecting a family's UID), I don't see how to do that...
The idea would be to pick fam_enemies where fam_enemies.UID = Param(0) and then check the "number" instance variable of each instances of the selected object type to select the correct instance. Is it possible to do this, given it could be any enemy type?
I think that if there is a solution to this, it should work perfectly!
Thanks again!
If you just need to select a random enemy on the your combat screen you can use "Pick random instance" from the system tab, and then you of course just choose the family as being the object.
[quote:1levrniq]
The idea would be to pick fam_enemies where fam_enemies.UID = Param(0) and then check the "number" instance variable of each instances of the selected object type to select the correct instance. Is it possible to do this, given it could be any enemy type?
To select a more specific type of enemy in a family you can sort of do the same thing as above using random. But since you are now looking for a specific type, you first have to narrow it down.
The way you can do that, is to add a variable to you enemy family called "Type" for instant and then in each enemy you write there type, for instant "Wolf", "Dire Wolf", "Bat" etc.
Then when you need to pick a random enemy type, you just do like this:
Pick Fam_Enemies.Type = "Wolf"
Pick random Instance Fam_Enemies.Type
If that is what you mean?