How do I make every instance of an object trigger an event?

Get help using Construct 2

Post » Fri Sep 15, 2017 4:16 pm

Message: joedman593 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
How do I make every instance of an object trigger an event?

So these events will let an enemy do damage to the player and display a text sprite amounting to the damage done..

https://imgur.com/a/QUZm4

It does what I want.. kinda. Except when a huge number of enemy objects does an attack (at the same time and even just a few frames apart) the event doesn't execute for every enemy..
B
4
Posts: 12
Reputation: 226

Post » Fri Sep 15, 2017 5:23 pm

Your events are in the wrong order, if I'm not mistaken.

Currently you have :

IF (Enemy is not dead ; Enemy is attacking ; Frame = 4 ; Trigger Once)
THEN for each enemy
IF Is trgtInAtkRng
DO something

Meaning if ONE enemy meets the conditions for the first IF, you are checking the range of each enemy, when you just want to check the range for this particular enemy.
Also : as long as an enemy meets this condition, since you have a Trigger Once, it won't happen again. If a lot of enemies are attacking, at all time you could have at least one with the AnimationFrame = 4, and that would block everything.

Try the events like this :

FOR EACH Enemy
IF (Enemy is not dead ; Enemy is attacking ; Frame = 4 ; Is trgtInAtkRng ; Trigger Once)
DO something

Now each enemy should be independently checking its own Attack Range when the conditions are met and shoot only once :)
B
5
Posts: 18
Reputation: 270

Post » Sat Sep 16, 2017 2:07 pm

Message: joedman593 can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
The damage and text are spammed when multiple objects' conditions overlap..

here are the events
https://imgur.com/a/hss5c

and a screenshot of the WIP
https://imgur.com/a/3WjCF
B
4
Posts: 12
Reputation: 226

Post » Sat Sep 16, 2017 3:28 pm

Message: joedman593 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
This one gives the best output by far but still doesn't trigger the event for every object on huge numbers.

https://imgur.com/a/Z99Bw
B
4
Posts: 12
Reputation: 226


Return to How do I....?

Who is online

Users browsing this forum: darkrealos, dop2000, Rhindon and 18 guests