errors and warnings / stdlib / E8117
E8117 error
profiles = true on a per-character SavedVariable
- area
- stdlib (x8xxx)
- fails the build
- yes
profiles = true was given for a per-character SavedVariable. Profiles let
characters share setups, so they need an account-wide SavedVariable; the
active profile of each character goes into <name>PerChar.
Bind an account-wide SavedVariable (addon.saved-variables) with profiles, and
add its <name>PerChar to addon.saved-variables-per-character.
Example
{ "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" }, "flavors": { "camelot": {} }, "addon": { "saved-variables-per-character": ["MyAddonCharDB"] }}import * as saved from "wowlua:saved"local db = saved.bind("MyAddonCharDB", { version = 1, defaults = {}, profiles = true })print(db){ "package": { "name": "playground", "version": "0.1.0", "wowlua": "^0.13" }, "flavors": { "camelot": {} }, "addon": { "saved-variables": ["MyAddonDB"], "saved-variables-per-character": ["MyAddonDBPerChar"] }}import * as saved from "wowlua:saved"local db = saved.bind("MyAddonDB", { version = 1, defaults = {}, profiles = true })print(db)The compiler reports it like this:
error[E8117]: `MyAddonCharDB` is per character: profiles need an account-wide SavedVariable ┌─ src/main.wowlua:2:23 │ 2 │ local db = saved.bind("MyAddonCharDB", { version = 1, defaults = {}, profiles = true }) │ ^^^^^^^^^^^^^^^ per character
Related codes
| code | message |
|---|---|
| E8021 | Profiles enabled without the per-character profile SavedVariable (<name>PerChar) |
Offline
$ wowlua explain E8117 E8117 (error): profiles = true on a per-character SavedVariable