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.
()setNamedEntityProp(name: s, prop: s, content: s) // setNamedEntityProp_sss_
()setNamedEntityPropCb(name: s, prop: s, content: s) // setNamedEntityPropCb_sss_
()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.