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.

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!)
Locked
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript Discussion

Post by Major Cooke »

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

Also, Graf, I'm looking forward to the merge. :mrgreen:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript Discussion

Post by Graf Zahl »

Actually, that particular use case is better suited for a BlockThingsIterator because it needs to look at far less actors...
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript Discussion

Post by Major Cooke »

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
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript Discussion

Post by Major Cooke »

Another quick question, is it possible to compare colors?

Code: Select all

if (bloodcolor == "Red")

If not, could there be a function which allows comparing?

Code: Select all

if (CompareColor(bloodcolor,"Red"))
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript Discussion

Post by Graf Zahl »

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+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript Discussion

Post by Graf Zahl »

Major Cooke wrote:Another quick question, is it possible to compare colors?

Code: Select all

if (bloodcolor == "Red")

If not, could there be a function which allows comparing?

Code: Select all

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
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript Discussion

Post by Major Cooke »

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
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript Discussion

Post by Major Cooke »

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
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: ZScript Discussion

Post by Xaser »

Fortunately, it's pretty simple: Frame 0 is 'A', 1 is 'B', 2 is 'C', and so on.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript Discussion

Post by Major Cooke »

That's actually perfect for my needs. Thanks!
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript Discussion

Post by Major Cooke »

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
Leonard2
Posts: 313
Joined: Tue Aug 14, 2012 6:10 pm

Re: ZScript Discussion

Post by Leonard2 »

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
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: ZScript Discussion

Post by Xaser »

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
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: ZScript Discussion

Post by Major Cooke »

Leonard, he means for phase 1. And he's probably just talking about the Actor part.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript Discussion

Post by Graf Zahl »

@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.
Locked

Return to “Scripting”