Before you can use achievements
Steps to configure an achievement
- Create a new achivement
- Configure the basics
- Configure requirements (optional)
- Unlocking Keys
First click on "All Achievements" in the dashboard under the GAMING heading then click on "Add new"
On the window that appears:
- enter a name for the achievement in the Post Title slot
- Set the image to show once the achievement is unlocked by setting the featured image
- Set the image to show while the achievement is still locked by clicking on the "Locked icon" button
- In the post body, enter the description people will see when the achievement is unlocked
- In the Excerpt section, enter instructions for how to unlock the achievement
- Your achievement is now ready Click on publish
Achievements can have between 0 and unlimited requirements to unlock. Each requirement consists of 3 fields:
- The required test
- The name of the key to test (string)
- The amount to test against (int)
Once you have selected an option from the first drop down the requirements should be read as one of the following three sentences:
- Must have at least X keys
- Must have less than X keys
- Must have exactly X keys
In the first case, if you have the required number of keys or more then the test returns true.
In the second case, if you have the required amount of keys or more then the test returns false,
In the last case, the test returns true only if you have exactly that number of keys.
In the included image we have specified that to obtain this particular achievement, 3 requirements need to be met:
- The player must have a reputation of at least 5
- and may only have suffered defeat a total of 2 times so far in the game
- and the player must currently be at level 18
All requirements need to be true before the achievement will qualify to be unlocked.
Keys can be any string but must not be a number.
The WPGameKeys subsystem contains the functions:
- ObtainGameKeys(FString Key, int32 Qty)
- DiscardGameKeys(FString Key, int32 Qty)
Use these two functions to modify the player's game keys.
If you wrote a function to periodically poll achievements to see if they meet the online requirements, use the following functions to test the number of game keys a player has:
- HasExactly(FString Key, int32 Qty)
- HasAtLeast(FString Key, int32 Qty)
- HasLessThan(FString Key, int32 Qty)
Manually Award achievements
Once an achievement has been created you can manually assign it to a player by selecting the player and clicking on the “Receive” text. This will bypass all requirements.
Manually revoke achievements
To revoke an achiviement, simply select the player from the dropdown and click on the “Remove” text on the achievement you want to revoke. Note that if this achievement has requirements that are met the achievement will be awarded again when next the player’s achievements are polled.