[Added] Reserved USER# Stat Number range

Moderators: Developers, ZDoom.org Team

Reserved USER# Stat Number range

Postby Xaser » Thu Aug 10, 2017 9:17 am

Assigning custom stat numbers to thinkers can be useful for certain things, but there's one rather important caveat:

Graf Zahl wrote:Right now there is no guaranteed range of user-reserved numbers so you may be shooting yourself in the foot by arbitrarily assigning a free number to your thinker.

So, let's reserve some. Something like ten or so declared STAT_USER# statnums ought to do the trick.

If we want to get super-fancy, perhaps have one reserved range before STAT_DEFAULT (and another before STAT_FIRST_THINKING so there are "don't tick" options available) so folks get more control over the execution order, but I'll let you all hash this part out. :P
User avatar
Joined: 20 Jul 2003

Re: Reserved USER# Stat Number range

Postby Major Cooke » Thu Aug 10, 2017 12:27 pm

Side question, which comes first? Lowest numbered (32 on up) or highest numbered? I'm assuming lowest since custominventory does its thing in a snap with pickup and use states.

But yes, I agree on this. If the aforementioned is such a case, I think a set of ranges before and after the traditional thinker would be of great boon -- even if I was mistaken in terms of optimization, it can still be quite useful.
User avatar
Major Cooke
Slow yet powerful ZScript modder.
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: Reserved USER# Stat Number range

Postby Graf Zahl » Thu Aug 10, 2017 12:32 pm

Lowest numbered come first. Trivia: Originally STAT_DEFAULT was the highest possible number, that only got changed when it became obvious that some things need to tick after all in-game actors to avoid undefined behavior.
User avatar
Graf Zahl
Lead GZDoom Developer
Joined: 19 Jul 2003
Location: Germany

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest