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!)
-
- Lead GZDoom+Raze Developer
- Posts: 49115
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
The Loremaster uses DoSpecialDamage.
The difference is, DoSpecialDamage is called when it is decided that the projectile actually should damage the target, after it has already collided. SpecialMissileHit is for performing special actions BEFORE the projectile is exploded. This is used by a few Hexen projectiles that perform special actions on collision and do not explode, like the lightining attack. Do not confuse this with collision exclusion. It may sound similar on the surface but really is not.
The difference is, DoSpecialDamage is called when it is decided that the projectile actually should damage the target, after it has already collided. SpecialMissileHit is for performing special actions BEFORE the projectile is exploded. This is used by a few Hexen projectiles that perform special actions on collision and do not explode, like the lightining attack. Do not confuse this with collision exclusion. It may sound similar on the surface but really is not.
-
- Posts: 8191
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Does it take the HIT* pointer flags into account before SpecialMissileHit function is checked?
-
- Posts: 4984
- Joined: Sun Nov 14, 2010 12:59 am
Re: ZScript Discussion
MaxED wrote:Can ZScript class be inherited from DECORATE actor?
This is important and should emphasized, because this means that if you have mod A, which uses ZSCRIPT, and mod B, which uses DECORATE, and you want mod A to inherit classes from mod B, well, you won't be able to do that.Graf Zahl wrote:No. Since DECORATE is parsed last the info is not available.
-
- Lead GZDoom+Raze Developer
- Posts: 49115
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Can't say. SpecialMissileHit gets called right before deciding if ExplodeMissile needs to be callsed.Major Cooke wrote:Does it take the HIT* pointer flags into account before SpecialMissileHit function is checked?
-
- Posts: 8191
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Oh wait, I don't need those. It takes an actor called victim instead which is all I needed.
To clarify about this recent new addition of 'let p = Classtype(objectvar)'... If 'p' is not, say, MinotaurFriend like the change you made, would it return null even though it exists as something else? That is, if it's a different class instead of minotaurfriend. Would p be null?
To clarify about this recent new addition of 'let p = Classtype(objectvar)'... If 'p' is not, say, MinotaurFriend like the change you made, would it return null even though it exists as something else? That is, if it's a different class instead of minotaurfriend. Would p be null?
-
- Lead GZDoom+Raze Developer
- Posts: 49115
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Yes. That's the entire point of a dynamic cast - it prevents that you access an incompatible object through a pointer.
-
- Posts: 8191
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Okay, so what other 'special' words are there besides 'is' and 'let'? It's time to start adding these all to the wiki again.
-
- Lead GZDoom+Raze Developer
- Posts: 49115
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Take a look at sc_man_scanner.re That contains all the reserved words, although many of them are just reserved but not used. Or do you only want to know the ones that do something? That list is in zcc_parser.cpp.
-
- Posts: 8191
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
The latter. And okay. Now I need clarification on what the following are:
- until
- in
- out
-
- Lead GZDoom+Raze Developer
- Posts: 49115
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
'until' is sometimes used as a negative 'while'. Although being parsed it's currently not being processed by the compiler.
In and Out are qualifiers for function parameters, 'out' causes a parameter being passed by reference. 'In' can be added as well, but has no function, it merely serves as means of documentation.
In and Out are qualifiers for function parameters, 'out' causes a parameter being passed by reference. 'In' can be added as well, but has no function, it merely serves as means of documentation.
-
- Posts: 8191
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Alright.
Next question, how does GetSpriteIndex work? Does it convert the frame's A-Z (or whatever limit it is, I forgot) from 0 to that limit? Is the 'sprite' property what we use to compare/find what sprite an actor currently has?
Next question, how does GetSpriteIndex work? Does it convert the frame's A-Z (or whatever limit it is, I forgot) from 0 to that limit? Is the 'sprite' property what we use to compare/find what sprite an actor currently has?
-
- Lead GZDoom+Raze Developer
- Posts: 49115
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
No, it takes the four character name and returns the internal index for it.
-
-
- Posts: 10773
- Joined: Sun Jul 20, 2003 12:15 pm
Re: ZScript Discussion
Oh, that's interesting. Could that function be used to set an actor's sprite property directly via something like:
?
(Can't test that code presently but that seems to be way thingdef_states.cpp is using said function internally. This would be extremely useful for a thing I'm planning on making).
Code: Select all
self.sprite = GetSpriteIndex("SHTG");
(Can't test that code presently but that seems to be way thingdef_states.cpp is using said function internally. This would be extremely useful for a thing I'm planning on making).
-
- Lead GZDoom+Raze Developer
- Posts: 49115
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
Yes, that should work.
-
- Posts: 545
- Joined: Sat Aug 30, 2014 8:21 am
Re: ZScript Discussion
Suggestion: could someone please make a wiki page or section about iterators, documenting any of the following:
- brief introduction, their purpose, and how they work
- iterator types (ActorIterator, ThinkerIterator, anything else?)
- what sort of task does each type excel at
- perhaps a brief explanation of the performance cost
- usage instructions, the options available, example code
- brief introduction, their purpose, and how they work
- iterator types (ActorIterator, ThinkerIterator, anything else?)
- what sort of task does each type excel at
- perhaps a brief explanation of the performance cost
- usage instructions, the options available, example code