Note: See release notes below:
This plugin allows a pseudo event system to be utilized in a Construct 3 project. What this means is that you can have an event generated, along with a message to pass along, and you have can one or more events listening for this event and perform different tasks.
This gives you the ability to essentially create a publish and listen structure to create a little better encapsulation in your projects.
To see how to use this, please look at the included sample project. That shows how to have an included event sheet generate an event, but the multiple parent event sheets respond differently to the event. You could also listen for the event in more than one loaded event sheet and perform different actions.
- On an event sheet that is going to listen for an event you must make sure that the listening event sheet is included directly or indirectly to the current layout. This is normal for how triggers work in general.
- Capitalization matters, whatever capitalization is used to send an event, the listeners must match to catch the event. Note: I may change this in a future version.
Major rewrite of the internals of this plugin. The plugin is now very performant for larger projects, does not rely on the tick event anymore, and takes advantage of how triggers work to perform very efficiently.
You now have the ability to add multiple items to the message that gets sent and picked up by a handler.
- In order to support backward compatibility, the expression LastEventMessage has been deprecated, but if it's your project already it will only return the first message item.
- Going foward you will need to use the expression GetEventMessageAt(index), where index is the zero based index of the message item you want to look at.
- A new expression called GetEventMessageItemCount has been added to get a count of the number of items in a message.
- If you try an access an index that doesn't exist, you will just get an empty string back
The included example has been modified and will only work with this version going forward.