Page 1 of 1

[ZScript] Additional warning message if no version

Posted: Wed Jun 13, 2018 2:23 pm
by Matt
Right now if someone forgets the version number the only feedback happens when something post-2.3.0 is encountered and you get an error message saying "<class> not accessible to ZScript version 2.3.0".

This is obvious enough to anyone who's already familiar with ZS, but would be totally opaque to someone coming in from years of Decorate (and ACS) where this was never an issue.

Can we get something like the following, to be displayed in the console (preferably with increased visibility) if GZDoom notices there are classes defined before it encounters any version definition?
ZScript warning: <path/filename of zscript lump>: Class defined with no version number previously provided. Will fall back to version 2.3.0. (Latest version is ____)
This should give the current error messages a bit more context so people can help themselves, or at least have enough of a lead to where they should be looking in the wiki.

Re: [ZScript] Additional warning message if no version

Posted: Wed Jun 13, 2018 2:54 pm
by Graf Zahl
Like I told you last time: ZScript without version info is legitimate version 2.3. This cannot be warned about without spamming valid content.
GLSL has the same issue, i.e. if you don't specify a version it assumes the very first, very limited one.

Re: [ZScript] Additional warning message if no version

Posted: Wed Jun 13, 2018 6:32 pm
by Matt
Can we at least get something like this:
<class> not accessible to ZScript version 2.3.0. ZScript version must be specified for classes in later versions.
It's not inherently apparent to a newcomer that the ZScript version number should match the GZDoom version number, and simply looking at that one might think 2.3.0 was the newest version and either the feature or the syntax they were using was obsolete.

Re: [ZScript] Additional warning message if no version

Posted: Wed Jun 13, 2018 11:07 pm
by Xaser
A tweak on the above idea: since it's highly doubtful anyone's writing any new ZScript code that specifically targets 2.3.0 ('cause it's old), the only time people are going to run into this exact error message, practically speaking, is because they forgot to put a declaration. So perhaps only if the assumed ZScript version is exactly 2.3.0, amend the message to read something like:
<class> not accessible to ZScript version 2.3.0. Did you remember to declare a version number in your ZScript code?
This patches the hole without impacting any actual mods built for 2.3.0.

[Wording suggestions welcome, of course.]

Re: [ZScript] Additional warning message if no version

Posted: Wed Jun 13, 2018 11:27 pm
by Cacodemon345
I second Xaser here.