This one is going to be simple, brief, and much more precise!
Can this be externalized as a virtual in the player for ZScript?
https://github.com/coelckers/gzdoom/blo ... .cpp#L3290
ZScript: Externalize PlayerLandedOnThing as a virtual?
Moderator: GZDoom Developers
Re: ZScript: Externalize PlayerLandedOnThing as a virtual?
Please provide example(s) of how you plan on using this. Give more info when suggesting features. It's less likely suggestions would be struck down if you explain how they could be useful.
- nazakomu
- Posts: 131
- Joined: Wed Nov 30, 2016 12:51 am
- Graphics Processor: nVidia with Vulkan support
Re: ZScript: Externalize PlayerLandedOnThing as a virtual?
Well, as forLud wrote:Please provide example(s) of how you plan on using this.
Code: Select all
mo->player->deltaviewheight = mo->Vel.Z / 8.;
And instead of just what I would plan on using this for, I am sure that maybe some will perhaps enjoy simply being able to change the delta view height as well.
I also wanted to just say as another example, this could also be convenient and especially good for simulating the camera shake from a few of the Build games (I of course, am thinking of DN3D in particular).
Last edited by nazakomu on Tue Jul 25, 2017 9:46 pm, edited 1 time in total.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: ZScript: Externalize PlayerLandedOnThing as a virtual?
I don't think there is currently a distinct event that can be virtualized for this... I'd just compare the player's last vel.z and current vel.z to see if there's been a sudden stop.
- Caligari87
- Admin
- Posts: 6174
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: ZScript: Externalize PlayerLandedOnThing as a virtual?
That's pretty much what I've been doing to model general deceleration damage. Store the old vel, compare it to the new vel, and if over a certain threshold apply the effect (can even scale the effect by the difference). The same could easily apply to camera effects (like the Doom 4 "hand on ground" for high falls)
- nazakomu
- Posts: 131
- Joined: Wed Nov 30, 2016 12:51 am
- Graphics Processor: nVidia with Vulkan support
Re: ZScript: Externalize PlayerLandedOnThing as a virtual?
I tried to do exactly just that, and I ended up running into many issues with it. The major issue was that I was trying to use an if statement to call A_Print as a test when the player jumped (using the BT_JUMP check) as well as velocity checks right under that statement and the function still managed to be called successfully without me ever having to jump, and I am fairly sure that at least the delta view height can be externalized because it seems so simple.Vaecrius wrote:I'd just compare the player's last vel.z and current vel.z to see if there's been a sudden stop.
I talked with Gutawer and Lud about this on the Discord server as well and Gutawer said that it seemed feasible to have this externalized. And if anybody else saw my old feature request, I have been trying to figure this out for 2 months now and I have tried several things and still have never made progress.
- Major Cooke
- Posts: 8176
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript: Externalize PlayerLandedOnThing as a virtual?
Now I don't know if this has actually been discussed, assuming it has, but I'll repost it anyway for the sake of making sure it has:
bONMOBJ (an actor flag) is what you can check for, if for a thing. This is automatically updated every tic.
There's also player.onground which also encapsulates the bONMOBJ check in addition to on the actual ground.
bONMOBJ (an actor flag) is what you can check for, if for a thing. This is automatically updated every tic.
There's also player.onground which also encapsulates the bONMOBJ check in addition to on the actual ground.