Character controls the dialogues of the character.
Note:Character does not drive stage sprite layout by itself; use Image for on-stage displayables. For dialog box avatars (small portraits next to ADV text), configure avatar / portraits and render Avatar — see Dialog.
character`Hello, ${Word.color("Alice", "#f00")}!`, // will output "Hello, Alice" with "Alice" in red color// is equivalent tocharacter.say`Hello, ${Word.color("Alice", "#f00")}!`
Note: This short-hand is not chainable using some packaging tools like Webpack.
scene.action([ character`sentence 1` `sentence 2`, // this will throw an error]);
character.say( new Sentence(character, [ "Good morning, I am ", new Word("Alice", {color: "#f00"}), // Some words can be colored ])) // will output "Good morning, I am Alice" with "Alice" in red color
Note: The dialogues's name will be the same as the sentence's name.
character .setName("Alice (angry)") .say("What do you want?")
name: string - The name of the character
A name change is carried by saves since 0.26.0. Before that, Character never serialised
its state, so no save recorded a name change: a player who saved after the reveal of a speaker
shown as "???" came back to "???", in the dialog box and in the backlog alike. Starting a new
game or loading a save now hands back the authored name rather than whatever the last
playthrough left behind.
Saves written by earlier versions carry no character entry and still load, leaving the authored
name in place. Because characters now occupy save entries, and a generated element id describes
a position in the action tree rather than an identity, an application that restores saves should
name its cast through
DevTools.setElementStaticId.