Page 55 of 123

Re: ZScript Discussion

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

Re: ZScript Discussion

Posted: Tue Dec 06, 2016 8:32 am
by Graf Zahl
Actually, that particular use case is better suited for a BlockThingsIterator because it needs to look at far less actors...

Re: ZScript Discussion

Posted: Tue Dec 06, 2016 8:49 am
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?

Re: ZScript Discussion

Posted: Tue Dec 06, 2016 9:11 am
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"))

Re: ZScript Discussion

Posted: Tue Dec 06, 2016 9:12 am
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.

Re: ZScript Discussion

Posted: Tue Dec 06, 2016 9:15 am
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.

Re: ZScript Discussion

Posted: Tue Dec 06, 2016 9:21 am
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.

Re: ZScript Discussion

Posted: Tue Dec 06, 2016 10:04 am
by Major Cooke
I'm curious, how does 'frame' work? Seems like it's performing character to int conversions internally.

Re: ZScript Discussion

Posted: Tue Dec 06, 2016 10:07 am
by Xaser
Fortunately, it's pretty simple: Frame 0 is 'A', 1 is 'B', 2 is 'C', and so on.

Re: ZScript Discussion

Posted: Tue Dec 06, 2016 10:09 am
by Major Cooke
That's actually perfect for my needs. Thanks!

Re: ZScript Discussion

Posted: Tue Dec 06, 2016 10:18 am
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.

Re: ZScript Discussion

Posted: Tue Dec 06, 2016 10:24 am
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.

Re: ZScript Discussion

Posted: Tue Dec 06, 2016 10:44 am
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.]

Re: ZScript Discussion

Posted: Tue Dec 06, 2016 11:13 am
by Major Cooke
Leonard, he means for phase 1. And he's probably just talking about the Actor part.

Re: ZScript Discussion

Posted: Tue Dec 06, 2016 11:45 am
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.