[Linux] Hocus Doom Monster HP Bar script not working

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Talon1024
 
 
Posts: 376
Joined: Mon Jun 27, 2016 7:26 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support

[Linux] Hocus Doom Monster HP Bar script not working

Post by Talon1024 »

The Monster HP Bar script from Hocus Doom doesn't seem to be working on Linux builds of ZDoom. When I aim at a monster, the monster's health bar doesn't appear near the bottom of the screen, despite whether I set it to display hearts or numbers.

Here's the information about the GZDoom build I was using:

Code: Select all

GZDoom g2.3pre-343-g49605bc - 2016-11-24 09:59:48 +0100 - SDL version
Compiled on Nov 26 2016
Talon1024
 
 
Posts: 376
Joined: Mon Jun 27, 2016 7:26 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support

Re: [Linux] Hocus Doom Monster HP Bar script not working

Post by Talon1024 »

I think I found out why this bug was happening to me.

Image
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49211
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Linux] Hocus Doom Monster HP Bar script not working

Post by Graf Zahl »

Indeed. The MaxAmount value is stored as a signed int. 0xffffffff as a signed int is -1.
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: [Linux] Hocus Doom Monster HP Bar script not working

Post by Edward-san »

Sounds like Hocus Doom should be fixed. If it could be possible for zscript code to warn about it...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49211
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Linux] Hocus Doom Monster HP Bar script not working

Post by Graf Zahl »

Warn about it and clamp the value to its proper range. I'll see to it that this gets added to the property parser in general and that it can make a distinction between a signed and unsigned int while parsing. But yes, this is primarily a mod error
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49211
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Linux] Hocus Doom Monster HP Bar script not working

Post by Graf Zahl »

Damnit. This isn't solvable at the high level. The entire parser from the bottom up and all code using it would have to be changed, it's a huge shitload of work I'm just not willing to do for such a minor thing. There's a good reason why the parser defined an implicit MAXINT constant for such cases that is guaranteed to produce a working value.

The problem here is that Linux longs are 64 bit om 64 bit platforms, but Windows longs are 32 bit, so the strtol function works differently on both platforms, but all the parsing code is blissfully unaware of this and stores everything in 32 bit. But since this goes down to the deepest bowels of ZDoom's inner workings - the parser is used everywhere - a change will not only be extremely extensive but may also subtly break other things.

Return to “Closed Bugs [GZDoom]”