Big problems with multiple family AI

Get help using Construct 2

Post » Tue Sep 17, 2013 9:37 pm

[QUOTE=Colludium] @Sushin,

I think I've fixed it! Please bear in mind that I'm not sure of what effect you were trying to achieve, but it definitely does some good enemy AI type stuff now... The fix I found involved combining the enemy conditions into two groups, one For Each Enemies / IsAlert and one For Each Enemies / IsAlert(not).

I've come across similar logic inconsistencies as this in the past in C2 and they are always infuriating to figure or work-around (most have been my own doing, I must confess!). I thought what you had should have worked but I suspect C2 didn't like the multiple checks of each state (although my version uses 2 check loops of each Enemies group).

Here's my edited Capx so you can see what I've done. I haven't commented it but the group amalgamation should be kind of obvious. Hope this helps!

https://dl.dropboxusercontent.com/u/184657779/the%20machine%20edited%20by%20ed.capx[/QUOTE]

Well...it seems to work for a little bit, besides the fact that they won't rotate when they are patrolling, but if you alert a few of them and then go hide, they all simultaneously stop moving completely, patrolling or not.

I'm perplexed that it even works, considering the part where you have the "is not alert" loop as a subevent to the "is alert" loop...
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Wed Sep 18, 2013 3:23 am

Yeah - not sure what's going on there. I couldn't get it to do anything with the loops properly separated. Some logic checks are obviously being missed by C2 and I'm struggling to identify a fix. Sorry to not be of more help...
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,188

Post » Wed Sep 18, 2013 6:36 pm

[QUOTE=Colludium] Yeah - not sure what's going on there. I couldn't get it to do anything with the loops properly separated. Some logic checks are obviously being missed by C2 and I'm struggling to identify a fix. Sorry to not be of more help...[/QUOTE]
It's fine. Thanks for helping as much as you did.
I actually ALMOST have it working by removing all the loops and else statements between "is alert" and "is not alert"
The only problem left now is that they don't go back to patrolling. I think the for each loops were actually redundant...

EDIT:
Okay..actually I just fixed it by starting their patrol timer in the same event that they go unalert.
I read up on Construct 2 events this morning and thats where I got the idea to get rid of the for loop. Construct 2 already loops through all the       instances by itself.Sushin2013-09-18 18:44:04
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Thu Sep 19, 2013 12:52 am

Sushin,

Glad you fixed it - I think I'm going to re-read the event section of the manual as well. It's interesting that such an apparently logical step could cause such a glitch. Every day's a school day...
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,188

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests