API / Registering your namespace

If you want to register your custom achievements with LibCustomAchievement, the first think you'll need to do is register a namespace for your achievements.

local achievementNamespace = LibStub("LibCustomAchievement-1.0"):RegisterNamespace(namespaceLabel, namespaceTable)


namespaceLabel string

Unique label for the namespace. This will also be the name of the category of your achievements in the achievements panel and used in the achievementIDs for your achievements. Try not to use too many special characters (_ followed by a number is forbidden since that's the form achievement IDs use, the pipe character (|) and dollar sign ($) might break stuff with inter-library communications. Spaces should be fine, periods and commas too.

namespaceTable table

This table will be used to store all achievement information for your achievements. Storing this table is the responsibility of the addon registering the achievements - pass the same table on every call to RegisterNamespace. The type of savedVar used here also determines whether LCA achievements are per-character or per-account (SavedVariables make them per-account, while SavedVariablesPerCharacter make the per-character for obvious reasons).

Return values

namespace table The namespace table you will call the rest of the library's methods on. Try not to mess around with it's sub-tables and use the provided API instead.

You must login to post a comment. Don't have an account? Register to get one!


Date created
Oct 22, 2011
Last updated
Oct 22, 2011