Skip to content

SourceCharacter

public sealed class SourceCharacter

Namespace MapExpansions

A character of an expansion’s source scene, as the scene defines it: name, look and voice. The character itself does not come along, because a source scene’s NPCs are network objects of their own world. A mod that brings such a person to life creates its own NPC and gives it this look with ApplyAppearance.

public string ObjectName { get; internal set; }

Name of the character’s object in the source scene, such as “Pam”.

public string Id { get; internal set; }

The character’s id in the source scene. Not unique; the prologue’s two officers share one.

public string FirstName { get; internal set; }
public string LastName { get; internal set; }
public Sprite Mugshot { get; internal set; }

Contact picture, or null.

public BaseNPCDataObject Data { get; internal set; }

The character’s data as the source scene defines it. Kept loaded for the whole session.

public bool ApplyAppearance(NPC npc)

Gives a living NPC this character’s body, clothes and distant-view picture. Call it on every peer once the NPC exists; the look is local to each peer. The NPC keeps the look when the game re-applies its data, and when another mod puts a body or an outfit on it later, as S1API does with a custom NPC’s appearance defaults.

Returns False when the NPC or the character’s look is missing; the log names the reason.