Author Topic: Change Jump Height and Player height?  (Read 4710 times)

bludshot

  • Posts: 3
  • Turrets: +0/-0
Change Jump Height and Player height?
« on: April 28, 2010, 09:29:37 pm »
I'm working on an open source q3 mod, not tremulous, but there's not a lot of places on the web to talk about making mods in idtech3 anymore, so I hope you guys don't mind me posting this here.

I'm trying to figure out how to do two things which probably(?) would be achieved the same way in Tremulous as in Q3.

I want to make the player taller than he is now (such that he would be too tall to fit through a short door or opening) and I want to make the player able to jump higher.

I saw tremulous's "jumpMagnitude", which looks like a modifier that you guys built so that various classes will have different jumping capabilities. But I couldn't decipher really how you were doing it or how to apply it to what I'm trying to do. I don't need a jump capability modifier because my mod doesn't have classes. I just want to make all of my players jump higher than they do now.

bludshot

  • Posts: 3
  • Turrets: +0/-0
Re: Change Jump Height and Player height?
« Reply #1 on: April 28, 2010, 11:39:22 pm »
I have figured out the player height issue, my solution is here: http://www.quake3world.com/forum/viewtopic.php?f=16&t=43500

Still don't know how to change the jump height yet though...

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: Change Jump Height and Player height?
« Reply #2 on: April 28, 2010, 11:47:29 pm »
this particular part of the code has diverged so far from quake3 that this really isn't the place to ask.
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

bludshot

  • Posts: 3
  • Turrets: +0/-0
Re: Change Jump Height and Player height?
« Reply #3 on: April 29, 2010, 04:18:33 am »
Actually, not exactly (from what I just figured out):

In Tremulous's bg_pmove.c in the function PM_CheckJump is has:

  VectorMA( pm->ps->velocity, BG_Class( pm->ps->stats[ STAT_CLASS ] )->jumpMagnitude,
            normal, pm->ps->velocity );

Which, knowing what jumpMagnitude was for from where it gets set at different values for each class, it's obviously the value of how high the player can jump. So then in the vanilla q3 code I was able to go to bg_pmove.c in the function PM_CheckJump and find the line:

  VectorMA( pm->ps->velocity, 300.0f, normal, pm->ps->velocity );

Which thanks to the Tremulous code I was able to understand what that 300 is for, it's for the jump height (or magnitude). So I just changed that to 364.0f (a number I had to discover through trial and error and a test map where I created a box that was exactly the height I needed the player to be able to jump up onto). [And actually I defined a new constant in bg_local.h called JUMP_VELOCITY and I refer to it in PM_CheckJump instead of using that ugly hardcoded number]


Just posting my solution because it's always good to post your solution to forum questions rather than just say "nevermind I got it", that way if anyone googles it some day the solution will be here :)

Actually I should mention, the code already had some stuff from Tremulous in it (one of the other coders on the team had put it in there)
« Last Edit: April 29, 2010, 04:28:07 am by bludshot »