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

0 favourites
  • 4 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • 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..

    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..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

  • The damage and text are spammed when multiple objects' conditions overlap..

    here are the events

    and a screenshot of the WIP

  • This one gives the best output by far but still doesn't trigger the event for every object on huge numbers.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)