[Zscript] Mod/File checking
Moderator: GZDoom Developers
-
- Posts: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: [Zscript] Mod/File checking
Nice!
Now, maybe I'm missing something here but... State parameters? What in particular is that? I can't tell if that's something to deal with goto labels and return state() functions or not.
Now, maybe I'm missing something here but... State parameters? What in particular is that? I can't tell if that's something to deal with goto labels and return state() functions or not.
-
- Lead GZDoom+Raze Developer
- Posts: 49140
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Zscript] Mod/File checking
That'd be the duration, the offsets and the light names.
-
- Posts: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: [Zscript] Mod/File checking
Code: Select all
// although it could be done, let's not convert colors back to strings.
else
{
ScriptPosition.Message(MSG_ERROR, "Cannot convert to string");
delete this;
return NULL;
}
(Is it planned for strings to be in user variables someday?)
-
- Lead GZDoom+Raze Developer
- Posts: 49140
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Zscript] Mod/File checking
The concept of a user variable no longer exists in ZScript. It's an open extension of the internal classes which includes variable definition.
Of course there will be some means to handle redefinition of a base class's variable in a child class. This issue was the prime reason for requiring the 'user' prefix. Right now the parser aborts when it encounters a duplicate but this will have to be relaxed. when new variables get added to internal classes.
Of course there will be some means to handle redefinition of a base class's variable in a child class. This issue was the prime reason for requiring the 'user' prefix. Right now the parser aborts when it encounters a duplicate but this will have to be relaxed. when new variables get added to internal classes.
-
- Posts: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: [Zscript] Mod/File checking
Alright. I'm writing down all this information so I can host it up on the wiki ahead of time and keep it up to date. This way no one has to scour the forums for clues on how to convert DECORATE to Zscript once its merged.
What is the Default { } that I see going on in the converted actor properties like the PorkFX actor? I'm curious what it's use will be...
What is the Default { } that I see going on in the converted actor properties like the PorkFX actor? I'm curious what it's use will be...
-
- Lead GZDoom+Raze Developer
- Posts: 49140
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Zscript] Mod/File checking
That's to avoid polluting the main class body with the properties. They use quite different syntax than the rest and would cause parsing problems otherwise.
-
- Posts: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: [Zscript] Mod/File checking
Okay, here's all the information I've wrote down so far.
Since I'm still learning more about this, some information is probably incorrect; your edits would be appreciated.
Anyway, so strings don't have an identifier, but what about non/constant ints/floats, or would those just be the same thing?
Since I'm still learning more about this, some information is probably incorrect; your edits would be appreciated.
Huh. I wonder if there's going to be anything else aside this and States.Graf Zahl wrote:That's to avoid polluting the main class body with the properties. They use quite different syntax than the rest and would cause parsing problems otherwise.
Anyway, so strings don't have an identifier, but what about non/constant ints/floats, or would those just be the same thing?
Code: Select all
const n1 = 1;
const n2 = 2.5;
How do you plan on having the user define the variables?Graf Zahl wrote:The concept of a user variable no longer exists in ZScript. It's an open extension of the internal classes which includes variable definition.
Of course there will be some means to handle redefinition of a base class's variable in a child class. This issue was the prime reason for requiring the 'user' prefix. Right now the parser aborts when it encounters a duplicate but this will have to be relaxed. when new variables get added to internal classes.
-
- Lead GZDoom+Raze Developer
- Posts: 49140
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Zscript] Mod/File checking
So far I haven't put much thought into this stuff, but I think it'd be a good idea to have a real versioning system, i.e. every new exported symbol gets tagged with a version number and the modder has to declare in their mod which version they intend to target. With ZDoom's tendency to add new features this may otherwise get out of hand fast if there's clashes with no safeguards.
-
- Posts: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: [Zscript] Mod/File checking
To supply your idea, perhaps a definable warning message modders can use to print in consoles on what could happen if using a version above/below, and possible what may happen when mixing mod X/Y/Z together with another that's not very compatible. That could couple nicely with my original suggestion.
-
-
- Posts: 17923
- Joined: Fri Jul 06, 2007 3:22 pm
Re: [Zscript] Mod/File checking
Why is the block named "Default" instead of "Properties"? It doesn't really matter much obviously but "Properties" seems more appropriate.Graf Zahl wrote:That's to avoid polluting the main class body with the properties. They use quite different syntax than the rest and would cause parsing problems otherwise.
-
- Posts: 786
- Joined: Wed Feb 23, 2011 11:04 am
- Preferred Pronouns: No Preference
Re: [Zscript] Mod/File checking
So after having a quick look at this I have to ask: In the 'Default' block, is there a reason why apparently to only thing not requiring a semicolon is +FLAGNAME/-FLAGNAME ? Just curious.
-
- Lead GZDoom+Raze Developer
- Posts: 49140
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Zscript] Mod/File checking
Because many users tend to put multiple flags on one line and then the semicolons become a distraction. I can add that one is allowed after a flag name for consistency but I won't force it.
@Gez: Because that's what it had been named in ZDoom since forever. Randi just used the same name here. But since we are still in the initial stage, if there's consensus that it should be changed it can still be done.
@Gez: Because that's what it had been named in ZDoom since forever. Randi just used the same name here. But since we are still in the initial stage, if there's consensus that it should be changed it can still be done.
-
- Posts: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: [Zscript] Mod/File checking
Allowing it to ignore the semicolon basically? That works!Graf Zahl wrote:Because many users tend to put multiple flags on one line and then the semicolons become a distraction. I can add that one is allowed after a flag name for consistency but I won't force it.
So then, I know you probably haven't thought about it as you stated earlier, but what plans do you have for loading conditions in control lumps? Because all I see right now in zscript.txt is just loading of the filenames (though obviously that's because there's no need for anything in them yet.)
-
- Posts: 4349
- Joined: Sun Feb 06, 2005 6:39 am
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Capital of Explodistan
Re: [Zscript] Mod/File checking
Why make defining the type optional though? Wouldn't it be better to actually avoid any ambiguity on that front?Graf Zahl wrote:Yes, you can. But it's just 'const Name1 = "...";'
-
- Posts: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: [Zscript] Mod/File checking
Correct me if I'm wrong, Graf: they probably resolve based on detection of "" or not. If no "" is detected, it can detect if it's an int or float based on a period being present or not.