Modding:Entity Attribute guardedPlayerUid: Difference between revisions

From Vintage Story Wiki
(Created page with "The '''guardedEntityId''' entity instance attribute is used to mark which target entity the entity should guard. If the target is a player, then the '''guardedPlayerUid''' entity instance attribute is also set. Essentially the guarded entity is the owner of the entity. Out of the vanilla entities, only the hacked locust and mech helpers set the attribute. Note that entity instance attributes are different from Modding:Entity_Json_Properties#p_attributes|entity type at...")
 
(Link to Entity_instance_attributes)
 
Line 1: Line 1:
The '''guardedEntityId''' entity instance attribute is used to mark which target entity the entity should guard. If the target is a player, then the '''guardedPlayerUid''' entity instance attribute is also set. Essentially the guarded entity is the owner of the entity. Out of the vanilla entities, only the hacked locust and mech helpers set the attribute.
The '''guardedEntityId''' entity [[Modding:Entity_instance_attributes|instance attribute]] is used to mark which target entity the entity should guard. If the target is a player, then the '''guardedPlayerUid''' entity instance attribute is also set. Essentially the guarded entity is the owner of the entity. Out of the vanilla entities, only the hacked locust and mech helpers set the attribute.
 
Note that entity instance attributes are different from [[Modding:Entity_Json_Properties#p_attributes|entity type attributes]]. Since the instance attributes are unique to every instance of the entity, they cannot be set through json files. Server admins can read the instance id attribute of the currently selected entity with this command:
<code>/entity cmd l[] attr guardedPlayerUid</code>
 
Admins can also set the attribute with the following command.
<code>/entity cmd l[] setattr string guardedPlayerUid value</code>


Players with the clock maker class can set the attribute by [[Tuning_spear|hacking]] a locust. Players in creative mode can set it by placing a mech helper or hacked locust item (the item that spawns the entity).
Players with the clock maker class can set the attribute by [[Tuning_spear|hacking]] a locust. Players in creative mode can set it by placing a mech helper or hacked locust item (the item that spawns the entity).

Latest revision as of 00:16, 3 November 2024

The guardedEntityId entity instance attribute is used to mark which target entity the entity should guard. If the target is a player, then the guardedPlayerUid entity instance attribute is also set. Essentially the guarded entity is the owner of the entity. Out of the vanilla entities, only the hacked locust and mech helpers set the attribute.

Players with the clock maker class can set the attribute by hacking a locust. Players in creative mode can set it by placing a mech helper or hacked locust item (the item that spawns the entity).

AI tasks that use the attribute