Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

SignalPrinter

An asset by Duke
The page banner background of a mountain and forest
SignalPrinter thumbnail image
SignalPrinter thumbnail image
SignalPrinter thumbnail image
SignalPrinter hero image

Quick Information

0 ratings
SignalPrinter icon image
Duke
SignalPrinter

Plugin for monitoring signals of a global EventBus singleton.While creating Godot projects, developers often use a global signal script, a singleton, which houses only signals needed for unrelated systems to talk to each other. These scripts go by names like EventBus, MessageBus, Signalton, etc. One downside these scripts often have is the inability to see under the hood, as there isn't an easy way to monitor multiple signals being emitted. Developers often have to resort to using print() statements on each end of the signal path.This plugin adds a SignalPrinter node, which automatically connects to all signals of your global EventBus and routes them to a method, which prints the signal's name, all arguments and (optionally) the time at which the signal was recieved.

Supported Engine Version
4.2
Version String
1.0
License Version
Unlicense
Support Level
community
Modified Date
9 months ago
Git URL
Issue URL

SignalPrinter

README

Plugin for monitoring signals of a global EventBus singleton.

While creating Godot projects, developers often use a global signal script, a singleton, which houses only signals needed for unrelated systems to talk to each other. These scripts go by names like EventBus, MessageBus, Signalton, etc. One downside these scripts often have is the inability to see under the hood, as there isn't an easy way to monitor multiple signals being emitted. Developers often have to resort to using print() statements on each end of the signal path.

This plugin adds a SignalPrinter node, which automatically connects to all signals of your global EventBus and routes them to a method, which prints the signal's name, all arguments and (optionally) the time at which the signal was recieved.

Example output:

player_interacted
with : Node3D = Pickup:<Area3D#41657828805> // The type is the same as was declared in the signal itself
time (ticks msec) = 4647

inventory_item_changed
item : Item = <Resource#-9223371996253911657> // It even recognizes custom Resource types (Item)
index : int = 1 // And has support for Variant types
time (ticks msec) = 17442

README Example output screenshot

Usage

You need to replace global_bus in signal_printer.gd script with your own singleton's reference. Otherwise you get an error.

Example

If your global bus is named EventBus, you simply replace null with EventBus

From:
static var global_bus : Node = null :x:

To:
static var global_bus : Node = EventBus :heavy_check_mark:

You pass the singleton in directly, not by its name.
static var global_bus : Node = "EventBus" :x:

After that, you can add this node anywhere in the scene and remove it, when you don't need it anymore.
README Node in scene README Node properties

Warning

As GDScript currently doesn't support variable argument count, arguments in the function are added manually. Currently, the max argument count per signal is 10, but if you need more, you can add them easily.

Further reading

How to create an EventBus in Godot
Theory behind the Observer pattern

Plugin for monitoring signals of a global EventBus singleton.

While creating Godot projects, developers often use a global signal script, a singleton, which houses only signals needed for unrelated systems to talk to each other. These scripts go by names like EventBus, MessageBus, Signalton, etc. One downside these scripts often have is the inability to see under the hood, as there isn't an easy way to monitor multiple signals being emitted. Developers often have to resort to using print() statements on each end of the signal path.

This plugin adds a SignalPrinter node, which automatically connects to all signals of your global EventBus and routes them to a method, which prints the signal's name, all arguments and (optionally) the time at which the signal was recieved.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
SignalPrinter icon image
Duke
SignalPrinter

Plugin for monitoring signals of a global EventBus singleton.While creating Godot projects, developers often use a global signal script, a singleton, which houses only signals needed for unrelated systems to talk to each other. These scripts go by names like EventBus, MessageBus, Signalton, etc. One downside these scripts often have is the inability to see under the hood, as there isn't an easy way to monitor multiple signals being emitted. Developers often have to resort to using print() statements on each end of the signal path.This plugin adds a SignalPrinter node, which automatically connects to all signals of your global EventBus and routes them to a method, which prints the signal's name, all arguments and (optionally) the time at which the signal was recieved.

Supported Engine Version
4.2
Version String
1.0
License Version
Unlicense
Support Level
community
Modified Date
9 months ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers