How do I make a trigger every time the level changes, but not every tick?

0 favourites
  • 12 posts
From the Asset Store
Sheeky's Power-ups Sounds
$4.20 USD
30% off
75 power-up sound effects; bonus and notification sounds, fanfares, harp glissandi, stabs, clock ticks, etc.
  • Hi!

    I have a problem:

    I want something to trigger once during a boss fight sequence, but I also want another event to be able to detect when the boss is dead and then set the level to something else.

    The problem is, when I kill the boss, it does change the level, but it seems like the other trigger once is still running.

    And I know that the trigger once is a temporary fix, because I want it to actually trigger multiple times every time the level changes to the boss fight level (my game allows you to keep playing and have the fights get harder over time).

    Basically, I don't want it to rack up that event every single tick, and I also don't want it to only trigger a single time.

    Since this is very long, here's the "code":

    (for some reason the image uploading isn't working)

    cdn.discordapp.com/attachments/852976600068784148/1092831850919104542/actualscrenshot-1.png

    cdn.discordapp.com/attachments/852976600068784148/1092831850671648778/screnshot-2.png

  • A trigger once on its own doesn't mean too much, you should add it to the triggering event to turn it into a trigger once, such as the enemy's hp dropping to 0.

  • A trigger once on its own doesn't mean too much, you should add it to the triggering event to turn it into a trigger once, such as the enemy's hp dropping to 0.

    But doesn't that mean it won't run more than once? Because that enemy is going to be back to hp 500 after a few more levels.

  • Nope, don't think of it as trigger once forever, it's trigger once 'at the time' or when true/triggered. If your boss HP goes back to 500 and again drops to 0 then that event would trigger again, but once.

  • Nope, don't think of it as trigger once forever, it's trigger once 'at the time' or when true/triggered. If your boss HP goes back to 500 and again drops to 0 then that event would trigger again, but once.

    Alright. But what about the other one? I want to be able to stop that "trigger once" (in the other image) whenever the health reaches 0. How would I do that?

  • Stop which one? It's a bit confusing. The one event that might need a trigger once doesn't have it, for the boss health. What problem are you having or where is it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The major bossfight one. My problem is, I want to stop that entire line of events from continuing if at ANY point the health drops to 0.

  • Again I don't know what event you mean. If you want to stop something from happening when health drops to 0 then make an event to change a different global variable from 0 to 1 if health drops to 0. Then the events you don't want to run if this happens you can add the condition that the variable is 0 because when it changes to 1 it'll never run. So that locks out those event for the rest of the game if that's what you want.

  • Again I don't know what event you mean. If you want to stop something from happening when health drops to 0 then make an event to change a different global variable from 0 to 1 if health drops to 0. Then the events you don't want to run if this happens you can add the condition that the variable is 0 because when it changes to 1 it'll never run. So that locks out those event for the rest of the game if that's what you want.

    Let me rephrase this because yeah it's a bit confusing.

    Take this event:

    cdn.discordapp.com/attachments/852976600068784148/1092831850671648778/screnshot-2.png

    We'll call this the BossfightSequence.

    I want that to run every time the level changes to a certain number. Only once though. Running that once, every time the level changes.

    HOWEVER, when the health reaches 0, in this condition (https://cdn.discordapp.com/attachments/852976600068784148/1092831850919104542/actualscrenshot-1.png), I want the previous one (BossfightSequence) to completely halt, and pretend that it never existed, meaning only the new events in the health reach 0 event fire.

  • So as above should work, on the event that has a trigger once you add another condition for some variable to = 0, then when the boss health drops to 0 you set that variable to 1, means it won't run that logic again.

  • Yes, but how do I make the large one stop in its tracks and just stop continuing. I assume it runs the large one once (with a lot of wait for signals). I want to completely delete that process in its tracks to stop it, because it has a lot of wait for signals, and I don't want that to stay there for next time because they might start to overlap.

  • I don't think you can stop the event in the middle like that. Better to restructure your events to suit what you want. Like I first mentioned a long string of events attached to a trigger once is not great anyway.

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