Skip to content

Save Unique ID

Save Unique ID

Saves the Unique ID of the containing object to a Variable.

Note: This is often used in conjunction with Save Value to access data within the engine.

Examples

Save Unique ID to Global Variable 0

This saves the Unique ID of the containing object to Global Variable 0.

$gv[0] = save_unique_id();
{"Data":{"Index":0,"IndexEnd":null,"IsLocal":0,"IsOperandReference":0,"IsReference":0,"OperandGlobalIndex":null,"OperandLocalIndex":null,"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Data.SaveUniqueIDCommand"}

Save Unique ID to Local Variable 0

This saves the Unique ID of the containing object to Local Variable 0, keeping the data scoped to the current event.

$lv[0] = save_unique_id();
{"Data":{"Index":0,"IndexEnd":null,"IsLocal":1,"IsOperandReference":0,"IsReference":0,"OperandGlobalIndex":null,"OperandLocalIndex":null,"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Data.SaveUniqueIDCommand"}