This assumes you're fairly intimate with ThinkerIterators at the very least.
Did you know that stat numbers are a handy way to change what iterator a thinker can be within?
It's easy!
ChangeStatNum(int num);
Why?
Read up on thinkers here first to understand what it's all about. The above function will remove the thinker from the array it's currently within and place it in the one you specify -- meaning iterator searches are affected by it based on the stat number you pass it.
Because let's face it, there are going to be maps where there are a literal fuckton of actors/thinkers. Effects-heavy mods that often do a lot of actor searching are going to be a liability for causing slowdowns because, you guessed it, they're doing a lot of their searching in every array.
Think about it for a moment, every search is going through a GIANT LIST OF THINKERS whenever one creates a ThinkerIterator with the default parameters. In ZScript, this compounds the amount of code executions and comparisons of certain properties the modder has specified
for every single thinker in that list.
Now, what if you want to search for thinkers on different stat numbers? Easy, just change the ThinkerIterator's stat number and presto! By default, ThinkerIterator defaults to searching through what looks like every single thinker array (uses 128 by default, which I assume means check them all -- it would explain why inventory sometimes crops up).
WARNING
Do not use ranges below 32 unless the actors are meant to be purely static, because they will not operate by themselves. Their tick functions don't operate normally, but this can be useful for saving pointless tick processing that you normally wouldn't need otherwise.
If you need more stat thinkers, the only thing I can recommend is
suggesting it.
I hope this alleviates ailments some mods may suffer through. Any and all information here is, of course, subject to Graf's corrrections and will be changed according to his specifications.
This assumes you're fairly intimate with ThinkerIterators at the very least.
Did you know that stat numbers are a handy way to change what iterator a thinker can be within?
It's easy! [b]ChangeStatNum(int num);[/b]
[b]Why?[/b]
[url=https://zdoom.org/wiki/Thinker]Read up on thinkers here first[/url] to understand what it's all about. The above function will remove the thinker from the array it's currently within and place it in the one you specify -- meaning iterator searches are affected by it based on the stat number you pass it.
Because let's face it, there are going to be maps where there are a literal fuckton of actors/thinkers. Effects-heavy mods that often do a lot of actor searching are going to be a liability for causing slowdowns because, you guessed it, they're doing a lot of their searching in every array.
Think about it for a moment, every search is going through a GIANT LIST OF THINKERS whenever one creates a ThinkerIterator with the default parameters. In ZScript, this compounds the amount of code executions and comparisons of certain properties the modder has specified [b]for every single thinker in that list.[/b]
Now, what if you want to search for thinkers on different stat numbers? Easy, just change the ThinkerIterator's stat number and presto! By default, ThinkerIterator defaults to searching through what looks like every single thinker array (uses 128 by default, which I assume means check them all -- it would explain why inventory sometimes crops up).
[size=200]WARNING[/size]
Do not use ranges below 32 unless the actors are meant to be purely static, because they will not operate by themselves. Their tick functions don't operate normally, but this can be useful for saving pointless tick processing that you normally wouldn't need otherwise.
If you need more stat thinkers, the only thing I can recommend is [url=https://forum.zdoom.org/viewforum.php?f=15]suggesting[/url] it.
I hope this alleviates ailments some mods may suffer through. Any and all information here is, of course, subject to Graf's corrrections and will be changed according to his specifications.