ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


actor_properties

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
actor_properties [2017/06/13 14:47] korshunactor_properties [2017/07/04 15:06] (current) korshun
Line 11: Line 11:
  
 All ''SetActor**PropertyName**'' functions first call [[zdoom>GetActorProperty]] and compare the new value of the property to the current one. If both values are the same, [[zdoom>SetActorProperty]] is **not** called. This automatically optimizes bandwidth use in Zandronum multiplayer. All ''SetActor**PropertyName**'' functions first call [[zdoom>GetActorProperty]] and compare the new value of the property to the current one. If both values are the same, [[zdoom>SetActorProperty]] is **not** called. This automatically optimizes bandwidth use in Zandronum multiplayer.
 +
 +<code>
 +function void SetActorHealth(int tid, int Health)
 +{
 + if (GetActorProperty(tid, APROP_Health) != Health)
 + SetActorProperty(tid, APROP_Health, Health);
 +}
 +</code>
  
 Some actor properties are optimized by zandronum itself. However, the set of optimized actor properties depends on zandronum version, and not all actor properties are currently optimized (https://zandronum.com/tracker/view.php?id=1609).  Some actor properties are optimized by zandronum itself. However, the set of optimized actor properties depends on zandronum version, and not all actor properties are currently optimized (https://zandronum.com/tracker/view.php?id=1609). 
 +
 +<note important>All string properties are compared in a case-insensitive way before being set. This means, for example, that ''%%SetActorNameTag(0, "Thing")%%'' will not call ''SetActorProperty'' if the **NameTag** property is already set to ''%%"thing"%%''.</note>
  
 ===== List of all properties ===== ===== List of all properties =====
actor_properties.1497354451.txt.gz · Last modified: 2017/06/13 14:47 by korshun