Need help with Enemy AI

Get help using Construct 2

Post » Sun Mar 27, 2016 3:35 pm

Hi there

I try to create a Enemy AI. I have look diverent Tutorials an look to some samples. But i find only Tutorials where the Enemys walk and jump arround, that Part also works fine. I want to add a Attack and have a lot of Problems with this, trying arround about 3 days....
Here ist what i have at time:
https://www.dropbox.com/s/irq3zfg206t0z ... e.png?dl=0

With 1 Enemy it works fine. But when i set more of them i have at this time a timeout Error. I have try diverent thinks. Either i have a Timeout Problem or the Enemys do crazy things or stucking arround or spawn the "AttackBox" many times...

Can anyone help me?

*Sorry for Google English*
B
9
S
1
Posts: 22
Reputation: 473

Post » Sun Mar 27, 2016 6:16 pm

Can you post the capx ?

*sometime you can find forum of your langage*
My Twitter:

@Sirvoidd

My Tutorial:

Multiplayer with Photon
B
32
S
12
G
9
Posts: 73
Reputation: 7,069

Post » Sun Mar 27, 2016 6:36 pm

Hey, I have a few suggestions, maybe they will help?

1) Put all of that code under one "for each Biber" condition(and remove the "for each" from each newly created sub-condition, so it's not redundant)
2) make sure you don't have redundant actions set up (you have 2 different sections set up for the "idle" animation, which may cause an issue)

Otherwise, I'm with Sirvoid on posting a capx. Best of luck with your work!
B
55
S
32
G
23
Posts: 333
Reputation: 16,616

Post » Sun Mar 27, 2016 7:14 pm

Thanks 4 answering
@ultrafop
The Idle double post was a copy and paste mistace. I have deletet it and set all under one "for each" and deleted the other ones. But it still works Buggy....

@Sirvoid
There is a capx. Ist a little bit big, dont know if it is posible to minimize it.
https://www.dropbox.com/s/944hm0b5fmffk ... .capx?dl=0

Edit:
The Layer "Enemys" is a old try to make a Enemy AI, the Layer "Enemys_AI" is the current.
Last edited by Jomnitech on Sun Mar 27, 2016 8:17 pm, edited 1 time in total.
B
9
S
1
Posts: 22
Reputation: 473

Post » Sun Mar 27, 2016 8:17 pm

Here you go. I tried to make lots of comments so that you can see why I've made the changes that I did. I also left a bit of "scaffolding" by way of a new variable that you can use to initiate your attack state. I would also switch the state setting (1,2 etc.) to use this variable as you progress, as it will give you more control over the distance at which your enemies will switch to attacking (also, they won't crowd your player).

https://www.dropbox.com/s/d6jynxbyyweaa ... .capx?dl=0
B
55
S
32
G
23
Posts: 333
Reputation: 16,616

Post » Sun Mar 27, 2016 8:42 pm

@ultrafop
I have toggle off the "Set Enemy AI 1/2. So i can for testing switching between the AI`s with right or left click.
When i Trigger the Enemy AI to 3 i have the same creapy stuff i also had. The Enemys spawns a lot of Attack Boxes and sometimes the stuck and do nothing. :?
B
9
S
1
Posts: 22
Reputation: 473

Post » Mon Mar 28, 2016 6:48 am

EDIT:
Here is a working version with the hitboxes spawning correctly:
https://www.dropbox.com/s/d6jynxbyyweaa ... .capx?dl=0

I also recommend looking at this tutorial:
https://www.dropbox.com/s/ps99suo5g9qa8 ... capx?dl=0t

I think using the X distance of your enemies can help to make sure that you are having them stop to attack at a nice distance and then re-engage if the player moves too far away.
B
55
S
32
G
23
Posts: 333
Reputation: 16,616

Post » Mon Mar 28, 2016 8:10 am

@ultrafop

I also have made a AI with the tutorial you posted. You see rest of it in the layer "Enemys" the Variables of checking distance and AI are missing because i have re organized.
But always have the same Problems with the meele attack. When there are more than one Enemy the attack will not work. They stucking arround or do other creapy stuff.
B
9
S
1
Posts: 22
Reputation: 473

Post » Mon Mar 28, 2016 3:32 pm

Is this new capx with the hitboxes built in as a function not working on your end?
B
55
S
32
G
23
Posts: 333
Reputation: 16,616

Post » Mon Mar 28, 2016 3:48 pm

@ultrafop

Nope, dosent work so. The Enemeys spawns a tons of hitboxes and from time to time they freeze.
B
9
S
1
Posts: 22
Reputation: 473

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests