Resource icon

RGSS Rich Presence Integration 0.1

This script provides an easy wrapper around Discord's Rich Presence API for RPG Maker XP (maybe VX/VXa idk haven't tested them and nobody would care anyway since they're BAD).
"But what is Rich Presence??" I hear you ask... Well, Rich Presence allows you to "add beautiful art and detailed information to show off your game even more" through Discord. Sound cool? Ok, let's continue.

PLEASE NOTE: This script does not provide any Rich Presence functionality, just the capability. In the future I will be providing a starter script that provides basic information about the game state, but I encourage you to be a little creative/do my work for me.

To install, create a script section above main and insert contents of script.rb within the included ZIP file. Then add $DiscordRPC.shutdown to the last line of Main yes it's not entirely plug and play okay this is working with real developer stuff none of your plugin nonsense leave me alone

You'll also need to add the RichPresenceXP.dll file into your project's root folder, and you may also need the Visual C++ 2015 Redistributable too.

All done? Now for the setup. You're going to need a Discord account for this.

Go to this site here, log in, and hit New Application. Give it a name, preferably the name of your game, but you can change this later if you like. You'll be presented with a lovely screen with a fair amount of information, but at the moment all you care about is the Client ID. This is what you will use to interface with the API. Go back to your script section and change the constant ID to your new application's Client ID.

Later, you may have to come back to your application's page to add previously mentioned "beautiful art", but for now you can close whatever browser you're using to view it probably chrome.
To use this script, you need to do a few things:
  • Call $DiscordRPC.(parameter) = (value). There are a couple of parameters which I will cover later.
  • Call $DiscordRPC.update. This will ship all the data off to the Discord API to be displayed on your player's profiles.
It's actually surprisingly easy, like most C++ libraries once you get past the horrendously complicated setup...

There are many things you can show with Rich Presence. Some would be useless in a noncommercial fangame setting, so I haven't implemented them. The ones I have implemented are:
  • $DiscordRPC.details - String that represents what the user is currently doing. You could use this to display what the player is currently doing (e.g "Overworld").
  • $DiscordRPC.state- Another string. Discord describes this one as "The user's current party status", but you could use it for something else, like where the player is or something
  • $DiscordRPC.timestamp_start - Integer representing epoch seconds for a "game start". No idea how or why you'd use this.
  • $DiscordRPC.timestamp_end - Integer representing epoch seconds for a "game end". No idea how or why you'd use this.
  • $DiscordRPC.large_image - Name of an image you have added to your application's art assets on your Discord Developer Portal, and NOT YOUR GAME FILES. Adding these assets is fairly self explanatory, just go to your Application's page, click Rich Presence then Art Assets then Add Image(s). This image will then be displayed as your game's big image next to all the text.
  • $DiscordRPC.small_image - Same as $DiscordRPC.large_image, but it displays as a small icon near the big image.
  • $DiscordRPC.large_image_text - String representing the text that is displayed when you mouse over the large image.
  • $DiscordRPC.small_image_text - String representing the text that is displayed when you mouse over the small image.
  • $DiscordRPC.party_size - Integer representing the size of a party. Wonder how you'll use this one ha ha.
  • $DiscordRPC.party_max - Integer representing the maximum size of a party. Wonder how you'll use this one ha ha.
That's all the parameters for the Rich Presence payload I have implemented so far, might add more.

That should be all. Please tell me if you encounter any bugs like a massive memory leak because I'm not the best C++ programmer. And for all you non programmers, I am working on abase implementation that will provide basic functionality for this script, just hold on tight while I finish my exams.
Credits
Discord (Rich Presence)
Toby "sukoshijon" (The DLL wrapper around Rich Presence and the ruby wrapper around said DLL)
Author
sukoshijon
Downloads
70
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from sukoshijon

Top