Difference between revisions of "GetObjectUUID"

From NWN Lexicon
Jump to: navigation, search
m (Description: formatting.)
 
Line 2: Line 2:
  
 
<nwscript>
 
<nwscript>
void GetObjectUUID(
+
string GetObjectUUID(
 
     object oObject
 
     object oObject
 
);
 
);

Latest revision as of 04:45, 12 January 2020

Warning icon orange.png Caution: This article documents NWN: Enhanced Edition content, not native BioWare scripts. It may not apply unless you're using NWN: Enhanced Edition.
Returns the given objects' UUID.
string GetObjectUUID(
    object oObject
);

Parameters

oObject
A target object, for which the UUID is returned by this function.

Description

Returns the given objects' UUID. This UUID is persisted across save boundaries, like Save/RestoreCampaignObject and save games.

Thus, reidentification is only guaranteed in scenarios where players cannot introduce new objects (i.e. servervault servers).

UUIDs are guaranteed to be unique in any single running game.

If a loaded object would collide with a UUID already present in the game, the object receives no UUID and a warning is emitted to the log. Requesting a UUID for the new object will generate a random one.

This UUID is useful to, for example:

- Safely identify servervault characters
- Track serialisable objects (like items or creatures) as they are saved to the campaign DB - i.e. persistent storage chests or dropped items.
- Track objects across multiple game instances (in trusted scenarios).


Currently, the following objects can carry UUIDs:

 Items, Creatures, Placeables, Triggers, Doors, Waypoints, Stores, Encounters, Areas.


Will return "" (empty string) when the given object cannot carry a UUID.

Remarks

Information icon.png This section of the article is a stub. You can help the NWN Lexicon by expanding it.

Version

1.74.8188

Example

Information icon.png This article is in need of examples. You can help the NWN Lexicon by showing how to use this code effectively.

See Also

functions: ForceRefreshObjectUUID, GetObjectByUUID, GetRandomUUID


author: Shadguy