Reserved USER# Stat Number range

Moderator: GZDoom Developers

Post Reply
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Reserved USER# Stat Number range

Post by Xaser »

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
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Reserved USER# Stat Number range

Post by Major Cooke »

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Reserved USER# Stat Number range

Post by Graf Zahl »

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.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”