Multiple errors attempting to make a ZScript status bar

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

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!)

Multiple errors attempting to make a ZScript status bar

Postby Chaosvolt » Sun Jun 12, 2022 6:21 pm

I'd ask this in the pinned thread but it's locked. In a nutshell, I'm trying to make a status bar in ZScript but I'm running into issues. The wiki's utter lack of functional documentation for this didn't help, and couldn't find any examples in the locked thread that would illuminate the cause of the errors I'm running into. Can anyone tell me what I'm doing wrong here?

Here is the current status bar class I'm trying to use, currently in my main zscipt file:
Spoiler:


And here are the errors I'm getting:
Spoiler:


From the looks of it, my guess is it is COMPLETELY failing to grab any of the essential properties you'd expect it to grab by inheriting from BaseStatusBar? GZDoom version is 4.6.0, status bar is largely copied from Doom version.
User avatar
Chaosvolt
 
Joined: 19 Apr 2021

Re: Multiple errors attempting to make a ZScript status bar

Postby phantombeta » Sun Jun 12, 2022 8:13 pm

Based on the errors (e.g., the class being seemingly "play" scope despite BaseStatusBar itself being "ui"), that seems like you have no ZScript version specified. You have to specify a version in your ZScript file to get these errors to go away. Generally, you'll want to use at least 4.0.0, minimum, as some very annoying ZScript bugs were fixed before that. Preferably, though, you should use the latest version possible to avoid getting affected by already-fixed ZScript bugs.
User avatar
phantombeta
Tired of being treated like trash by control freaks
 
Joined: 02 May 2013

Re: Multiple errors attempting to make a ZScript status bar

Postby Chaosvolt » Sun Jun 12, 2022 9:28 pm

Ah, weird. So since I'm testing in 4.6.0 then specifying that version may be the most idiotproof. I'll test it in a bit, thanks.
User avatar
Chaosvolt
 
Joined: 19 Apr 2021

Re: Multiple errors attempting to make a ZScript status bar

Postby Chaosvolt » Sun Jun 12, 2022 9:43 pm

This upgrades the fatal error to a Very Fatal Error:
Code: Select allExpand view
Code: C0000005 (Access Violation - tried to read address 0000000000000000)
Address: 00007FF6A0365B17
Flags: 00000000


Tested both 4.0.0 and 4.6.0 for versions.
User avatar
Chaosvolt
 
Joined: 19 Apr 2021

Re: Multiple errors attempting to make a ZScript status bar

Postby Blue Shadow » Mon Jun 13, 2022 4:53 pm

Remove the square brackets around the amt1 variable in CVDrawBarAmmo. You only need them if you're trying to get more than one return value.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Multiple errors attempting to make a ZScript status bar

Postby Chaosvolt » Mon Jun 13, 2022 4:58 pm

Ah, that might well be it. I'm actually just about to release the mod I was testing this for, after I finish that post up I'll test that.
User avatar
Chaosvolt
 
Joined: 19 Apr 2021

Re: Multiple errors attempting to make a ZScript status bar

Postby Chaosvolt » Mon Jun 13, 2022 5:13 pm

And yep, that seems to fix it, thanks. I'll have to tinker with offsets to get it line up with how I have it set up in SBARINFO, then I'd be able to switch to a ZScript status bar for the mod in question.
User avatar
Chaosvolt
 
Joined: 19 Apr 2021

Re: Multiple errors attempting to make a ZScript status bar

Postby Player701 » Wed Jun 15, 2022 1:18 pm

Chaosvolt wrote:This upgrades the fatal error to a Very Fatal Error:
Code: Select allExpand view
Code: C0000005 (Access Violation - tried to read address 0000000000000000)
Address: 00007FF6A0365B17
Flags: 00000000


Tested both 4.0.0 and 4.6.0 for versions.

I've reported the fatal error here, since it still occurs in GZDoom 4.8.0. Please note that even if your code is not correct, very fatal errors are (generally) still engine bugs that should be reported.
User avatar
Player701
 
 
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Multiple errors attempting to make a ZScript status bar

Postby Chaosvolt » Wed Jun 15, 2022 11:31 pm

Ah, thanks. Definitely weird to see that happen, but glad that it was easy to sort out what triggered it.
User avatar
Chaosvolt
 
Joined: 19 Apr 2021


Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests