Yeah I forgot about that, so a check performed for two tics instead aught to suffice. It's what D4D has to do for resetting the extra jumping.Kinsie wrote:In my past experiences with Reelism, actors can hit the point of having 0 Z velocity in mid-air for a frame or so when at the peak of their arc of upward momentum (ie. when thrusted into the air).Major Cooke wrote:Easiest way to tell is if they have no Z velocity.
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: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
-
- Lead GZDoom+Raze Developer
- Posts: 49130
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
The thing here is, it's the weapon's attack function that is responsible for setting the player's attack state. Feel free to set it to whatever you like.Arctangent wrote:I mean, there were ways to do that in Decorate.cambertian wrote:Did ZScript finally clear up the whole "Players can't have animations for both melee and ranged attacks" thing that bugged me so much back in the days of DECORATE? Like how Quake's Ranger switches to an axe in both first AND third person?
-
- Posts: 1235
- Joined: Thu Nov 06, 2014 1:53 pm
Re: ZScript Discussion
Yeah, I can imagine ZScript make it a lot easier. Just, I'm not really sure if cambertian is asking what he wants to ask.
-
- Posts: 60
- Joined: Wed Sep 08, 2004 1:26 pm
- Location: Russia
Re: ZScript Discussion
Game crashes with Access Violation when I use action functions inside non-action functions (I know this is something I should not do). Are these crashes intended, or should I report a bug?
EDIT: just read Graf's post from another thread where he said "you'll get a crash if a null pointer gets here", so I guess crashes are intended.
EDIT: just read Graf's post from another thread where he said "you'll get a crash if a null pointer gets here", so I guess crashes are intended.
-
- Lead GZDoom+Raze Developer
- Posts: 49130
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
If you get a crash log, report a bug. A genuine crash is always a bug. If you just get a console message about accessing address zero, ask again.
-
- Posts: 60
- Joined: Wed Sep 08, 2004 1:26 pm
- Location: Russia
Re: ZScript Discussion
Ok, got it.Graf Zahl wrote:A genuine crash is always a bug.
Turned out it's not action function fault. The crash was caused by setting the sprite to one that was not used before. Same issue as this one, except I get no console spam, it always crashes.
-
- Posts: 405
- Joined: Wed Mar 28, 2012 4:03 am
- Location: The Shadow Realm (no cap)
Re: ZScript Discussion
I'm looking to re-define an actor from another WAD.
What I want to do is have a new Zscript actor that uses the same name as another, existing Zscript actor.
If you tried something like this in Decorate, you'd get an error message at launch but the game would still run and the actor that loaded last would be the one that the engine ends up using (so it would "work" as long as the intended actor was loaded last).
I'm hoping that there's some ClearActor function or something of that sorts that I'm unaware of that I can use to do this without having to rename my new actor. Is that possible?
If not, could it be made possible in a future version of Zscript?
What I want to do is have a new Zscript actor that uses the same name as another, existing Zscript actor.
If you tried something like this in Decorate, you'd get an error message at launch but the game would still run and the actor that loaded last would be the one that the engine ends up using (so it would "work" as long as the intended actor was loaded last).
I'm hoping that there's some ClearActor function or something of that sorts that I'm unaware of that I can use to do this without having to rename my new actor. Is that possible?
If not, could it be made possible in a future version of Zscript?
-
- Lead GZDoom+Raze Developer
- Posts: 49130
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
It is not possible to have two classes of the same name. The game cannot deal with this situation.VICE wrote:I'm looking to re-define an actor from another WAD.
What I want to do is have a new Zscript actor that uses the same name as another, existing Zscript actor.
While DECORATE will rename the duplicate, to keep old mods which accidentally did this working, ZScript will error out and not allow it at all.
Won't happen. You never know if something else may reference that actor later and choke on a bad replacement.VICE wrote: I'm hoping that there's some ClearActor function or something of that sorts that I'm unaware of that I can use to do this without having to rename my new actor. Is that possible?
If not, could it be made possible in a future version of Zscript?
-
- Posts: 317
- Joined: Mon Jul 16, 2012 2:02 am
Re: ZScript Discussion
Why it's not possible to extend a class/override a function implementation, again?
-
- Posts: 405
- Joined: Wed Mar 28, 2012 4:03 am
- Location: The Shadow Realm (no cap)
Re: ZScript Discussion
Well, that wasn't my intention (I suspected the engine does something with the old actor, but I thought it just purged it).Graf Zahl wrote: It is not possible to have two classes of the same name. The game cannot deal with this situation.
In fact,
It would be great if there was some way to do exactly that ^, a way to rename the duplicate myself, somehow, but in advance so the engine understands that it's purposeful and doesn't spit out an error.Graf Zahl wrote:While DECORATE will rename the duplicate, to keep old mods which accidentally did this working
I agree with the logic here, obviously, but I think that is ultimately the modder's responsibility.Graf Zahl wrote:Won't happen. You never know if something else may reference that actor later and choke on a bad replacement.
-
- Lead GZDoom+Raze Developer
- Posts: 49130
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
I meant it will rename the DUPLICATE, i.e. YOUR class.
You cannot throw out a defined class because you have no idea what still needs this class and the data owned by it. And the name needs to be unique because otherwise some stuff, like state pointers cannot be restored from a savegame.
You cannot throw out a defined class because you have no idea what still needs this class and the data owned by it. And the name needs to be unique because otherwise some stuff, like state pointers cannot be restored from a savegame.
-
- Posts: 405
- Joined: Wed Mar 28, 2012 4:03 am
- Location: The Shadow Realm (no cap)
Re: ZScript Discussion
I see. My experience with this was different though:Graf Zahl wrote:I meant it will rename the DUPLICATE, i.e. YOUR class
I replaced a weapon in this way, and ACS scripts that referred to the original weapon by name started applying to the new one and stopped working with the old (I checked the old with IDFA), and the console "give" command gave me the new one correctly. That's why I thought that the old one was made inaccessible internally but its information was kept somewhere for inheritance etc. That was in GZDoom 2.2.0, though, I guess that could be irrelevant now.
And just to be perfectly clear, I wasn't looking to completely throw the old actor out, or to have two actors with the same actor name existing at once (duh). I was interested to see if there was a way to resolve a name conflict in advance without it getting to a point of spitting out errors.
Specifically, I wanted to see if there was now a way to modify weapons in a certain mod, such that it doesn't affect the ACS scripts that they were designed to work with.
I needed to do this without modifying the base mod, so that I could do my changes from a separate file. (Zombo's use of the word "extend" was probably more appropriate here).
I guess that's probably still not possible with Zscript, but I thought I'd ask in case it were. Anyway, thanks for the help.
-
- Lead GZDoom+Raze Developer
- Posts: 49130
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript Discussion
That won't work anymore, even from DECORATE.
And since this came with a console warning from the beginning, my only answer can be, that ZDoom takes no guarantee whatsoever that mods which are not warning-free will continue to work.
And since this came with a console warning from the beginning, my only answer can be, that ZDoom takes no guarantee whatsoever that mods which are not warning-free will continue to work.
-
- ... in rememberance ...
- Posts: 6109
- Joined: Fri Jul 06, 2007 2:34 pm
Re: ZScript Discussion
With the advent of this, how close to actor (specifically projectile) collision detection can we get in ZScript? For example, could we have functions for when we're colliding with an actor, and return true if we want it to result in a collision or false if we want to pass through?
Also, do we have a way of interacting with the children of a given actor?
Also, do we have a way of interacting with the children of a given actor?
-
- Posts: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript Discussion
Bam.
Read CanCollideWith carefully. I left very explicit instructions on how to use it. Because WYSIWYG.
If you want to get around to doing some true collision working, have your actors be solid and set up your custom conditions inside the virtual. Those that pass through all actors should immediately return false.
Careful though. This can be expensive if done too much.
Read CanCollideWith carefully. I left very explicit instructions on how to use it. Because WYSIWYG.
If you want to get around to doing some true collision working, have your actors be solid and set up your custom conditions inside the virtual. Those that pass through all actors should immediately return false.
Careful though. This can be expensive if done too much.