Description

DispatchGMS provides an easy-to-use framework for dynamic dispatching of script callbacks. This enables greater flexibility by allowing, at runtime, for the creation of custom events and the extension of GameMaker object events.

[Features]

  • Dynamically add or remove dispatcher script callbacks
  • Pass variable number of arguments to script callbacks
  • Option to override script callback arguments when invoking dispatchers
  • "Dynamic Event" scripts allow you to easily adapt dispatchers to GameMaker object events
  • Ability to suppress/mute dispatchers or callbacks
  • Various ways to remove callbacks (callback id, script id, target id, all)

[Script Reference]

http://stephenloney.byethost31.com/DispatchGMS/DGMS_Script_Reference.html

[Basic Code Example]

/// [Create Event]
// Create new dispatcher for custom mouse event
onMousePress = DispatcherCreate();

// Add script callbacks to dispatcher
DispatcherAdd(onMousePress, id, ShowMessage, "Mouse Button was pressed!");
cbAddNums = DispatcherAdd(onMousePress, id, ShootTargets, obj_Enemy, obj_Barrels);

// Remove second callback from dispatcher
DispatcherRemove(onMousePress, cbAddNums);

/// [Mouse Button Press Event]
// Execute dispatcher
DispatcherInvoke(onMousePress);

/// [Destroy Event]
// Destroy and nullify dispatcher
DispatcherDestroy(onMousePress);
onMousePress = DispatcherNull();

/// [Room End Event]
// Destroy and nullify dispatcher
if (persistent == false && room_persistent == false)
{
    DispatcherDestroy(onMousePress);
    onMousePress = DispatcherNull();
}

Be sure to check out some of my other assets!

  • TweenGMS
  • ScheduleGMS
  • Steady Delta Time

End User Licence Agreement (EULA).

Version 1.0.0. Published August 15, 2014

Created with GameMaker: Studio v1.4.1398

Age Rating: 4+

Average Rating

Your review

You can only review assets you've bought.


Gravatar

Anonymous 14 October 2018


Gravatar

Corey M 19 September 2018

Fantastic addition to GMS2

DispatchGMS is an absolutely fantastic addition to GMS2. As a software developer by trade, I work primarily with code rather than DnD or directly with objects whenever possible, and the lack of true OOP in GML can really limit the possibilities with regards to program architecture. Having something akin to traditional event emitter such as this extension provides has made my code much, much cleaner. Thanks Stephen Loney!

Logo

Stephen Loney (Publisher) 26 September 2018

Awesome to hear that DispatchGMS has benefited you. Thanks for the review!


Gravatar

Anonymous 19 September 2018


Gravatar

davide m 21 April 2015

Unique!

I downloaded/bought many assets from the MP, but i haven't found anything vaguely similar to this. It expands what you can do with GM in a very brilliant way. This publisher deserves more attention!

Package contents

Loading, please wait

What is the issue?

Back to Top