Publish and Subscribe to Events (PubSub)

Publish and Subscribe to events in event sheets and from the scripting interface

Publish and Subscribe to events in event sheets and from the scripting interface

Publish and Subscribe to Events (PubSub)

  • $5 USD

    Royalty Free use in unlimited commercial greater creative works.

Add to Basket
Shield

Buy With Confidence

If an asset is not as described or doesn't function properly, and the author doesn't resolve the issue for you - we will refund 100% of the cost of the asset.

Full refund policy

Releases

  • 1.1.0.4

    Released: 22 Oct, 2024

    Fixed bundling issue

  • 1.1.0.3

    Released: 22 Oct, 2024

    Added a property to the plugin to turn console logging off/on. By default the logging will be off (false).

  • 1.1.0.2

    Released: 23 Sep, 2024

    Updated to to be case insensitive with event name

  • 1.1.0.1

    Released: 12 Sep, 2024

    Updated some basic metadata fields for SDK v2 and removed a line of code that is no longer needed.

  • 1.1.0.0

    Released: 4 Sep, 2024

    Updated to SDK v2

  • 1.0.0.2

    Released: 11 Jul, 2022

    Fixed a bug when scripting functions are used after an await call

  • 1.0.0.1

    Released: 5 Apr, 2022

    A bug was identified where the scripting interface Get Event Parameter was not returning a value. This has been corrected

  • 1.0.0.0

    Released: 4 Apr, 2022

    Initial Production Release

Files Included with this Asset

File Preview

Reviews Overview

  • 5 star
    2
  • 4 star
    0
  • 3 star
    0
  • 2 star
    0
  • 1 star
    0

Publish Subscribe to Events

Overview

If you prefer working with events and being able to subscribe multiple handlers to the same event, this plugin is for you.

You have the ability to attach as many parameters to an event so that subscribers can process the event. However all parameters attached to an event are strings, so you may have to convert to and from strings to work with the data.

How to use from Event Sheets

Create Event

  1. Action - Create Event and specify an event name
  2. Action - Add parameter to include data in the event as a string
  3. Repeat the above step to include as many parameters as desired
  4. Action - Publish Event

Handle Event

  1. Condition - Create a condition to subscribe to the named event
  2. Condition - Can create subscribe conditions in multiple event sheets (Event sheets must be included for conditions to be processed)
  3. Expression - Use the get event parameter expression to access the data included in the published event to process (Parameters are referenced by the zero index, so the first item will be 0)

How to use through the Scripting Interface and Event Sheets

Create Event

Can be accessed in scripts like:

  • const pub = runtime.objects.PubSub.getFirstInstance();
  • pub._CreateEvent('test');
  • pub._AddEventParameter('item1');
  • pub._AddEventParameter('item2');
  • pub._PublishEvent();

Subscribe to events in the event sheet.

  • Follow the instructions above to subscribe to an event in the Event Sheet
waldemarlima's avatar
waldemarlima on previous version 1.1.0.2
2 months ago

Is there a discord group for support?

hi, awesome plugin, Is there a discord group for support?

Was this review helpful?
rhg1968's avatar

Response from seller

2 months ago

Thank you so much. There isn't a discord group. If you comment here I will see it and I can reach out directly after that if needed.

  • License
  • Compatibility
    Construct 3
  • Files
    1
  • Download Size
    0.07MB
  • Latest Version
    1.1.0.4
  • Latest Release Date
    22 Oct, 2024

Frequently Bought Together With

Other customers also purchased these items with Publish and Subscribe to Events (PubSub)