Unreal Engine
Unreal Engine 5 on Windows, in a C++ project. If your project is Blueprint only, give it C++ once with Tools > New C++ Class. After that, the Blueprint nodes work too.
The plugin ships as source and builds with your project. It is built against Unreal Engine 5.5.
- Add the plugin. In your game's Setup tab in the Developer Portal, pick Unreal Engine and download Moymo plugin for Unreal Engine (
moymo-sdk-unreal-<version>.zip). Unzip it into your project's folder. TheMoymofolder goes intoPlugins(make the folder if there is none), andmoymo.exegoes next to your.uproject. - Depend on it. In
Source/<YourGame>/<YourGame>.Build.cs, add the module:csharpPublicDependencyModuleNames.Add("Moymo"); - Create moymo.toml and push it. Open a terminal in the project's folder. In File Explorer, click the address bar, type
powershelland press Enter. Then run one command at a time:bash./moymo login ./moymo init --app <your app key> ./moymo pushmoymo initsees the.uprojectand points the generated code atSource/<YourGame>/Moymo.g.h.moymo pushwrites that header and uploadsmoymo.tomlto your sandbox. Push again after every change tomoymo.toml. - Start it. Once, for example in your
GameInstance'sInit():cpp#include "Moymo.g.h" #include "MoymoSubsystem.h" moymo::game::Start(moymo::Environment::Sandbox, UMoymoSubsystem::DefaultConnection());
The plugin pumps the SDK every frame and stops it when the game ends. You do not need to do either.
From C++
cpp
moymo::Emit(moymo::game::Ev::LevelFinished{3}); // its moment, and the clip, follow from moymo.toml
moymo::Presence::Set(moymo::game::Rp::Playing(3)); // when it changes, not every frame
moymo::Presence::Clear();
moymo::Moments::Mark(moymo::game::Moment::LevelFinished(3));
moymo::Achievements::Unlock(moymo::game::Ach::FirstBanner);
moymo::Stats::PutInt(moymo::game::Stat::Population, 14);This is the same API as in C and C++. The plugin's log category is LogMoymo: refusals and the SDK's own lines go there.
From Blueprints
The Moymo category has a node for each call. Each node takes names exactly as written in moymo.toml:
| Node | What it does |
|---|---|
| Emit Event | An event by name, with its fields in three maps: whole numbers, decimals and flags. An event with an enum field has to be emitted from C++. |
| Set Presence / Clear Presence | A presence line by name. Whole numbers go in one map, list symbols (enum(@list)) in another. |
| Mark Moment | A moment by name, with whole-number fields. |
| Unlock Achievement | By name. |
| Put Stat Int / Put Stat Float / Put Stat Flag / Add To Stat | A stat by name. Add To Stat adds a member to a set. |
| Is Running | Whether the SDK has started. |
A node returns false and writes the reason to LogMoymo in three cases: the name is not in moymo.toml, a field is missing, or Start was not called from the generated header.
Editor and packaged game
- In the editor (Play In Editor),
UMoymoSubsystem::DefaultConnection()is the emulator. Run./moymo devfirst, and it prints everything the game sends. - A packaged game talks to Moymo for Windows. The first time it starts, the player is asked what to allow. The build copies
moymo.dllnext to the game's executable. If the DLL is missing, the plugin logs one warning and every call does nothing.
Steam
The Unreal plugin does not unlock achievements on Steam yet. Unlock them on Steam yourself, as you do today (for example through the Online Subsystem Steam). Plain C++ engines have a built-in Steam mirror; see C and C++.
Going live
Run ./moymo push --env live, have the release build start with moymo::Environment::Live, then follow the Go live tab in the portal. See Sandbox, testers and going live.