Set up zeuz in Unreal Engine
This tutorial will guide you through how to set up Unreal Engine, install the Zeuzsdk Marketplace Plugin and make your first API call in Unreal, using the plugin.
You can make your first API call using Blueprints, C++, or both.
- Register and log in on the Unreal website
- Download the Epic Games Launcher
- Open Epic Games Launcher
- Select the “Unreal Engine” tab, and “Library” from the left-navigation-bar
- Click “+Add Versions”
- Select the latest stable version
- Install the Zeuzsdk Plugin into your Engine
- In the Epic Games launcher, go to the Marketplace and search for the Zeuzsdk SDK
This is an example to use the Zeuzsdk within Blueprint, it will log in into the backend which is necessary for further API calls.
- In the editor toolbar open Blueprints → Open Level Blueprint
- Connect to the existing Event Begin Play node the Zeuzsdk → Auth → SimpleAuthLogin.
- Enter the username and password from the zeuz control panel
- Use the Endpoint: https://zcp.zeuz.io/api/v1
- Enter the Proj ID and Env ID which you want to work with from the zeuz control panel
Since the API call is asynchronous the immediate output of the login node will not bear any results, instead these will be delivered by events.
- Create a custom event on the On Success pin and attach a Print String to show the now logged in Developer ID
- Create a custom event on the On Failure pin and attach a Print String to show the Error
Finally start the blueprint with the play button and the result is shown in the game window.
Calling this function from C++ is equivalent to the Blueprint version, except the output is printed to Output instead of the screen.
- The Proj ID and Env ID from the zeuz control panel are saved in the default Context
- Username and password are entered into the authentication input struct
- A callback delegate is bound which will be invoked with the result of the API call
- The API function AuthLogin is called.
Install the OnlineSubsystemZeuz from the marketplace or https://sdk.zeuz.io/
Add OnlineSubsystem and OnlineSubsystemZeuz to your ProjectName.Build.cs
Activate the OSS in your Config/DefaultEngine.ini and configure your ProjID and EnvID
Now you can use the OnlineSubsystem in you project.
A context contains a reference to a Project and Environment also it contains a logged in session.
In most cases only one context is needed therefore exists the default context
Omitting the context will use the default context
Blueprint API functions have additional On Success and On Failure delegates for convenience but Callback is called in both cases
The login can be done with a developer login, a user login or an Apikey and its corresponding password
A session expires after 24h but the SDK can automatically relogin it
2021-jun-30 Page updated: updated url for ZCP