[Scripting] 'Numeric type expected' error

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.
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

[Scripting] 'Numeric type expected' error

Post by _mental_ »

Since merging of scripting branch a bunch of 'Numeric type expected' errors are printed into the console when running Adventure of Square.
Spoiler: The complete error log
The issue is related to the second parameter of A_PlaySound(), which is a string literal in all error cases but it should be an integer.
However the affected actors are playing back sounds just fine using ZDoom 2.8.0. I suppose an index of a string literal is treated as an integer and this integer is used as a sound slot.

I made a fix for this problem, although I would really like to hear a word from Randi about all this.
To reproduce the issue run with the following command line and check fountain's sound:

Code: Select all

-iwad square1.pk3 +map e1a1 +summon SquareFountain
User avatar
AFADoomer
Posts: 1344
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: [Scripting] 'Numeric type expected' error

Post by AFADoomer »

Possibly related: I get a similar error on initial parsing while running the Wolf3D TC, only the game never finishes loading and a hard crash follows...

The error message isn't occurring for the same line/file every time, either. Very occasionally, the game will actually load, and just dump 'Attempted to pass a non-value' to the console, for additional different lines and files. The common thread seems to be that the lines of Decorate code all have ACS_NamedExecuteWithResult calls.

Image

EDIT: Something changed between the GZDoom 2.2pre build, where everything works as expected, and the current build, where things are broken (gzdoom-g2.2pre-353-g760db90.7z). Not sure if that was the pre/post scripting merge point. I haven't backtracked ZDoom versions, yet.

I may need to post this as a separate thread, given Gez's post below...
Last edited by AFADoomer on Sat Feb 06, 2016 10:51 am, edited 1 time in total.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: [Scripting] 'Numeric type expected' error

Post by Gez »

_mental_ wrote:Since merging of scripting branch a bunch of 'Numeric type expected' errors are printed into the console when running Adventure of Square.
Spoiler: The complete error log

Yeah it's a real user error:

Code: Select all

	TNT1 A 0 A_PlaySound("ambience/fountain", "SoundSlot5", 0.5, 1)  
They basically confused the API for [wiki]A_PlaySound[/wiki] and [wiki]A_PlaySoundEx[/wiki]. APSX uses string names for the channels, APS uses constant identifiers. What they did never worked right; and if a workaround is added to make it load anyway it should still at least print a warning.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Scripting] 'Numeric type expected' error

Post by Graf Zahl »

I don't see how this can be fixed without breaking the parser.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Scripting] 'Numeric type expected' error

Post by Graf Zahl »

Gez wrote:and if a workaround is added to make it load anyway it should still at least print a warning.
That it already does. Here's only one course of action: Fix the mod, leave the parser alone.
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: [Scripting] 'Numeric type expected' error

Post by _mental_ »

Gez wrote:What they did never worked right; and if a workaround is added to make it load anyway it should still at least print a warning.
The problem is that it's working in 2.7.1 and 2.8.0. I agree that it must not work. But who knows how many mods are exploiting this bug.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: [Scripting] 'Numeric type expected' error

Post by wildweasel »

Shit, I wonder how many of my mods are doing this by accident.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Scripting] 'Numeric type expected' error

Post by Graf Zahl »

_mental_ wrote:
Gez wrote:What they did never worked right; and if a workaround is added to make it load anyway it should still at least print a warning.
The problem is that it's working in 2.7.1 and 2.8.0. I agree that it must not work. But who knows how many mods are exploiting this bug.

What? It selected slot 5? Really? I'd rather think it did the same as it does now: Selecting slot 0!
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: [Scripting] 'Numeric type expected' error

Post by Ed the Bat »

wildweasel wrote:Shit, I wonder how many of my mods are doing this by accident.
None of the ones I've worked on for you, I promise.
HavoX
Posts: 272
Joined: Wed Apr 11, 2012 10:31 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10 Pro 21H1
Graphics Processor: nVidia with Vulkan support
Location: St. Louis, MO

Re: [Scripting] 'Numeric type expected' error

Post by HavoX »

Graf Zahl wrote:Here's only one course of action: Fix the mod, leave the parser alone.
So be it, we'd say.
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: [Scripting] 'Numeric type expected' error

Post by Edward-san »

Well, considering everything, it's not that bad. The old mods will work till 2.8, then the new mods must take account of the changes. The 3-episode adventure of square game is in development, isn't it? isn't it?

... maybe it's worth considering the next version being 3.0..
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Scripting] 'Numeric type expected' error

Post by Graf Zahl »

These constructs do not work correctly in 2.8.0. The game never defines a constant "SoundSlot", so it's inevitably 0, meaning it'll play on the first free channel (a.k.a. CHAN_AUTO)

The only question is: What does the scripting branch do? Play nothing or play something wrong?
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: [Scripting] 'Numeric type expected' error

Post by _mental_ »

Graf Zahl wrote:The only question is: What does the scripting branch do? Play nothing or play something wrong?
If you mean the post-merge master branch it plays nothing. Before merge it played sounds, at wrong slot I guess.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Scripting] 'Numeric type expected' error

Post by Graf Zahl »

Ok. This is still a modding bug, though. I'll check if the parser allows quoted strings as constant names and if that's not the case re-add it, because I wouldn't be surprised if that mistake was made more often. Then adding a new SoundSlot5 constant to patch this over would be a minor addition.

But don't expect me to do such things for every occurence like this.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: [Scripting] 'Numeric type expected' error

Post by Xaser »

I've logged this issue in Square's Trello board. We'll get it fixed mod-side, though I've no idea who else might be affected by this.
Post Reply

Return to “Closed Bugs [GZDoom]”