Wednesday, January 14, 2009

Entity property queries now available

We can now query entity properties using the new Property Query action. It would look as follows:

Entity.QueryProperty(EntityID):PropertyName("PropertyID")

Suppose we have an entity called "Ship77" and has a string property called "PilotName" the following command would display its pilot name on the console:

Global.Echo():Text(Entity.QueryProperty(Ship77):PropertyName("PilotName"))

Note, however, that due to the restrictions of the Echo action it can only accept string parameters, so if the property is not a string it won't work in this case, but the query action works for all types including more complex types such as arrays.