Error for no ZScript version

Moderator: GZDoom Developers

User avatar
Major Cooke
Posts: 8109
Joined: Sun Jan 28, 2007 3:55 pm

Error for no ZScript version

Post by Major Cooke »

I was having trouble figuring out why some of my code wasn't executing properly for a bit when I came to realize, "Oh! I didn't have version "x" specified!"

I thought I had done it but apparently not. It would be appreciated if the engine says something like "Version must be specified" or something.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48514
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Error for no ZScript version

Post by Graf Zahl »

But version does not need to be specified.
The very first version did not have this.
User avatar
Major Cooke
Posts: 8109
Joined: Sun Jan 28, 2007 3:55 pm

Re: Error for no ZScript version

Post by Major Cooke »

Attached is a file that errors out if you don't have version specified because of... reasons. If you uncomment the very first line, it actually loads.
You do not have the required permissions to view the files attached to this post.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48514
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Error for no ZScript version

Post by Graf Zahl »

Without a version directive it will be compiled as version 2.3. The directive was only introduced with version 2.4.
User avatar
Rachael
Admin
Posts: 13198
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Error for no ZScript version

Post by Rachael »

This is one of those "shoulda coulda woulda" things but this would break too many mods if there was such an error.

This is why defcvars was introduced with a version requirement right out the gate, to avoid that shoulda-coulda-woulda problem. Makes it more future proof by requiring that the version always be specified - that way if I need to introduce any breaking changes to the system I can keep a compatibility parser for older versions and not have to worry about the new parser fritzing out on it.

Return to “Closed Feature Suggestions [GZDoom]”