Skip to content

Access Entity Local Switch

Access Entity Local Switch

Gets or set the value of a local switch on a specific entity.

Properties

System

Name Explanation Type
Entity The entity whose local switch will be accessed. Actor Reference
Get Value Whether the command reads the entity switch value into a global or local switch. Toggle
Global Switch The global switch index to read from or write to. Number
Local Switch The local switch index to read from or write to. Number
Reference Switch The index of the local switch on the target entity to access. Number
Set Value Whether the command writes a value to the entity switch. Toggle
Use Global Switch Whether to use a global switch as the source or destination. Toggle
Use Local Switch Whether to use a local switch as the source or destination. Toggle
Use Value Whether to set the entity switch to a literal value instead of copying from a global or local switch. Toggle
Value The literal value to set the entity switch to when Use Value is enabled. Toggle

Examples

Read Entity 0 Local Switch 0 into Global Switch 0

This reads the value of local switch 0 on entity 0 and stores it in Global Switch 0.

$gs[0] = entity_switch(entity(0), 0);
{"Data":{"GlobalIndex":0,"IsGetter":true,"IsGlobal":true,"IsLocal":false,"IsValue":false,"LocalIndex":0,"ReferenceIndex":0,"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},"Value":false,"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Entity.EntityLocalSwitchAccessCommand"}

Set Entity 0 Local Switch 0 to True

This sets local switch 0 on entity 0 to true.

entity_switch(entity(0), 0, true);
{"Data":{"GlobalIndex":0,"IsGetter":false,"IsGlobal":false,"IsLocal":false,"IsValue":true,"LocalIndex":0,"ReferenceIndex":0,"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},"Value":true,"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Entity.EntityLocalSwitchAccessCommand"}