Platform Goals
Notifying platforms about achieving goals, missions, and completing tasks in your game.
Supported Platforms
Platforms without support
Contents
- Platform-Managed Goals
- Developer-Created Goals
- Achieving Goals for Games with Custom Backend via API
- How to Test Triggers
Platform-Managed Goals
Help the platform and its managers create goals in your game themselves.
It's difficult to account for all situations. For example, an upcoming 11.11 promotion where the platform wants to create tasks for that day:
- Kill 11 monsters in the game "Magic World"
- Collect 1111 gold in the game "Anomaly Digger"
Creating separate tasks for the number 11 is not ideal. Instead:
Prepare player variables in advance and update them daily automatically or manually.
Create player variables, for example:
- Monsters killed today
- Damage dealt today
- Gold collected today
You can also specify permanent counters:
- Total monsters killed
- Total damage dealt
- Total gold collected

This way, managers can use your variables and set their own goals on them - 11 monsters, 27 monsters, 9999 monsters killed today.
How to Create a Daily Updated Variable
In the player variable, check the box "Reset Daily".

If you use your own backend to save data and do not save data to the cloud constantly, then when a new day arrives, you can synchronize the player state to reset the variables.
- JavaScript
- Unity
// triggers when the platform day changes
gp.on('change:platformDay', () => {
// a new day on the platform has arrived
// Call sync after 5 seconds to reset the variables
// With a margin for clock discrepancy
setTimeout(() => gp.player.sync(), 5 * 1000);
});
// Subscribe to the event
private void OnEnable()
{
GP_Platform.OnChangePlatformDay += OnChangePlatformDay;
}
private void OnChangePlatformDay()
{
// a new day on the platform has arrived
// Call sync after 5 seconds to reset the variables
// With a margin for clock discrepancy
Invoke("SyncPlayer", 5f);
}
private void SyncPlayer()
{
GP_Player.Sync();
}
Developer-Created Goals
You can prepare goals for your game in advance, which platforms can also use. For example, goals like "get first profession", "reach master rank", or "raid 2 caravans today".
To create a one-time or daily goal based on cloud variables - refer to the Triggers Guide.
Achieving Goals for Games with Custom Backend via API
Through the API, you can activate triggers for any player without checking conditions.
To get started:
- Get an API key
- Create a trigger and check the box "Activate trigger only via API"
- Call the API method with the key and necessary parameters following the example below
- GraphQL (API)
The method returns success if the trigger is activated or failure on error with an error message.
How to Test Triggers
To verify functionality, it's sufficient to ensure that the trigger was activated by the player. We will then notify the platform about the activation / completion of the goal.
Re-activating a Trigger
Triggers can be activated only once or once per day.
When you need to test a trigger multiple times - you can, as an administrator, mark the trigger as not activated again.
Find your player in the control panel in the "Players" section:

Or follow the link from the "Debug Panel" in your game:

Go to the "Triggers" section, where you can manually activate / deactivate player triggers as an administrator.

Testing Next Day Arrival
If you need to test variable and trigger reset for the next day:
Go to Player in the "Reward Schedulers" section and set that the player logged in yesterday.

This way, on the next login, the system will see that the player last logged in yesterday, but not yet today, and will reset their variables and completed triggers.
Stay in Touch
Other documents of this chapter available Here. To get started, welcome to the Tutorials chapter.
GamePush Community Telegram: @gs_community.
For your suggestions e-mail: official@gamepush.com
We Wish you Success!