ZScript Discussion
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!)
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!)
-
- Posts: 13885
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: ZScript Discussion
@Graf: Do you want me to pull from your gz-zscript branch, or is that just experimental for you?
-
- Lead GZDoom+Raze Developer
- Posts: 49211
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
No, that's just the latest version from yesterday merged into ZDoom so that I could do a compile myself for some actual playing. But you should do an update from ZDoom before compiling.
-
-
- Posts: 17481
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: ZScript Discussion
Xaser wrote:Oh, that's interesting. Could that function be used to set an actor's sprite property directly via something like:?Code: Select all
self.sprite = GetSpriteIndex("SHTG");
(Can't test that code presently but that seems to be way thingdef_states.cpp is using said function internally. This would be extremely useful for a thing I'm planning on making).
YOOOOO that is amazing. :O :O :OGraf Zahl wrote:Yes, that should work.
D2JK wrote:Suggestion: could someone please make a wiki page or section about iterators, documenting any of the following:
- brief introduction, their purpose, and how they work
- iterator types (ActorIterator, ThinkerIterator, anything else?)
- what sort of task does each type excel at
- perhaps a brief explanation of the performance cost
- usage instructions, the options available, example code
Yes please; I would like a noob-friendly tutorial on how to use the scripted iterators.
-
- Posts: 13885
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: ZScript Discussion
My auto-update script usually takes care of that. As of now, it's up-to-date.Graf Zahl wrote:No, that's just the latest version from yesterday merged into ZDoom so that I could do a compile myself for some actual playing. But you should do an update from ZDoom before compiling.
-
- Posts: 8205
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
Re: ZScript Discussion
I'll do it when I get home. It's actually pretty easy. And BlockThingsIterator too.Nash wrote:D2JK wrote:Suggestion: could someone please make a wiki page or section about iterators, documenting any of the following:
- brief introduction, their purpose, and how they work
- iterator types (ActorIterator, ThinkerIterator, anything else?)
- what sort of task does each type excel at
- perhaps a brief explanation of the performance cost
- usage instructions, the options available, example code
Yes please; I would like a noob-friendly tutorial on how to use the scripted iterators.
-
- Posts: 317
- Joined: Mon Jul 16, 2012 2:02 am
Re: ZScript Discussion
Are overloaded functions planned?
-
- Posts: 13885
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: ZScript Discussion
Actually - I had asked this before.
Subject: ZScript Discussion
Subject: ZScript Discussion
Graf Zahl wrote:Function overloading is an ugly can of worms I won't touch. I think named arguments will be more than enough to handle such things.
-
- Lead GZDoom+Raze Developer
- Posts: 49211
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
To elaborate on that, function overloading is one of the most problematic things because it needs to make some educated decisions which overload to use if the parameters do not match 100%. And this can turn ugly. Even C++ has its share of misses here that would cause some non-trivial bugs. In 99% of all use cases you are better off naming the functions differently (like ZDoom already did internally with the SpawnMissile family) and the rest can be dealt with with named and default arguments.
-
- Lead GZDoom+Raze Developer
- Posts: 49211
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Quick note:
I just fixed a major bug with the chainsaw in the scripting branch, so I think I am pulling up the merge because that one's too important and I see no point applying the same fix to the old code a few days before it goes away. I'm giving this a few more hours but this evening I''ll merge it back to master.
I just fixed a major bug with the chainsaw in the scripting branch, so I think I am pulling up the merge because that one's too important and I see no point applying the same fix to the old code a few days before it goes away. I'm giving this a few more hours but this evening I''ll merge it back to master.
-
- Posts: 13885
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: ZScript Discussion
I've gone ahead and started the build for what might be the last GZZScript build then. 

-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: ZScript Discussion
No 100% match for overloaded method = compiler error.Graf Zahl wrote:To elaborate on that, function overloading is one of the most problematic things because it needs to make some educated decisions which overload to use if the parameters do not match 100%.
-
- Lead GZDoom+Raze Developer
- Posts: 49211
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
That's not possible because some types can be implicitly converted. And the rules for this are some of the most obtuse in C++, it's a mess I'd like to avoid.
-
- Posts: 317
- Joined: Mon Jul 16, 2012 2:02 am
Re: ZScript Discussion
Eh, eh eh eh. I hope you at least won't declare it set in stone for the week, as per your previous post, should a design issue arise. BTW, where am I supposed to grab the latest ZScript build? ZDoom/GZDoom, no difference for me.
-
- Posts: 13885
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: ZScript Discussion
https://devbuilds.drdteam.org/gzzscript/ if you can't/don't want to compile it yourself.
-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: ZScript Discussion
I meant disabling this specifically for the overloaded methods. People should use proper types anyway.Graf Zahl wrote:That's not possible because some types can be implicitly converted. And the rules for this are some of the most obtuse in C++, it's a mess I'd like to avoid.