Clarity is often at odd with brevity, yes.Graf Zahl wrote:There are people who would complain, saying that typing that 'b' is 6 characters less than 'flags.'...
ZScript Discussion
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!)
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!)
-
-
- Posts: 17905
- Joined: Fri Jul 06, 2007 3:22 pm
Re: ZScript Discussion
-
- Posts: 8192
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
To be fair, he did say the b is for boolean.
-
- Posts: 13698
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: ZScript Discussion
I prefer the "flags." method, myself.Graf Zahl wrote:There are people who would complain, saying that typing that 'b' is 6 characters less than 'flags.'...
-
- Posts: 8192
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Against supporting 'flags.', it's misleading into thinking one could perform this:
Only to receive a rather unwelcome discovery, something as -- from a programmer's prospective -- I'd like to avoid unless it's ACTUALLY doable.
Code: Select all
target.flags = tracer.flags;
And throwing ms. clarity out the window especially...Gez wrote:Clarity is often at odd with brevity, yes.
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: ZScript Discussion
I would very much like to see iterators eventually... using ACS to assign temporary TIDs to iterate through things is such a shit way of doing things.
I personally have no issues with the variable prefix; has anyone worked with Unreal Engine? Some of you might get a headache from all that bIsShootable, iCoffeCups, SPlayerName, fDistanceToLODThreshold...
I personally have no issues with the variable prefix; has anyone worked with Unreal Engine? Some of you might get a headache from all that bIsShootable, iCoffeCups, SPlayerName, fDistanceToLODThreshold...
-
- Posts: 8192
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Ah yes, I forgot they came from there!
So indeed, I think it should remain as is with the b prefix.
So indeed, I think it should remain as is with the b prefix.
-
- Lead GZDoom+Raze Developer
- Posts: 49118
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
The reason I am against the 'flags' solution is that it implies something that isn't there. These variables are essentially properties of the actor, whether they are grouped as flags or not is irrelevant. The bigger problems will appear once structs become assignable, then this would cause a needless complication.
About merging back, I still need to do a few minor things. For example, what about the flags that cannot be changed without requiring some special actions to be performed, like NOSECTOR and NOBLOCKMAP?
About merging back, I still need to do a few minor things. For example, what about the flags that cannot be changed without requiring some special actions to be performed, like NOSECTOR and NOBLOCKMAP?
-
- Posts: 8192
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Well, does A_ChangeFlag still work? Could be used for those in the mean time while you figure something out.
Or create functions for those specifically and make the bitfield read only for those.
Or create functions for those specifically and make the bitfield read only for those.
-
- Lead GZDoom+Raze Developer
- Posts: 49118
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Yeah, that's the idea. For now making them read only should be enough.
-
- Posts: 8192
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
I certainly dont mind A_ChangeFlag for this case, but if you want some:
etc..
Code: Select all
target.bNoBlockMap(true);
target.hasNoBlockMap
-
- Lead GZDoom+Raze Developer
- Posts: 49118
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Of course I'll add two special setter functions here.
-
- Posts: 785
- Joined: Wed Feb 23, 2011 11:04 am
- Preferred Pronouns: No Preference
Re: ZScript Discussion
I think I spotted a bug here.
The way the flags are cleared is like this:
Shouldn't it be with a ~ or am I missing something?
The way the flags are cleared is like this:
Code: Select all
self->flags &= MF_NOBLOCKMAP;
Code: Select all
self->flags &= ~MF_NOBLOCKMAP;
-
- Lead GZDoom+Raze Developer
- Posts: 49118
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Ooops...
-
- Posts: 785
- Joined: Wed Feb 23, 2011 11:04 am
- Preferred Pronouns: No Preference
Re: ZScript Discussion
Um, okay, so, this may sound like a really dumb/obvious question. But is this a new syntax for clearing flags?
https://github.com/rheit/zdoom/blob/zsc ... .cpp#L4870
I've never seen it like this before; the * confuses me.
https://github.com/rheit/zdoom/blob/zsc ... .cpp#L4870
Code: Select all
self->flags &= *MF_NOBLOCKMAP;
-
- Lead GZDoom+Raze Developer
- Posts: 49118
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Damnit. One should think that such trivial changes can't get wrong...