ZScript Discussion

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

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.

Re: ZScript Discussion

Postby DenisBelmondo » Tue Mar 28, 2017 12:51 am

EDIT: moving to other topic.
Last edited by DenisBelmondo on Tue Mar 28, 2017 1:02 am, edited 1 time in total.
User avatar
DenisBelmondo
now is time to the i386 heart on fire
 
Joined: 06 Jun 2008
Location: Two-Key Return

Re: ZScript Discussion

Postby Matt » Tue Mar 28, 2017 12:57 am

User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: ZScript Discussion

Postby DenisBelmondo » Tue Mar 28, 2017 1:02 am

Oh my bad, I'll move the question over there. Thanks!
User avatar
DenisBelmondo
now is time to the i386 heart on fire
 
Joined: 06 Jun 2008
Location: Two-Key Return

Re: ZScript Discussion

Postby ZZYZX » Wed Mar 29, 2017 7:36 am

Just curious, is there going to be any line drawing under Screen? If so, when approximately?
User avatar
ZZYZX
le chat du rabbin
 
 
 
Joined: 14 Oct 2012
Location: Ukraine
Discord: ZZYZX#1394
Github ID: jewalky

Re: ZScript Discussion

Postby Graf Zahl » Wed Mar 29, 2017 4:54 pm

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: ZScript Discussion

Postby Nash » Wed Mar 29, 2017 7:25 pm

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

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.


Constructors sound like exactly what I was looking for. How do I do those or are they possible yet?
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: ZScript Discussion

Postby Graf Zahl » Thu Mar 30, 2017 9:52 am

Constructors are not in yet.

And to be honest I need to take a break from more complex ZScript for now.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: ZScript Discussion

Postby Nash » Thu Mar 30, 2017 9:55 am

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. :mrgreen:

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)
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: ZScript Discussion

Postby Caligari87 » Sun Apr 02, 2017 1:23 pm

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:
Code: Select allExpand view
gameinfo
{
   PlayerClasses = "TestZSClass"
}


ZSCRIPT
Code: Select allExpand view
class TestZSClass : DoomPlayer
{
   override void PostBeginPlay()
   {
      Console.Printf("HI");
   }
}


8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: ZScript Discussion

Postby Graf Zahl » Sun Apr 02, 2017 1:25 pm

You *MUST* call the super method!
PlayerPawn.PostBeginPlay performs some necessary setup without which you end up with an incompletely set up player.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: ZScript Discussion

Postby Caligari87 » Sun Apr 02, 2017 1:27 pm

Yeah, just found that out. Wasn't aware it did other stuff. Whoops.

8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: ZScript Discussion

Postby Major Cooke » Mon Apr 10, 2017 8:35 am

User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: ZScript Discussion

Postby Graf Zahl » Mon Apr 10, 2017 9:17 am

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.)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: ZScript Discussion

Postby Major Cooke » Mon Apr 10, 2017 9:21 am

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!
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: ZScript Discussion

Postby Major Cooke » Wed Apr 12, 2017 8:40 am

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.
Code: Select allExpand view
TNT1 A 0 MyFunction();
TNT1 A 0 { MyFunction(); }


Does this also weigh upon the system more heavily than just executing the regular code?
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

PreviousNext

Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests