Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Jaxxoon R

Increasing player jump height for one map?

Recommended Posts

Basically, I've been trying to make the player have 2-3 times the normal jump height for only a single map. I can mess with the gravity values in ZMAPINFO, but the results are undesirable since it also fiddles with everything else.
I was just wondering if there was a better way to do this, perhaps through inventory items and custom player classes? Or maybe by temporarily lowering the player actor's mass instead?

I'm not quite sure what the most effective way of doing this would be...

Share this post


Link to post

ACS.

Modify APROP_JumpZ. Personally I'd set it to be a multiplier of the actor's original, just in case varying jump heights are a factor in whatever mod's being made here, but you can also set it to a constant jump height if you really want to.

That said, AFAIK this change is permanent, so you'd need something to change it back later.

Share this post


Link to post

Argh... All I'm able to do is make the player not jump whatsoever. And yes, multiple classes with differing jump heights are planned.

script "JumpZ-Multiplier" ENTER
{
    Thing_ChangeTID(0,1337);
    GetActorProperty(1337, Jumpz);
    SetActorProperty(1337, APROP_JumpZ, jumpz*2);
}
All I've been trying to do is multiply the jump heights by two. LOL, I always knew my math skills were shit, but apparently my ACS skills are as well.

Share this post


Link to post

This should work:

script "JumpZ-Multiplier" ENTER
{
    Thing_ChangeTID(0,1337);
    int jumpz = GetActorProperty(1337, APROP_Jumpz);
    SetActorProperty(1337, APROP_JumpZ, jumpz*2);
}
I only did changes to the second line (see the parts in bold).

Share this post


Link to post

I may be wrong, but I don't think that multiplying the "jump factor" by 2 will make the player jump twice as high. There's some crazy logarithmic equation involved.

Share this post


Link to post

I think you're right. According to the wiki, the player's jump height in normal gravity is calculated like this: jumpz^2/2. With the default jumpz value of 8, the jump height is 32. If you double the jumpz value, the jump height would be 128 (i.e., 4 times the normal), not 64.

Unfortunately, I'm terrible at math, so I can't give a formula for that. But with some calculations, I figured that the factor you want to multiply by is 1.4145 (or close enough). If you go with that, the second line need to be edited into the following:

int jumpz = FixedMul(GetActorProperty(1337, APROP_Jumpz), 1.4145);

Share this post


Link to post

And then I couldn't reset it.
Oh no, if he goes back to the HUB...
Look, Spot, look. Look at Doomguy fly!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×