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: 380
- Joined: Fri Jun 06, 2008 6:26 pm
- Location: Two-Key Return
Re: ZScript Discussion
EDIT: moving to other topic.
Last edited by DenisBelmondo on Tue Mar 28, 2017 1:02 am, edited 1 time in total.
-
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
-
- Posts: 380
- Joined: Fri Jun 06, 2008 6:26 pm
- Location: Two-Key Return
Re: ZScript Discussion
Oh my bad, I'll move the question over there. Thanks!
-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: ZScript Discussion
Just curious, is there going to be any line drawing under Screen? If so, when approximately?
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
The functions exist, they just have the small problem that the software versions do not clip the output so they are not suitable for user code.
-
-
- Posts: 17465
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: ZScript Discussion
The line drawer IMO, should eventually be extended to allow a line thickness parameter... lines are almost invisible to me at 4k resolution.
/////////
Question about: https://mantis.zdoom.org/view.php?id=456
/////////
Question about: https://mantis.zdoom.org/view.php?id=456
Constructors sound like exactly what I was looking for. How do I do those or are they possible yet?The Defaults make sense for actors which have to be spawned with a generic function, but for other classes the proper way should be a constructor.
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Constructors are not in yet.
And to be honest I need to take a break from more complex ZScript for now.
And to be honest I need to take a break from more complex ZScript for now.
-
-
- Posts: 17465
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: ZScript Discussion
No problem! The amount of work you did in 2017 alone is more than, like, oh I don't know, the past 2 years of progress combined or something.
I will remind you about the constructor idea some other time. It's not urgent for me, and I have lots of other features to play with currently (not to mention learning how to actually script properly and generally improving my ZScript-fu)
I will remind you about the constructor idea some other time. It's not urgent for me, and I have lots of other features to play with currently (not to mention learning how to actually script properly and generally improving my ZScript-fu)
-
- Admin
- Posts: 6191
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
Re: ZScript Discussion
So before I go crying wolf on a bug report, need to have someone else test this. It seems that overriding PostBeginPlay in Doomplayer disables look up/down.
File should be downloadable from this link. All it is, is a MAPINFO and ZScript that ZZYZX gave me to test new player classes.
https://cdn.discordapp.com/attachments/ ... sclass.pk3
MAPINFO:
ZSCRIPT
File should be downloadable from this link. All it is, is a MAPINFO and ZScript that ZZYZX gave me to test new player classes.
https://cdn.discordapp.com/attachments/ ... sclass.pk3
MAPINFO:
Code: Select all
gameinfo
{
PlayerClasses = "TestZSClass"
}
Code: Select all
class TestZSClass : DoomPlayer
{
override void PostBeginPlay()
{
Console.Printf("HI");
}
}
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
You *MUST* call the super method!
PlayerPawn.PostBeginPlay performs some necessary setup without which you end up with an incompletely set up player.
PlayerPawn.PostBeginPlay performs some necessary setup without which you end up with an incompletely set up player.
-
- Admin
- Posts: 6191
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
Re: ZScript Discussion
Yeah, just found that out. Wasn't aware it did other stuff. Whoops.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
-
- Lead GZDoom+Raze Developer
- Posts: 49184
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
More like overhead cost of pointers in general. This stuff was meant to be used to check pointer types but practical constraints basically limited it to checking if a pointer was supposed to be an object, and even that wasn't safe.
The problem with function calls is that the code is extremely generic and has to account for a lot of things. I don't really think that this can be streamlined much more without sacrificing functionality.
There's one thing in the VM which I also may scrap - and that is scripted exceptions. It's a typical pie-in-the-sky proposition but will probably totally go over the head of most scripters and offer very limited functionality, but also comes with quite a bit of overhead. On the language side this hasn't even been implemented yet and I have no plans to do so.
You have to consider that the only things ZDoom is using execptions for is to abort on errors and for FraggleScript to terminate scripts (but only because this was so badly implemented that it couldn't have been done in a saner fashion.)
The problem with function calls is that the code is extremely generic and has to account for a lot of things. I don't really think that this can be streamlined much more without sacrificing functionality.
There's one thing in the VM which I also may scrap - and that is scripted exceptions. It's a typical pie-in-the-sky proposition but will probably totally go over the head of most scripters and offer very limited functionality, but also comes with quite a bit of overhead. On the language side this hasn't even been implemented yet and I have no plans to do so.
You have to consider that the only things ZDoom is using execptions for is to abort on errors and for FraggleScript to terminate scripts (but only because this was so badly implemented that it couldn't have been done in a saner fashion.)
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Fair enough. I figured it wouldn't do much of a benefit towards subfunctions, just thought I'd check.
It does seem like this provided a minor speed boost in more 'sticky' situations with lots of ZScript heavy actors performing their stuff, so that's nice!
It does seem like this provided a minor speed boost in more 'sticky' situations with lots of ZScript heavy actors performing their stuff, so that's nice!
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Out of curiosity, on the topic of subfunctions...
Does that just apply to whenever calling it from within a function like Tick(), or does that also include in anonymous functions?
I.e.
Does this also weigh upon the system more heavily than just executing the regular code?
Does that just apply to whenever calling it from within a function like Tick(), or does that also include in anonymous functions?
I.e.
Code: Select all
TNT1 A 0 MyFunction();
TNT1 A 0 { MyFunction(); }