A message window with the speaker's name and face. What This Module Does
reactor_speaker_face.js: the message box shows who is talking A Show Text with no face picture shows its speaker's face when the game can tell who speaks and has a picture of them.
Classes & Namespaces
Design Notes from the Source Code
reactor_speaker_face.js: the message box shows who is talking A Show Text with no face picture shows its speaker's face when the game can tell who speaks and has a picture of them.
Who speaks, in this order:
- the speaker name, with \N[n], \P[n] and \V[n] resolved, is an actor's name: that actor;
- it is the name of an event on the map (the same, or the event's name begins with it: "Rhea" is the event "Rhea Voss"): that event;
- it is empty: the event that runs the command.
A name that fits nobody gets no face. Several events of one name: the one that runs the command, else the look they share; when those that have a look do not look alike, no face.
Their picture, in this order:
- an actor's face picture;
- a portrait of the model they wear (an actor's face or map model from data/Database.r3d.json, an event's own model), head and shoulders;
- for an event drawn from a character sheet, the face file of the same name and index in img/faces, when the project has one;
- none: the text keeps the full width.
The format (docs/AUTHORING.md): System.json "reactorSpeakerFace": true what a Show Text that does not say does; absent is false a Show Text "reactorFace": "auto"|"none" beside code, indent and parameters: this message's own choice; the five parameters are RPG Maker's, untouched A message with a face picture (parameters[0]) always shows that picture.
The automatic face reaches the message window as an ordinary face: a face file's own name and index, or a portrait served by ImageManager.loadFace under a reserved name (FACE_PREFIX) with index 0, set on $gameMessage like any face. Nothing here draws in a window, and nothing runs per frame: a portrait is drawn once per model and look into a small bounded cache, by a loop that lives only while one is being made.
The first part of this file (names, rules, framing) touches no game global: the editor's Show Text dialog and Node tools load it for the same answers.
View reactor_speaker_face.js on GitHub · Show internal (_) functions