Set attack intervals

Get help using Construct 2

Post » Wed Jan 08, 2014 1:16 am

I've been reading threads and tutorials for several hours but I can't find an answer to this.

I'm making a tower-defense kind of game.
When a MOB get's to a "base" I want it to start attacking the base.

When it's within X pixels, attack... then wait, then attack again.
(Ultimately, I also want them to attack other nearby structures/MOBS, but I'll be happy to get this going for now.)

This seems easy enough, but I'm not finding the answers I'm looking for.

Thanks!!!!!
B
6
Posts: 12
Reputation: 274

Post » Wed Jan 08, 2014 1:38 am

The mob will attack the base?

Maybe create invisible carpet on attack place (to avoid within X pixels).

Conditions:
mob is overlapping "AttackPlace"
system every x seconds       


Actions:
mob set amimation to "Attacking" (play from beginning), system substruct from "BaseHP" 1

PPM2014-01-08 01:39:25
B
6
S
2
Posts: 22
Reputation: 571

Post » Wed Jan 08, 2014 1:45 am

There isnt a way to set this up to have it attack anything thats within X pixels?

If monster is within 10 pixels of RedBase, attack, then wait 1.5 seconds and attack again, and keep doing this....
B
6
Posts: 12
Reputation: 274

Post » Wed Jan 08, 2014 1:56 am



Ok, how about to do "invisible carpet" over the mob +10 pixels in width and height to mob's size.
And conditions:

mob_carpet is overlapping "RedBase" (mob_carper on conclusion with "RedBase")
system every x seconds
...


But I'm not sure I'm understanding you.
B
6
S
2
Posts: 22
Reputation: 571

Post » Wed Jan 08, 2014 2:01 am

try something like this.

Condition:
-Every x Second
--for each Mob
---Distance(Mob.x,Mob.y,Structure.x,Structure.y) < (Your pixel distance)

Action:
-Mob Attackc4sp3r892014-01-08 02:02:59
B
17
S
8
G
4
Posts: 93
Reputation: 3,190

Post » Wed Jan 08, 2014 3:28 pm

[QUOTE=c4sp3r89] try something like this.

Condition:
-Every x Second
--for each Mob
---Distance(Mob.x,Mob.y,Structure.x,Structure.y) < (Your pixel distance)

Action:
-Mob Attack[/QUOTE]
it's better...
B
6
S
2
Posts: 22
Reputation: 571


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests