This record describes API changes in 1.9 RC 1.

Achievements

Starting in API 53 you can define achievements. Currently this only works for official Steam achievements, but eventually we will allow any mod to create Multiverse achievements.

Definitions

Any design type may define achievements:

<Type unid="...">
   <Achievements>
      <Achievement id="..."
         minDifficulty="..."
         sortOrder="..."
         hidden="..."
         >
         <Image ...>
      </Achievement>
   </Achievements>
</Type>

The following parameters are defined:

  • id: The achievement ID must be globally unique. We recommend that we prefix your IDs with your extension UNID (or some other unique ID).
  • minDifficulty: If specified, this indicates that the achievement is only triggered if the player is playing with the given difficulty level or higher. If not specified, then the achievement can be triggered at all difficulty levels.
  • hidden: If set to true, then this achievement is not advertised.
  • sortOrder: This is an internal string used to display achievements.

In addition, the text associated with achievements is specified as language elements with matching IDs. We use the achievement ID suffixed with .name and .desc to define the name and description of an achievement.

For example, if we have an achievement with ID myAchievement, we expect the following language elements:

...
<Language>
   <Text id="myAchievement.name">Achievement Name</Text>
   <Text id="myAchievement.desc">Do the following to achieve this.</Text>
</Language>
...

Trigger

Achievements are triggered with a special function:

(unvSetAchievement id) -> True/Nil

Achievements may only be triggered from the extension that defined the achievement. I.e., it is not possible for an extension to trigger an achievement defined in core or in a different extension.

The same achievement can be triggered multiple times; the engine will keep track of whether an achievement has already been achieved.

TLisp

New Properties

  • events.system: Returns a list of registered system events for this object. This is mostly for debugging.