ZScript: Externalize PlayerLandedOnThing as a virtual?

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
nazakomu
Posts: 131
Joined: Wed Nov 30, 2016 12:51 am
Graphics Processor: nVidia with Vulkan support

ZScript: Externalize PlayerLandedOnThing as a virtual?

Post by nazakomu »

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
Accensus
Posts: 2380
Joined: Thu Feb 11, 2016 9:59 am

Re: ZScript: Externalize PlayerLandedOnThing as a virtual?

Post by Accensus »

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.
User avatar
nazakomu
Posts: 131
Joined: Wed Nov 30, 2016 12:51 am
Graphics Processor: nVidia with Vulkan support

Re: ZScript: Externalize PlayerLandedOnThing as a virtual?

Post by nazakomu »

Lud wrote:Please provide example(s) of how you plan on using this.
Well, as for

Code: Select all

mo->player->deltaviewheight = mo->Vel.Z / 8.;
I would love to perform camera handling for when the player lands and the externalization of PlayerLandedOnThing would certainly make these matters entirely easy for everybody who wants to ever work on the movement of the player or the camera upon landing. My former request did mention landing being externalized, but that received a decline. But this perfectly describes what I (or others maybe?) am looking for and accurately displays what is in the code that could potentially be externalized to ZScript.

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.
User avatar
Matt
Posts: 9685
Joined: Sun Jan 04, 2004 5:37 pm
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: ZScript: Externalize PlayerLandedOnThing as a virtual?

Post by Matt »

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.
User avatar
Caligari87
User Accounts Assistant
Posts: 6000
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: ZScript: Externalize PlayerLandedOnThing as a virtual?

Post by Caligari87 »

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)

8-)
User avatar
nazakomu
Posts: 131
Joined: Wed Nov 30, 2016 12:51 am
Graphics Processor: nVidia with Vulkan support

Re: ZScript: Externalize PlayerLandedOnThing as a virtual?

Post by nazakomu »

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 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.

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.
User avatar
Major Cooke
Posts: 8109
Joined: Sun Jan 28, 2007 3:55 pm

Re: ZScript: Externalize PlayerLandedOnThing as a virtual?

Post by Major Cooke »

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.

Return to “Feature Suggestions [GZDoom]”