Skip to content

rc_client_get_achievement_info

Jamiras edited this page Jun 28, 2023 · 4 revisions

Get information about an achievement.

Syntax

const rc_client_achievement_t* rc_client_get_achievement_info(
    rc_client_t* client,
    uint32_t id
);

Parameters

client

The rc_client_t containing a loaded game.

id

The unique identifier of the achievement to retrieve information about.

Return value

A pointer to the achievement information, or NULL if not found.


rc_client_achievement_t

typedef struct rc_client_achievement_t {
  const char* title;
  const char* description;
  char badge_name[8];
  char measured_progress[24];
  float measured_percent;
  uint32_t id;
  uint32_t points;
  time_t unlock_time;
  uint8_t state;
  uint8_t category;
  uint8_t bucket;
  uint8_t unlocked;
} rc_client_achievement_t;

title

The title of the achievement.

description

A short summary of the requirements for unlocking the achievement.

badge_name

The unique identifier of the image associated to the achievement. See also rc_client_achievement_get_image_url.

measured_progress

A string summarizing the user's progress towards completing an achievement that supports progress tracking (i.e. 6/15 or 40%). Will be empty string if achievement doesn't support progress tracking, or no progress has been made.

measured_percent

The raw percentage of progress completed (0.0-100.0). Used for filling progress bars. Will be 0.0 if achievement does not support progress tracking.

id

The unique identifier of the achievement.

points

The number of points the achievement is worth.

unlock_time

The time when the achievement was unlocked (if known), otherwise 0.

state

The current state of the achievement.

state description
RC_CLIENT_ACHIEVEMENT_STATE_INACTIVE The achievement hasn't been processed yet.
RC_CLIENT_ACHIEVEMENT_STATE_ACTIVE The achievement is eligible to trigger.
RC_CLIENT_ACHIEVEMENT_STATE_UNLOCKED The user has unlocked this achievement.
RC_CLIENT_ACHIEVEMENT_STATE_DISABLED The achievement is not supported by this version of the runtime, or references a memory address that failed to be read.

category

The category of the achievement.

category description
RC_CLIENT_ACHIEVEMENT_CATEGORY_CORE The achievement has been published and is eligible to be earned by players.
RC_CLIENT_ACHIEVEMENT_CATEGORY_UNOFFICIAL The achievement is not currently eligible to be earned by players.

Unofficial achievements are only activated is rc_client_set_unofficial_enabled was called to enable them.

bucket

A secondary classification of the achievement for rc_client_create_achievement_list grouping via RC_CLIENT_ACHIEVEMENT_LIST_GROUPING_PROGRESS.

unlocked

Bitflags representing whether the user has unlocked the achievement in hardcore (RC_CLIENT_ACHIEVEMENT_UNLOCKED_HARDCORE), softcore (RC_CLIENT_ACHIEVEMENT_UNLOCKED_SOFTCORE), or both.

To detect if the user has unlocked the achievement for the currently specified hardcore state (see rc_client_set_hardcore_enabled), check for state == RC_CLIENT_ACHIEVEMENT_STATE_UNLOCKED.

Remarks

measured_progress, measured_percent, and bucket are recalculated on demand (when rc_client_get_achievement_info or rc_client_create_achievement_list is called, or when the achievement is passed to an event handler). If you store a reference to the rc_client_achievement_t, those fields may become stale.

Minimum version: 11.0.0

See also

rc_client_achievement_get_image_url

rc_client_create_achievement_list

rc_client_get_game_info

rc_client_get_leaderboard_info

rcheevos

rc_client

Integration guide

client

user

game

processing

rc_client_raintegration

Integration guide

rc_runtime

rhash

rapi

common

user

runtime

info

Clone this wiki locally