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
ZzZombo
Posts: 317
Joined: Mon Jul 16, 2012 2:02 am

Re: ZScript Discussion

Post by ZzZombo »

Sorry, Graf, but your arguments are... pathetic and, frankly, nonsense. You could also make actor health a string, what does that prove? That you have the power for that? Nobody doubts that here; better ask yourself should you, huh. What does that tell? Many things. First, "flags.shootable" asserts that indeed, I mean to access an actor's flag, because what if there is a variable starting with 'b', like 'bShooting'? How am I supposed to know what is a flag and what is a variable? Look them up in a list of flags? But, meh, there is none for ZScript readily available, because it gets "synthesized" somewhere else. Even then, having to look such information that otherwise could be easily inferred from just names and naming conventions should be screaming at you "BAD DESIGN!". And I'm sure sticking to the current scheme also significantly slows editing tools down from picking ZScript up, how can they determine what is this and that with such poor design?

Also, you contradict yourself lately. "About the b prefix for the flags, that's because of avoiding naming conflicts with these auto-synthesized fields, as I said before." -- yeah, 'flags.[NAME]' does that even better, for stated reasons.

"It's the ACTOR that's shootable, not the flags belonging to the actor."

Ugh, have you never heard about such concepts as structuring related things together? Really? You gotta be kidding me and yourself. I dunno what are they called in English, but it is only natural to group such things together under a dedicated name and nobody in sane mind will ever think that flags can be shot. So... what do we have in favor of keeping things as is? Nothing.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript Discussion

Post by Graf Zahl »

How about

Code: Select all

target.pos = otheractor.pos + target.vel;
(That is, if pos was writable to begin with.

A vector has specific properties, but a flags field has not. It'd just be there in order to be there, not to serve any function. It's really hard to take a seasoned programmer seriously if such [censored word] bullshit is all that gets brought up.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript Discussion

Post by Graf Zahl »

ZzZombo wrote:Ugh, have you never heard about such concepts as structuring related things together? Really? You gotta be kidding me and yourself. I dunno what are they called in English, but it is only natural to group such things together under a dedicated name and nobody in sane mind will ever think that flags can be shot. So... what do we have in favor of keeping things as is? Nothing.

Indeed I have. But the flags in Doom are not conceptually related. They are just a large collection of boolean properties that were lumped together in order to save space, not to structure stuff.
Gez
 
 
Posts: 17942
Joined: Fri Jul 06, 2007 3:22 pm

Re: ZScript Discussion

Post by Gez »

Graf Zahl wrote:Of these 3 variants the last one is by far the most concise because it leaves no question about WHAT is shootable - it's the target! It's not the flags!
No, in that last variant, the target isn't shootable, it's bshootable. I'm not sure what the definition of bshooting is exactly.

Arguments in bad faith can be had by everyone. What reply do you have to my points, which are:
1. Don't change the flags' name. It's SHOOTABLE, not BSHOOTABLE. Changing the name is a source of confusion greater than believing an user might think it's the flags that would be shot.
2. If you use a prefix, use one that is 100% foolproof, not one that can be ambiguous.
Hell Theatre
Posts: 23
Joined: Sat Apr 30, 2016 10:33 am

Re: ZScript Discussion

Post by Hell Theatre »

What is this: Congregation of the armchair analysts?

@Zzombo: Following your logic it should probably be:

Code: Select all

if (actor.targetinginformation.bShootable) actor.positioninformation.velocity.z += 5;
right? Because as you said: Information needs to be grouped by relation.

Did you ever hear the term "Information overload"?

If there is one thing to be criticized here it's that ZScript somehow has to expose an underlying engine that has grown for more than 20 years with nobody truly leading and guiding. And let's be clear: ZDoom isn't Graf's project, it's Randi's, so if you want to blame these structural issues, at least blame the correct person.
Can this be solved? Probably. Can this be solved without the project leader providing active input and guidance. Certainly not! Under the given conditions, what's there is probably the best possible outcome, and compared to all comparable endeavours by other ports, with the sole exception of Vavoom it exceeds all of them by miles. So if you want to provide some input, make it count. All I see is nitpicking at pieces where different development philosophies are at odds, not where something is fundamentally wrong.
Gez
 
 
Posts: 17942
Joined: Fri Jul 06, 2007 3:22 pm

Re: ZScript Discussion

Post by Gez »

Hell Theatre wrote:What is this: Congregation of the armchair analysts?
When this began Graf said "shut the fuck up about bikeshedding and let me work, we'll resolve details later". Later is now. We're in the phase where ZScript is going to become its final form, and if there's something that bothers you about how it is right now, it's now that you should come up with it.

And as I said, arguments in bad faith can be had by everyone, so I'd like it, personally, if people were debating without caricaturing each others' viewpoint.
User avatar
VICE
Posts: 405
Joined: Wed Mar 28, 2012 4:03 am
Location: The Shadow Realm (no cap)
Contact:

Re: ZScript Discussion

Post by VICE »

I just want to throw my 2 cents in and say that as a modder, I would prefer to work with something like "flag.Shootable" rather than "bShootable".
It makes the flag more "readable" in my opinion, so you can skim-read it faster, but I guess that's a matter of preference and what you're used to. I personally care more that the name tells me that it's a flag, rather than telling me that's it's boolean.
I don't think anyone who grasps what flags are in the first place would confuse this to mean that the flag itself is shootable.
Hell Theatre
Posts: 23
Joined: Sat Apr 30, 2016 10:33 am

Re: ZScript Discussion

Post by Hell Theatre »

Gez wrote:
Hell Theatre wrote:What is this: Congregation of the armchair analysts?
When this began Graf said "shut the fuck up about bikeshedding and let me work
You know what? You jokers still haven't gone past the bikeshedding. And that's a problem.
Graf is absolutely right here to ignore such unproductive bickering.

It's not that there's anything fundamentally wrong here but that there's 3 or 4 people who get hung up on a triviality that in the big picture has absolutely no relevance. Who will care if the variable is named differently?
Because that's all that's being discussed here. It's much ado about absolutely nothing you create.

Where's the constructive feedback? The same pointless nonsense was also brought up when the flags were first implemented. Question: Would the same stupid argument be brought forth if on the C side the flags had actually been bitfields that get addressed like real variables? All I see is that Graf took the ugliest part in here and made it more accessible and yet here's a chorus of 4 crickets which seems to demand some regression again. It's hard to take this seriously.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript Discussion

Post by Graf Zahl »

Megaherz wrote:I just want to throw my 2 cents in and say that as a modder, I would prefer to work with something like "flag.Shootable" rather than "bShootable".
I can accept that some people see it this way. But as things are, even with such a triviality you will get ten different opinions from ten different people if you ask them but ultimately have to choose one. If I do what you like, someone else will complain. If I listen to Zzombo that variables need to be grouped by functionality, someone else will say that this is pointless verbosity.

The thing is, there is no right or wrong here, both are valid concepts to structure things, but it cannot be done both ways at the same time. So what I did was simple: I chose by precedent, i.e. where possible I chose how things were declared in the C++ code, I only made an exception for the flags because the way they need to be used in the C code had been a constant source of irritation since the first time I started working on the Doom code and I had always wished that these could be used in a saner fashion than boolean masking madness. But when deciding how to name them I mostly used the rest of the design of the internal data as a guide, I only added the 'b' prefix because the flags are not actually declared anywhere, they are synthesized from internal data tables to avoid redundant declarations.
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

Re: ZScript Discussion

Post by D2JK »

> "Is there any way to retrieve the current bobbing X,Y offsets applied by A_WeaponReady?"
>> "OverlayX and OverlayY which are available in Decorate. Just using them in the layer without parameters retrieves that calling layer's X and Y coordinates, mind."

I'm aware of those two expressions, and know what they do, but they don't work for this purpose; for example, A_LogInt(OverlayY()); will tell you that the Y-offset stays at 32 even if the player movement is causing the weapon sprite to bob like crazy.

Maybe you read my question too hastily. ;)
ZzZombo
Posts: 317
Joined: Mon Jul 16, 2012 2:02 am

Re: ZScript Discussion

Post by ZzZombo »

Well, for the record, I reacted with hostility simply because Hell Theatre, who barely even participated in the forums at all, suddenly found possible for him to come into a pretty intense debate, utterly declare one side the bad boys, LIE about the arguments they brought up as "merely a matter of preference but not a matter of being right or wrong" while I, Gez and others already have told that PRACTICAL problems will that bring in the future, all w/o even attempting to address anything, as well as lie about my personal contribution to the discussion as having no point, and call them all useless bikeshedders striving for nitpicking the most stupid and useless things.
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: ZScript Discussion

Post by Major Cooke »

Graf Zahl wrote:

Code: Select all

States(Actor, Overlay, Weapon, Item)
What exactly are the parameters here for?
They are for determining what kinds of functions a state may call. This is to resolve the problem that weapon and custom inventory actions need to be called with a foreign object as 'self' and help determining the required signature of any action function that is compatible and to perform. Don't worry, this will be explained in the Wiki.
I trust you'll be the one to document this, because I don't know how they run either.
D2JK wrote:I'm aware of those two expressions, and know what they do, but they don't work for this purpose; for example, A_LogInt(OverlayY()); will tell you that the Y-offset stays at 32 even if the player movement is causing the weapon sprite to bob like crazy.

Maybe you read my question too hastily. ;)
Yeah I did. In that case, no. You'll have to invent your own custom bobbing to get that to work.
Graf Zahl wrote:
Megaherz wrote:I just want to throw my 2 cents in and say that as a modder, I would prefer to work with something like "flag.Shootable" rather than "bShootable".
I can accept that some people see it this way. But as things are, even with such a triviality you will get ten different opinions from ten different people if you ask them but ultimately have to choose one. If I do what you like, someone else will complain. If I listen to Zzombo that variables need to be grouped by functionality, someone else will say that this is pointless verbosity.

The thing is, there is no right or wrong here, both are valid concepts to structure things, but it cannot be done both ways at the same time. So what I did was simple: I chose by precedent, i.e. where possible I chose how things were declared in the C++ code, I only made an exception for the flags because the way they need to be used in the C code had been a constant source of irritation since the first time I started working on the Doom code and I had always wished that these could be used in a saner fashion than boolean masking madness. But when deciding how to name them I mostly used the rest of the design of the internal data as a guide, I only added the 'b' prefix because the flags are not actually declared anywhere, they are synthesized from internal data tables to avoid redundant declarations.
Let's not forget this is how UnrealScript does it too. Seems most people haven't worked with it yet. Well, okay, I haven't but even randi said he prefers it with 'b'. And what randi says, goes.
ZzZombo wrote:Well, fr the record, I reacted with hostility simply because Hell Theatre, who barely even participated in the forums at all, suddenly found possible for him to come into a pretty intense debate, utterly declare one side the bad boys, LIE about the arguments they brought up as "merely a matter of preference but not a matter of being right or wrong" while I, Gez and others already have told that PRACTICAL problems will that bring in the future, as well as lie about my personal contribution to the discussion as having no point, and call them all useless bikeshedders striving for nitpicking the most stupid and useless things.
In that case you should include their name next time. It seemed like it was aimed at Graf.
User avatar
Hellser
Global Moderator
Posts: 2776
Joined: Sun Jun 25, 2006 4:43 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Citadel Station

Re: ZScript Discussion

Post by Hellser »

Topic was split. Continue discussion.
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: ZScript Discussion

Post by Major Cooke »

Thanks Hellser.
Gez wrote:1. Don't change the flags' name. It's SHOOTABLE, not BSHOOTABLE. Changing the name is a source of confusion greater than believing an user might think it's the flags that would be shot.
If I remember semi-correctly, this can't be done because the parser can't read them properly, or something along those lines. So it needs a prefix. Also, think of it as bSHOOTABLE since the b stands for boolean.
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

Re: ZScript Discussion

Post by D2JK »

Let's say I have a missile with +HITMASTER flag. Can I now use CanCollideWith() to stop the hit actor from colliding with the missile from that point on (I restore the missile's properties and shoot it at further targets)? If yes, how do I use it?
Locked

Return to “Scripting”