Skip to content

Save Entity Unique ID

Save Entity Unique ID

Saves the unique ID of an entity to a variable for later reference.

Properties

System

Name Explanation Type
Destination Variable The variable where the entity's unique ID will be stored. Variable or Value
Entity The entity whose unique ID will be saved. Actor Reference

Examples

Save Entity 0 Unique ID to Global Variable 0

This saves the Unique ID of entity 0 into Global Variable 0.

$gv[0] = save_actor_uid(entity(0));
{"Data":{"Target":{"ReferenceType":0,"Index":0,"IsSelf":false,"IsEntity":true,"IsPartyMember":false,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"0","VariableIndex":0,"Metadata":null},"Metadata":null},"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Entity.EntitySaveUniqueIDCommand"}

Save Self Unique ID to Global Variable 0

This saves the Unique ID of the calling entity into Global Variable 0.

$gv[0] = save_actor_uid(self);
{"Data":{"Target":{"ReferenceType":0,"Index":0,"IsSelf":true,"IsEntity":false,"IsPartyMember":false,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"0","VariableIndex":0,"Metadata":null},"Metadata":null},"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Entity.EntitySaveUniqueIDCommand"}