Checks a character description against format version 1 and the package's limits on input, drawing and capabilities. It never repairs or recolours anything. To change a character, edit the JSON or the plain list and check it again; a checked object cannot be opened or edited.
Value
A checked, resolved, self-contained mascot_character_data object,
visibly. Its fields are internal implementation details.
Details
Content problems inherit mascot_error_character and mascot_error,
with code, path, value and fix. Argument problems inherit
mascot_error_argument and mascot_error, with argument, code and value.
Every character needs wave and nod tracks that change something. wave
must change a channel of a part other than root; nod may change any
channel, including root. A checked object is not stored anywhere, so pass
it each time you use it. The format version, the set of supported
capabilities and the version of the input and drawing limits can each change on their own.
Built-in character ids are reserved and refused here, so give your
character its own id before checking it.
See also
Other mascot helpers:
mascot_action(),
mascot_anchors(),
mascot_bubble(),
mascot_character(),
mascot_characters(),
mascot_colour_roles(),
mascot_families(),
mascot_gesture(),
mascot_gestures(),
mascot_mood(),
mascot_moods(),
mascot_motion_settings(),
mascot_palettes(),
mascot_placement(),
mascot_popup_menu(),
mascot_preview(),
mascot_read_character(),
mascot_size(),
mascot_status(),
mascot_theme()
Experimental
Experimental Its arguments, results and diagnostics may change in a later release.
Examples
path <- system.file("examples", "characters", "study_bot.json", package = "mascot")
source <- jsonlite::read_json(path)
bot <- mascot_check_character(source)
