Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 2.8 KB

README.md

File metadata and controls

57 lines (38 loc) · 2.8 KB

Discord-UE4

Plugin for integrating Discord Rich Presence in Unreal Engine 4. Blueprints only example project is available here.

GitHub

Rich Presence Result

How to

First you will need to download the binaries from Discord. Head over to Discord Developer Portal and download Discord Game SDK.

SDK_Download

And download last build plugin.

After downloading, open the zip file and extract the .dll and .lib files from the lib/x86_64 folder to Binaries/Win64/ folder of this plugin. If you don't have Binaries/Win64 folder, create it. Example of my setup:

Extracted Example

After copying the binary files, open the cpp folder inside the zip file and extract all the contents to Source/DiscordUE4/discord-files folder. If the discord-files folder doesn't exist, create it.

Now you are good to go.

It is important to setup your game according to Discord Startup Guide.

Example Setup: Example Setup in Blueprint

Compile error when using as Engine Plugin

In Windows, with the latest SDK there are chances you might encounter compile errors when using this plugin as an Engine plugin. You might see the following errors:

warning C4005: 'TEXT': macro redefinition
error C4668: '_WIN32_WINNT_WIN10_TH2' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
error C4668: '_WIN32_WINNT_WIN10_RS1' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
error C4668: '_WIN32_WINNT_WIN10_TH2' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
error C4668: '_WIN32_WINNT_WIN10_TH2' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
error C4668: '_WIN32_WINNT_WIN10_RS2' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
error C4668: '_WIN32_WINNT_WIN10_RS2' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
...

This is because of including windows.h header file in Discord files. To fix it follow the steps below:

1: Open ffi.h and replace

#include <Windows.h>

with this:

#include "Runtime/Core/Public/Windows/AllowWindowsPlatformTypes.h"
#include "Runtime/Core/Public/Windows/MinWindows.h"
#include "Runtime/Core/Public/Windows/HideWindowsPlatformTypes.h"

2: Open types.h and remove #include <Windows.h>

Both files can be found under discord-files folder.