Types again
Blitz3D Forums/Blitz3D Programming/Types again
| ||
I am sure I asked this once before but cant seem to find the post still..... I have enemies created using types and some basic AI assigned to them. Mostly entitydistance arguments are used to determine the action. All works pretty well if you destroy the enemies as you go but if you dont then they all seem to bunch up and then start acting in exactly the same way in formation. Is there a way determine actions specific to each entity. ie how do I tell the system that something applied to one entity is not automatically applied to all. |
| ||
It depends on 'how' you apply the systems. If you do something like this: For System.MyType = Each MyType ApplySystemFunction(System\Entity) Next Then it will be applied to all. However, to distinguish between different Type Instances, you need to work witrh the fields or something to identify which ones should or should not be affected... For System.MyType = Each MyType If System\OtherField > 7 Then MoveEntity System\Entity,0,0,1 If EntityDistance (System\Entity,PlayerEntity)<5 Then ApplySystemFunction(System\Entity) If EntityDistance (System\Entity,PlayerEntity)>20 Then ApplyOtherFunction(System\Entity) Next Does this help? |
| ||
Thanks, I`ll give it a go. |