demo--about1

Before you can use achievements

You need to configure achievements on your website

Steps to configure an achievement

Create a new achivement

First click on "All Achievements" in the dashboard under the GAMING heading then click on "Add new"

Configure the basics

On the window that appears:

  1. enter a name for the achievement in the Post Title slot
  2. Set the image to show once the achievement is unlocked by setting the featured image
  3. Set the image to show while the achievement is still locked by clicking on the "Locked icon" button
  4. In the post body, enter the description people will see when the achievement is unlocked
  5. In the Excerpt section, enter instructions for how to unlock the achievement
  6. Your achievement is now ready Click on publish
Configure requirements (optional)

Achievements can have between 0 and unlimited requirements to unlock. Each requirement consists of 3 fields:

  1. The required test
  2. The name of the key to test (string)
  3. 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:

  1. Must have at least X keys
  2. Must have less than X keys
  3. 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:

  1. The player must have a reputation of at least 5 
  2. and may only have suffered defeat a total of 2 times so far in the game
  3. 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.

Unlocking Keys

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:

  1. HasExactly(FString Key, int32 Qty)
  2. HasAtLeast(FString Key, int32 Qty)
  3. 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.