SetNpcIdentity: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Release G1R:MP 0.1.5 BUILD144 / Protocol 37; update availability and migration
Release 0.1.9 / BUILD264 / Protocol42: availability and download setup; preserve experimental limits
 
(One intermediate revision by the same user not shown)
Line 35: Line 35:
* Does not change authoritative HP, weapons, armor, routes or combat configuration. No automatic persistent database storage.
* Does not change authoritative HP, weapons, armor, routes or combat configuration. No automatic persistent database storage.
* Upper-initial alias SetNpcIdentity is also supported.
* Upper-initial alias SetNpcIdentity is also supported.
* Use default to explicitly restore the Nameless Hero identity. Preserves armor, skin-color and tattoo overrides. Does not replace the whole NPC outfit. Existing setNpcSkin remains a separate legacy preset.
* Use default to explicitly restore the Nameless Hero identity. Preserves armor, skin-color and tattoo overrides. In 0.1.8 it does not replace the whole NPC outfit. From 0.1.9, the five supported female identities can show their full authored outfit without armor; see [[Female identities]]. Existing setNpcSkin remains a separate legacy preset.


[[Category:Lua Functions]]
[[Category:Lua Functions]]
Line 41: Line 41:
[[Category:NPC Functions]]
[[Category:NPC Functions]]
[[Category:Appearance Functions]]
[[Category:Appearance Functions]]
<!-- female019:start -->
== Female presentation improved from 0.1.9 ==
'''Improved from 0.1.9.'''
<code>setNpcIdentity(npcId, "syra")</code> selects a matching female identity for a resource-owned human NPC. The same correction covers <code>velaya</code>, <code>seraphia</code>, <code>chani</code> and <code>natalia</code>. Without armor the matching identity shows its authored female outfit; with armor it retains the native armor and corrected head. Face expression remains neutral. See [[Female identities]] for examples and material limits. This improves the existing API, available since 0.1.5; it does not introduce a new NPC setter.
<!-- female019:end -->

Latest revision as of 13:29, 20 October 2026

setNpcIdentity

AVAILABLE FROM UPDATE 0.1.5
This function is available in G1R:MP 0.1.5 and later. The contract below includes the compatibility guarantees introduced in that update.

Selects the matched head/identity profile of an NPC.

Syntax

setNpcIdentity(npcId, identity)

Parameters

Name Type Required Description
npcId int yes NPC ID returned by spawnNpc; not a player ID.
identity string yes Named identity from getNpcIdentityNames, or default. ASCII case-insensitive, at most 48 bytes; not an asset path.

Returns

true when accepted, false when invalid, unavailable or owned by another resource.

Examples

setNpcIdentity(npcId, "milten")

Notes

  • Server-side only. Mutations require the resource that owns this NPC; getters do not grant control.
  • Available from update 0.1.5. See NPC scripting#NPC appearance since 0.1.5.
  • The authoritative state is replayed for relevance entry/late join. Rendering is asynchronous; acceptance does not mean the mesh has finished rebuilding.
  • Does not change authoritative HP, weapons, armor, routes or combat configuration. No automatic persistent database storage.
  • Upper-initial alias SetNpcIdentity is also supported.
  • Use default to explicitly restore the Nameless Hero identity. Preserves armor, skin-color and tattoo overrides. In 0.1.8 it does not replace the whole NPC outfit. From 0.1.9, the five supported female identities can show their full authored outfit without armor; see Female identities. Existing setNpcSkin remains a separate legacy preset.

Female presentation improved from 0.1.9

Improved from 0.1.9. setNpcIdentity(npcId, "syra") selects a matching female identity for a resource-owned human NPC. The same correction covers velaya, seraphia, chani and natalia. Without armor the matching identity shows its authored female outfit; with armor it retains the native armor and corrected head. Face expression remains neutral. See Female identities for examples and material limits. This improves the existing API, available since 0.1.5; it does not introduce a new NPC setter.