Getting started
Enable the plugin
Pulse plugins list PulseFoundation as a dependency, so enabling any of them enables PulseFoundation too. To use it from your own code, add it to your module’s Build.cs:
```csharp title=”MyGame.Build.cs” PublicDependencyModuleNames.AddRange(new string[] { “PulseFoundation” }); // For view models: “PulseFoundationMVVM”
## Send and receive a message
Messages travel on gameplay tag channels and carry any struct as payload.
```cpp title="Sending"
#include "Messages/PulseMessageSubsystem.h"
FMyChestOpenedMessage message;
message.Chest = this;
UPulseMessageSubsystem::Get(this)->Broadcast(TAG_Game_Message_ChestOpened, message);
```cpp title=”Receiving” ListenerHandle = UPulseMessageSubsystem::Get(this)->Listen
// When done UPulseMessageSubsystem::Get(this)->Unlisten(ListenerHandle);
In Blueprint, use **Broadcast Pulse Message** (payload from **Make Instanced Struct**, or leave the pin empty for a
message without payload) and **Listen For Pulse Message**.
See [Message bus](/PulseFoundation/messages.html).
## Add a player setting
```cpp title="MyGamePlayerSettings.h"
UCLASS()
class UMyGamePlayerSettings : public UPulsePlayerSettings
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, Category = "Gameplay")
bool bShowDamageNumbers = true;
virtual void DeclareSettings(FPulsePlayerSettingsDeclarer& Declarer) const override
{
Declarer.Add(GET_MEMBER_NAME_CHECKED(ThisClass, bShowDamageNumbers), TAG_Game_Setting_DamageNumbers)
.Category(Pulse::Foundation::Tags::SettingCategory_Gameplay)
.DisplayName(NSLOCTEXT("MyGame", "DamageNumbers", "Damage numbers"));
}
};
The class is found automatically. Read the value with UPulseSettingsSubsystem::GetPlayerSettings<UMyGamePlayerSettings>(LocalPlayer)->bShowDamageNumbers and react to changes with UPulseSettingsSubsystem::OnSettingChanged. See Player settings.
Look at what happens
Start PIE and open Tools > Debug > Pulse Debugger:
- Reports: processes of the plugins (save/load, sessions, requests) with every step.
- Live: the current state of every snapshot provider, per PIE server and client.
- Timeline: what happened in which order, across all plugins.
In the game, press the gameplay debugger key (apostrophe) and enable the category Pulse. See Debugging.