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 Major Cooke » Tue Dec 06, 2016 8:21 am

I tossed up D4D's key picker upper on the ThinkerIterator page.

Also, Graf, I'm looking forward to the merge. :mrgreen:
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: ZScript Discussion

Postby Graf Zahl » Tue Dec 06, 2016 8:32 am

Actually, that particular use case is better suited for a BlockThingsIterator because it needs to look at far less actors...
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: ZScript Discussion

Postby Major Cooke » Tue Dec 06, 2016 8:49 am

True, but at the time it was made, BlockThingsIterator didn't exist. It was made at least like... a fw weeks to a month before it came into existence.

But I need more information on how BlockThingsIterator works first before I can use it. What I cannot tell is, is there an internal range or do we need to perform the range ourselves?
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: ZScript Discussion

Postby Major Cooke » Tue Dec 06, 2016 9:11 am

Another quick question, is it possible to compare colors?
Code: Select allExpand view
if (bloodcolor == "Red")

If not, could there be a function which allows comparing?
Code: Select allExpand view
if (CompareColor(bloodcolor,"Red"))
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: ZScript Discussion

Postby Graf Zahl » Tue Dec 06, 2016 9:12 am

Major Cooke wrote:True, but at the time it was made, BlockThingsIterator didn't exist. It was made at least like... a fw weeks to a month before it came into existence.

But I need more information on how BlockThingsIterator works first before I can use it. What I cannot tell is, is there an internal range or do we need to perform the range ourselves?



Right now it does not do an internal range check, but that should be added for performance reason because every return that can be discarded on the native side is a win.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: ZScript Discussion

Postby Graf Zahl » Tue Dec 06, 2016 9:15 am

Major Cooke wrote:Another quick question, is it possible to compare colors?
Code: Select allExpand view
if (bloodcolor == "Red")

If not, could there be a function which allows comparing?
Code: Select allExpand view
if (CompareColor(bloodcolor,"Red"))


Careful. Bloodcolor has a palette index mixed in, it's not directly comparable, you'd have to do 'if(bloodcolor & 0xffffff) == color("Red")) to mask that out.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: ZScript Discussion

Postby Major Cooke » Tue Dec 06, 2016 9:21 am

Graf Zahl wrote:Careful. Bloodcolor has a palette index mixed in, it's not directly comparable, you'd have to do 'if(bloodcolor & 0xffffff) == color("Red")) to mask that out.

Hmm, perhaps a dedicated function inside Actor.txt might be best so people can actually do that.

Graf Zahl wrote:Right now it does not do an internal range check, but that should be added for performance reason because every return that can be discarded on the native side is a win.

All of them could use this.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: ZScript Discussion

Postby Major Cooke » Tue Dec 06, 2016 10:04 am

I'm curious, how does 'frame' work? Seems like it's performing character to int conversions internally.
Last edited by Major Cooke on Tue Dec 06, 2016 10:08 am, edited 1 time in total.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: ZScript Discussion

Postby Xaser » Tue Dec 06, 2016 10:07 am

Fortunately, it's pretty simple: Frame 0 is 'A', 1 is 'B', 2 is 'C', and so on.
User avatar
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

Re: ZScript Discussion

Postby Major Cooke » Tue Dec 06, 2016 10:09 am

That's actually perfect for my needs. Thanks!
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: ZScript Discussion

Postby Major Cooke » Tue Dec 06, 2016 10:18 am

Eruanna wrote:I've gone ahead and started the build for what might be the last GZZScript build then. :P


It won't be the last. This is merely the first part of ZScript to come. Graf's going to continue developing ZScript on the separated branch, from the looks of it.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: ZScript Discussion

Postby Leonard2 » Tue Dec 06, 2016 10:24 am

Graf Zahl wrote:I also think we can now declare most of what is there final with no more need to change. This also means, once a decision is made, nothing in there can be changed anymore.

Please NO.
I think MANY things about the language should be seriously discussed before making the mistake of "having it final" again and make the whole thing turn into DECORATE 2.0.
I recall countless times where you said "zscript is still in the works so let's not discuss this now" which in the end only allowed you to avoid important matters that need discussion.
Ironically the urge to make sure everything is right here is only caused by this "let's make everything final" mentality which I never understood.
User avatar
Leonard2
 
Joined: 15 Aug 2012

Re: ZScript Discussion

Postby Xaser » Tue Dec 06, 2016 10:44 am

Leonard2 wrote:I think MANY things about the language should be seriously discussed

Like what?

[Note: I'm asking earnestly. I'm curious to know what discussion points are still on the table, if any.]
User avatar
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

Re: ZScript Discussion

Postby Major Cooke » Tue Dec 06, 2016 11:13 am

Leonard, he means for phase 1. And he's probably just talking about the Actor part.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: ZScript Discussion

Postby Graf Zahl » Tue Dec 06, 2016 11:45 am

@Leonard:

If you have issues, please name them. I can only go by the feedback I get from users and so far nobody has told me that stuff needs to be reviewed.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

PreviousNext

Return to Scripting

Who is online

Users browsing this forum: No registered users and 3 guests