I'm having fun prototyping some group AI behaviours. However, as a Construct newbie, I'd really appreciate a bit of advice with regards to the picking process.
I have a number of autonomous enemy agents that maintain their own state based on individual factors like:
But now I want to add some state transitions for individual enemies based on assessment of all enemy instances, not just themselves.
For example, suppose that I wanted to implement the rule that "If more than 80% of the blue team have less than 30 health, then all blue players should run away". If I try to implement this as:
<img src="http://i46.tinypic.com/2a7s8eq.jpg" border="0" />
Then my problem is that the evade state only gets applied to the picked instances - i.e. those with less than 30 health. How do I create an event that compares the number of instances that would be picked by an expression (how many blue players have <30 health, are "fleeing", or have less than 5 bullets left, for example), but then apply the corresponding action to all instances of that object?
Any help gratefully appreciated!
Develop games in your browser. Powerful, performant & highly capable.
Add pick All condition in subevent below condition, put Your actions there
vee41 - that is exactly what I was looking for, thankyou!
I didn't see "Pick All" because I was looking in the Object conditions (where you find Pick by ID, Pick Nearest/Furthest etc.) rather than in System conditions.
In fact, it it only me that finds it a bit counter-intuitive that you have to Pick All in "System" and then select the object type that you want to pick all of, rather than going via the object itself? Anyway, it works, so thanks again.