Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision |
functions:newtid [2017/03/19 18:21] – korshun | functions:newtid [2017/03/20 09:49] – korshun |
---|
[[zdoom>UniqueTid]] is error-prone when mixed with statically allocated tid ranges. You always need to pass the correct boundaries to UniqueTid, like ''UniqueTid(2000, INT_MAX)'', making sure that no actors with tid over 2000 are spawned manually after a call to UniqueTid. Otherwise the newly spawned actor may conflict with the randomly allocated tid. | [[zdoom>UniqueTid]] is error-prone when mixed with statically allocated tid ranges. You always need to pass the correct boundaries to UniqueTid, like ''UniqueTid(2000, INT_MAX)'', making sure that no actors with tid over 2000 are spawned manually after a call to UniqueTid. Otherwise the newly spawned actor may conflict with the randomly allocated tid. |
| |
For example, if you have decided that player tids will range from 1000 to 1063, an incorrect call to UniqueTid like ''UniqueTid(500, 15000)'' may return tid 1008, which does not yet conflict with any of the player tids, but will do so when player 9 joins the game. | For example, if you have decided that player tids will range from 1000 to 1063, an incorrect call to UniqueTid like ''UniqueTid(500, 15000)'' or ''UniqueTid()'' may return tid 1008, which does not yet conflict with any of the player tids, but will do so when player 9 joins the game. |
| |
**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.** |