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:39] korshunactor_properties [2017/07/04 15:06] (current) korshun
Line 1: Line 1:
 +====== Actor properties ======
 +ACSUtils provides wrapper functions for all actor properties. For every property ''**PropertyName**'', ACSUtils provides two functions:
 +
 +''type GetActor**PropertyName**(int tid)''
 +
 +''void SetActor**PropertyName**(int tid, type value)''
 +
 <note important>The only exception is that [[zdoom>GetActorViewHeight]] is a native ZDoom function that takes crouching into account. To access the actual value of the ViewHeight property, use ''GetActorProperty(tid, APROP_ViewHeight)''.</note> <note important>The only exception is that [[zdoom>GetActorViewHeight]] is a native ZDoom function that takes crouching into account. To access the actual value of the ViewHeight property, use ''GetActorProperty(tid, APROP_ViewHeight)''.</note>
  
-====== List of all properties ======+===== Network optimization ===== 
 + 
 +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).  
 + 
 +<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 =====
  
 ^ type ^ Name ^ ^ type ^ Name ^
actor_properties.1497353991.txt.gz · Last modified: 2017/06/13 14:39 by korshun