• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

[SOLVED] Having Trouble Triggering an Event

S

SgtMoose

Guest
Hello Everyone!

I am having trouble triggering an event after the final boss of my game is defeated.

Basically, what I want to do is display a "BOSS DEFEATED" message after the final boss is defeated. I created a controller called "boss_timing_controller" that looks like this:
Screenshot (25).png
This calculates at every step if the instance count of the boss is zero. The first phase includes one singular object, while the second phase is a dual boss fight in which there are two bosses to defeat. Once the boss in its first and second phase has been defeated, it triggers the alarm event.

Screenshot (24).png
Screenshot (23).png

But whenever I run the game, the message does not display. Please help!

Thanks to everyone in advance!
 

Attachments

FrostyCat

Member
You are constantly resetting that alarm back to 90 without giving it a chance to tick down, this is a common novice problem.

Any time you notice that an alarm can be set on consecutive steps, stop and think whether this resetting behaviour is wanted. If it isn't, you need to figure out what condition breaks it. Generally checking whether the alarm is less than 0 (i.e. not set) works, but sometimes other conditions are more appropriate.

In your case, check that alarm[0] is less than 0 before setting it again.
 
Top