GetStatSize() (ZScript)
Moderator: GZDoom Developers
- Major Cooke
- Posts: 8176
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
GetStatSize() (ZScript)
Simple. A static function that returns the size of a specified stat. If left empty or is some invalid number, defaults to maximum stat + 1 which means it gets the size combined of all stats.
- Marisa the Magician
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
- Contact:
Re: GetStatSize() (ZScript)
What do you mean by "size of a stat"?
- Major Cooke
- Posts: 8176
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: GetStatSize() (ZScript)
How many active thinkers are in a particular stat.
Right now you can only do a while loop until it's all the way over which strikes me as inefficient when just trying to establish how many thinkers are in there -- especially if it's on ZScript's side. Probably much better to have it done on the source if anything, especially if this is done often.
Right now you can only do a while loop until it's all the way over which strikes me as inefficient when just trying to establish how many thinkers are in there -- especially if it's on ZScript's side. Probably much better to have it done on the source if anything, especially if this is done often.
-
- Posts: 111
- Joined: Wed Jun 15, 2016 2:49 pm
Re: GetStatSize() (ZScript)
https://github.com/coelckers/gzdoom/pull/574
Let's see if I fucked anything up, or if Graf doesn't want it in. (Or both)
Let's see if I fucked anything up, or if Graf doesn't want it in. (Or both)
- Major Cooke
- Posts: 8176
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: GetStatSize() (ZScript)
This was closed.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49073
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: GetStatSize() (ZScript)
You shouldn't do that. If you have to count thinkers in a slot frequently something isn't right. Even natively the engine cannot do anything less than stepping through the entire list and incrementing a counter. This is a very costly operation because it involves several cache misses on the CPU.Major Cooke wrote:especially if this is done often.