set_named_entity_prop - ryzom/ryzomcore GitHub Wiki


title: Set Named Entity Prop description: published: true date: 2023-03-12T12:39:50.349Z tags: editor: markdown dateCreated: 2023-03-12T11:24:04.223Z

setNamedEntityProp and setNamedEntityPropCb

The setNamedEntityProp and setNamedEntityPropCb native AI script functions are used to set a property of an existing named entity. Valid property names are "state", "param1", and "param2". The name of the entity cannot be changed.

The difference between the two functions is that setNamedEntityPropCb triggers listeners associated with the entity property, while setNamedEntityProp does not.

Syntax

()setNamedEntityProp(name: s, prop: s, content: s) // setNamedEntityProp_sss_
()setNamedEntityPropCb(name: s, prop: s, content: s) // setNamedEntityPropCb_sss_

Arguments

  • name (string): The name of the named entity to modify.
  • prop (string): The property of the named entity to modify.
  • content (string): The value to set.

Example

()setNamedEntityProp("Invasion", "state", "Active");
()setNamedEntityPropCb("Invasion", "state", "Active");

These examples set the "state" property of the "Invasion" named entity to "Active". The first example uses setNamedEntityProp, while the second uses setNamedEntityPropCb to trigger any listeners associated with the "state" property.

⚠️ **GitHub.com Fallback** ⚠️