According to the wiki the range is from 0 to 1, yet in the source code, it's 32767. Why is that?
Does it really matter if the slot priority is between this range, or can it be outside of it and still function normally?
Weapon.SlotPriority?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
Major Cooke
- Posts: 8218
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
-
Major Cooke
- Posts: 8218
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
Re: Weapon.SlotPriority?
Anyone? Any ideas? Currently AEoD uses an ACS system to customize different slot orders and I'd like to take it down to ZScript instead, but I need to know what is going on with this system first as it's a bit confusing.
-
Eliot_L
- Posts: 38
- Joined: Thu Mar 08, 2018 3:40 am
Re: Weapon.SlotPriority?
Hm... Well, 32767 is the maximum value for a signed 16-bit integer, so maybe internally it uses signed ints to represent priority? In that case, that value would be equivalent to "1", and 0 would be –32768. Not sure which system is used in Zscript though.
Have you looked for the definition of this property - shouldn't it be in GZDoom.pk3? Looked quickly on my phone but I couldn't find it.
Have you looked for the definition of this property - shouldn't it be in GZDoom.pk3? Looked quickly on my phone but I couldn't find it.
-
_mental_
-

- Posts: 3820
- Joined: Sun Aug 07, 2011 4:32 am
Re: Weapon.SlotPriority?
Internally slot priority is treated like fixed point value, notice multiplication by 65'536.
Before floatification and scriptification the default was INT_MAX, i.e. 2'147'483'647. Now it is 32'767 because it's the closest one to get x * 65'536 = INT_MAX.
This default means the highest priority I guess. I didn't find any clamping of these values in the code.
Before floatification and scriptification the default was INT_MAX, i.e. 2'147'483'647. Now it is 32'767 because it's the closest one to get x * 65'536 = INT_MAX.
This default means the highest priority I guess. I didn't find any clamping of these values in the code.