chargen
Builds the hero on the game’s character creation screen, as a player’s clicks do, so the game’s own rules and scripts apply; then ends the screen, and the origin starts. The screen must be up (gui shows CharGen, mode chargen): game_new starts a new game and brings it up. Pass race, class and background (and optionally gender, voice, name, difficulty), and either both attributes and abilities spending every point, or neither, and the game spends them as the screen’s Quick Play does. Each choice is made as the screen makes it, from what it offers then: a background must suit the race and class, and one the screen greys out is refused, naming those it offers. offers: true lists what it offers now.
With finish: false the choices are made and the screen stays up; offers then also lists the skills and the talents or spells to choose from, and a later call (with every choice again) finishes. The answer has the hero, what it chose, the exit (full or quick play), the hero after (attributes, points left, ability count), the origin (its row of the origins table and its startArea), whether it finished, and a cursor. The origin’s opening follows: a cutscene, then a conversation.
Arguments
| Name | Type | Required | What |
|---|---|---|---|
race | any | human, elf or dwarf, as the screen names them (or the race’s id). | |
class | any | warrior, mage or rogue (or the class’s id). | |
background | any | The origin’s background by name, as offers lists them (noble, magi, dalish, city, commoner in the game as shipped), or its id. | |
gender | any | male or female. Default male. | |
voice | string | The voice: its sound set (ss_pc_mhuman_wise), its name, or its sound set’s last word (wise, cocky …), from those offers lists for the hero’s race and gender. Default the screen’s own, the first. | |
name | string | The hero’s name, 1 to 10 letters. Default the origin’s own (Aedan for a human noble man), as the screen offers it. | |
attributes | object | Points by attribute, every one spent, as {“magic”: 5}. | |
abilities | array | Ability ids to take, every point spent: the skills and the talents or spells offers lists as learnable, the first of a chain before the next. | |
difficulty | string | casual, normal, hard or nightmare, as the screen asks at its end. It is the game’s option, kept in its profile’s settings. Default: left as it is. | |
finish | boolean | End the screen once the hero is built, and so start the origin. Default true. | |
offers | boolean | List what the screen offers now (genders, races, classes, backgrounds, voices, each enabled or not), and, once a class is chosen, the hero’s points and the abilities to choose from. Chooses nothing. |
Call it as chargen over MCP, or POST /api/tool/chargen with the arguments as JSON.