Basket icon
0
Your basket

Empty Basket

Toaster

Explore our store and support our creators

Total
$0.00
Go to checkout

Publish and Subscribe to Events (PubSub)

Avatar
Sold by rhg1968
5 Star icon 2 reviews
Last Update Oct 2024
5 favoris

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

Full size
  • Gallery thumbnail
  • Gallery thumbnail
  • Gallery thumbnail
  • Gallery thumbnail
  • Gallery thumbnail
Next

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

Buy With Confidence

Buy with us and we will refund 100% of the cost of the asset if it's non-functional or not as described and the author doesn't fix the issue for you in a timely manner.

Full refund policy

Explore Included Files

PubSub.zip
0.07MB
  • PubSub.c3addon
    69.81 KB

File Preview

Preview images have been blurred, resized and watermarked. Audio sample is watermarked and down-sampled

2 Reviews

  • thetnswe's avatar
    thetnswe
    2 years ago

    Nice and east

    It's the only way to use it communicating between the JavaScript and visual scripting. The seller response very quickly when reporting about an error and I strongly recommended to use this package if you're into JavaScript beside the built-in visual scripting tools.

    Was this review helpful?
    rhg1968's avatar
    Seller Reply
    2 years ago

    I have an email listed on my seller profile of robhg68@yahoo.com

    If you reach out I will be more than happy to look into the issue and get it resolved for you.

    Also, thank you soooo much for the 5 star review.

    Update the fix has been posted. Version 1.0.0.2

  • waldemarlima's avatar
    waldemarlima
    3 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
    Seller Reply
    3 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.

  • $5 USD
    Royalty Free use in unlimited commercial greater creative works.
Add to Basket
  • License
  • Compatibility
    Construct 3
  • Files
    1
  • Download Size
    0.07MB
  • Latest Version
    1.1.0.4
  • Latest Release Date
    22 Oct, 2024

Reviews

  • 5 star
    2
  • 4 star
    0
  • 3 star
    0
  • 2 star
    0
  • 1 star
    0
waldemarlima's avatar
waldemarlima
3 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
Seller Reply
3 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.

Share now

Frequently Bought With

Next