Skip to content

CusYaBasic/DiscordRPC

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord plugin for Unreal Engine 5

This plugin is designed for users of Unreal Engine 5. It will help you to create a discord presence for your game like this :

ExampleFeed

Credits

  • LouisRaverdy (OP: https://github.com/LouisRaverdy/DiscordRPC)
    • Base plugin with Discord SDK intergation
  • Lewis/CusYaBasic (Me)
    • 5.3 update
    • Fix type error with TimeStamps
    • Added GetStartTimeStamp function
    • Created DiscordGameInstance class
    • Combind initial setup into one node SetDiscordPresence
    • various minor fixes

Installation

  1. Dowload this repostory
  2. Extract the repo
  3. Copy all content to your plugin project (YourProject/Plugins)
  4. Make sure you are register on Discord developer website
  5. Create your application and copy your Application ID
  6. Open your project and enable the plugin

Initialization 5.2

Version 5.2 has changed a little bit. it now has DiscordGameInstance class which handles most of the logic for you; streamlining the process, making it much faster to get up and running.

  1. You need to inherit your GameInstance class from DiscordGameInstance:

image

1.B) If you're using unreals default GameInstance You'll need to create your own and inherit it from DiscordGameInstance then set your project to use that class in your project settings:

image

image

image

I called my instance I_GameInstance (but just set it to whatever yours is called):

image

  1. Now that we are inheriting from DiscordGameInstance, we can set out App IDs. Simpily override event init and call SetAppIDs while passing your IDs into the params:

Note : AppID IS REQUIRED, Steam is OPTIONAL

image

Set Basic/All Presence

There are two ways of setting presence, SetBasicPresence and SetAllPresence; Basic sets just the need to know features, lick icon, state, details and time elasped. Whereas - All sets all values that are in the DiscordPresence struct. So anytime you need to update the presence info call any of these nodes:

image

Set Discord Presence

Finally, once we have set our basic/all presence we can send it to the discord API using SetDiscordPresence:

image

SetDiscordPresence also has a clear function build into it to clear the presence during runtime if you need to switch it when you switch maps/activities:

image

Deprecated

Shutdown:

You'll no longer have to override event Shutdown as this is already done in code for you:

image

Start and End Timpstamps:

You no longer have to manually set timestamps, this gets handled for you in the DiscordGameInstance class

image

image

There was also a issue with mismatched types for timestamps which caused the plugin to not work in packaged builds which has now been fixed also.

About

Updated DiscordRPC plugin with changes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 92.4%
  • C# 7.4%
  • C 0.2%