Icon

Custom Event Triggering

NPC

You must be logged in to obtain assets

Description

Once you try it, you will never not use it!

Code is all GML and will run on any platform.

Working in Game Maker, you are exposed to many different built in events. There are many different to choose from: OnClick, KeyPress, Step. However, these events are triggered by the engine and not by you. My system works basically the same way; Register code to an event that will be ran whenever the event is triggered. Following this pattern, it is very easy to organize the code for each event and greatly aids debugging.

A simple example is increasing the power of all players on a team when one collects a power-up. When the game starts, a power-up event is created. As each player is created, they register their unique power-up script to the event. When a player collects the power-up, the event is triggered and each player's power-up script is executed.

My system allows the code execution to be prioritized and ran in any order desired. It also allows data to be passed to each script when triggering.

Sample Event:

  1. Create event
  2. Register script1 to event
  3. Register script2 to event
  4. Trigger event

Results: script1 and script2 are both ran

Check out my other marketplace listings

Stat Panel

Speech Bubble

All Listings

Thanks for viewing!

End User Licence Agreement (EULA).

Age Rating: 4+

Version

GMS1 - Version 1.1.0. Published August 25, 2015

Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait