ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:newtid

Differences

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

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
functions:newtid [2017/03/19 18:18] – created korshunfunctions:newtid [2017/03/19 18:21] korshun
Line 13: Line 13:
 **To correctly use UniqueTid, you need to use the same start value in the whole project.** **To correctly use UniqueTid, you need to use the same start value in the whole project.**
  
-==== Zandronum 2.1.2 ====+==== Zandronum ====
  
-There is also a Zandronum 2.1.2 bug: tids over 32767 (SHORT_MAX) are not transmitted to clients. This means that you generally shouldn't use them.+There is also a Zandronum bug: tids over 32767 are not transmitted to clients. This means that you generally shouldn't use them.
  
 ==== The solution ==== ==== The solution ====
  
-NewTid is a function designed to solve both these problems. To use NewTid, you first specify the first tid it may allocate using a global #define in your project:+NewTid is a function designed to solve both these problems. To use NewTid, you first specify the first tid it may allocate using a global #define in your project, for example:
  
 <code> <code>
Line 26: Line 26:
 </code> </code>
  
-And NewTid() will return safe tids without any parameters required. NewTid() will prefer Zandronum 2.1.2-safe tids (below 32767) and only switch to Zandronum-unsafe tids if all safe tids are occupied.+And NewTid() will return safe tids without any parameters required. NewTid() will prefer Zandronum-safe tids (below 32767) and only switch to Zandronum-unsafe tids if all safe tids are occupied, which can only happen if you have spawned an insane amount of actors with different tids. 
 + 
 +===== Examples ===== 
 +Just use NewTid like UniqueTid without specifying any error-prone boundaries: 
 +<code> 
 +int tid = NewTid(); 
 +Spawn("SomeActor", x, y, z, tid, angle); 
 +</code>
  
-==== NewTid ==== 
  
  
-Returns a new safe tid. 
functions/newtid.txt · Last modified: 2017/04/15 17:29 by korshun