Skip to content

Gaimin-io-Limited/unreal-engine-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Gaimin SDK

Gaimin SDK is an Unreal Engine plugin that acts as a simple interface to our product API and enables users to communicate with the Gaimin backend from inside Unreal Engine using Blueprints.

Installation

To install the plugin, simply unpack the archive into the Plugins folder (create it if it doesn’t exist) inside the project’s root directory. The resulting file hierarchy should be similar to this:

ProjectRoot/
├── ...
├── Plugins
│   └── GaiminSDK
│       ├── GaiminSDK.uplugin
│       └── Source
|           └── ...
└── ...

Usage

To test the plugin’s functionality, create a new Blueprint class

1

of type “Actor”

2

and drag-n-drop it into the scene

3

To start scripting, double click the newly created blueprint. The Event Editor will open in a new window. Right clicking the empty space in the Event Graph tab shows all available blueprints. Blueprints provided by the plugin are located in the “Gaimin” section:

4

Clicking on any item will create the corresponding blueprint. There is a single blueprint for each API call:

5

To issue an API call we need to connect a blueprint to an event, in response to which it will execute, and provide the required arguments. For testing purposes, we can use a default “BeginPlay” event that is fired at the start of the game. Here’s an example configuration to get a public key from the Gaimin server:

6

The way it works is, at the start of the game we issue an API call and use the “On Success” blueprint to fire an event when the response is received. The event contains the JSON value of the response which we can convert to object and use in any way we want.

For example, to print the response on the screen, we can do the following:

7

This example is similar to the previous one, except that the received JSON value is converted to a string and printed to the screen using the “Print String” blueprint. It should look similar to this:

8

As another example, here’s how to retrieve the player’s token:

9

This API call requires an argument (Bearer token) which can be provided by either by pasting the literal text in the input box, or connecting a string input from another blueprint. After the response is received, it is possible to take its fields by using the “Get Object/String/Number” blueprints.

This way, we can, for example, display the user’s GMRX balance on the screen like this:

10 11

The last two API blueprints are “Player Tokens” and “Player Tokens Raw” which work in the same way but send responses in different formats. In addition to a player token, they also require the product Id and a list of comma-separated chains. Again, we can simply print the response to test the blueprints:

12 13

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published