moymo,Docs
Skip to content
Games: the Moymo SDK

Unity ​

Unity 2022.3 or Unity 6, on Windows. You do not need a terminal: everything is in Window > Moymo.

  1. Add the packages. In your game's Setup tab in the Developer Portal, download the packages and save them in your project's Packages folder, so they travel with the project. Then in Unity: Window > Package Manager, the + button, Add package from tarball…. Pick Core first, then the ones you want: Presence, Moments, Achievements.
  2. Window > Moymo. Click Sign in with Moymo (your browser asks you once), then Create moymo.toml with the app key that the Setup tab shows. moymo.toml appears next to your Assets folder, with one event, one moment and one presence line to start from.
  3. Push to the sandbox. This checks moymo.toml, writes the C# you call (Assets/Moymo/Moymo.g.cs) and uploads the file. Push again after every change to moymo.toml.

Calling it ​

csharp
using Moymo;
using Moymo.Game;

MoymoManifest.Start();                             // once, at start-up
Signals.Emit(new Ev.LevelFinished { Level = 3 });  // its moment, and the clip, follow from moymo.toml
Presence.Set(Rp.Playing(level: 3));                // when it changes, not every frame
Presence.Clear();

Moments.Mark(Moment.LevelFinished(level: 3));      // by hand; one with `on` follows its event by itself
Achievements.Unlock(Ach.FirstBanner);
Stats.Put(Stat.Population, 14);                    // stats with rules unlock achievements by themselves

Ev, Rp, Moment, Ach and Stat are generated from moymo.toml. A name that is not in the file does not compile. A value outside its range (int(1..)) is refused, and the refusal is written to Unity's console.

Play mode and builds ​

  • In Play mode the game talks to the emulator. Click Open the emulator in Window > Moymo: it prints everything the game sends.
  • A build talks to Moymo for Windows. The first time it starts, the player is asked what to allow.

Steam ​

Give an achievement its Steam name (steam = "ACH_FIRST_BANNER") and call Achievements.UseSteamworksNet() once, after the game has started Steam (Steamworks.NET). Every unlock then reaches Steam too: the ones from Achievements.Unlock, and the ones a rule or an event makes.

Going live ​

Push the live version in Window > Moymo, then follow the Go live tab in the portal. See Sandbox, testers and going live.

The wiki is for Moymo's members and developers. Something wrong or missing? Use "Suggest a change" on any page.