ZScript: Externalize PlayerLandedOnThing as a virtual?

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: ZScript: Externalize PlayerLandedOnThing as a virtual?

Re: ZScript: Externalize PlayerLandedOnThing as a virtual?

by Major Cooke » Wed Jul 26, 2017 8:52 am

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.

Re: ZScript: Externalize PlayerLandedOnThing as a virtual?

by nazakomu » Tue Jul 25, 2017 9:46 pm

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.

Re: ZScript: Externalize PlayerLandedOnThing as a virtual?

by Caligari87 » Tue Jul 25, 2017 8:58 pm

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

Re: ZScript: Externalize PlayerLandedOnThing as a virtual?

by Matt » Tue Jul 25, 2017 7:32 pm

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.

Re: ZScript: Externalize PlayerLandedOnThing as a virtual?

by nazakomu » Mon Jul 24, 2017 5:06 am

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

Re: ZScript: Externalize PlayerLandedOnThing as a virtual?

by Accensus » Mon Jul 24, 2017 4:58 am

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.

ZScript: Externalize PlayerLandedOnThing as a virtual?

by nazakomu » Mon Jul 24, 2017 4:53 am

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

Top