Raised This Month: $51 Target: $400
 12% 

LongJump Enabler


Post New Thread Reply   
 
Thread Tools Display Modes
lega
BANNED
Join Date: Feb 2010
Location: Osijek
Old 03-13-2010 , 10:31   Re: LongJump Enabler
Reply With Quote #21

thx for clearing that up
lega is offline
Send a message via MSN to lega Send a message via Skype™ to lega
Lt.RAT
Member
Join Date: Sep 2008
Location: Russia Yekaterinburg
Old 03-14-2010 , 17:37   Re: LongJump Enabler
Reply With Quote #22

Quote:
Originally Posted by xPaw View Post
800 i suppose is pev_gravity * sv_gravity ? Then i think it would be more correct to change calcs for different gravity values O.o
Wrong

At jump off, engine always use constant gravity without any pev_gravity modifers... It`s easily proof with setting sv_gravity to 0, so if sqrt(2 * 0 * 56.0) = 0 - we never jump with such method... And it`s not true.

Default value must be constant from sqrt(2 * 800 * 56.0).

Next frame velocity[2] we can calculate as: next_vel[2] = velocity[2]-pev_gravity*sv_gravity*UC_msec*0.001. But jump_off velocity without modifers...
Also anyone tested it to proper engine emulation (correct jump height - 56 by default)?
Lt.RAT is offline
Send a message via ICQ to Lt.RAT
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 03-16-2010 , 22:00   Re: LongJump Enabler
Reply With Quote #23

Conner I think you need an IN_FORWARD check. if I remember right you should not be able longjump when going backward, etc...
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-17-2010 , 01:33   Re: LongJump Enabler
Reply With Quote #24

I think you are able, but that whatever the direction you go, the longjump makes you go forward, may be it's not logic, but it's coded like that :/
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 03-17-2010 , 14:08   Re: LongJump Enabler
Reply With Quote #25

Quote:
Originally Posted by ConnorMcLeod View Post
but it's coded like that :/
even so I still believe it wasn't possible to longjump without IN_FORWARD... meaning if you are moving backward you can't longjump, if your momentum was moving forward without holding IN_FORWARD you can't longjump. Not talking about the direction of the jump itself, that I know goes forward and does so correctly here.

I know you realize what I meant in the first post, just clarifying for others.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-17-2010 , 15:38   Re: LongJump Enabler
Reply With Quote #26

Just have a look by yourself to PM_Jump :

There is just a check on duck + jump and min velocity.

Code:
void PM_Jump (void)
{
[...]
// See if user can super long jump?
	cansuperjump = atoi( pmove->PM_Info_ValueForKey( pmove->physinfo, "slj" ) ) == 1 ? true : false;

	// Acclerate upward
	// If we are ducking...
	if ( ( pmove->bInDuck ) || ( pmove->flags & FL_DUCKING ) )
	{
		// Adjust for super long jump module
		// UNDONE -- note this should be based on forward angles, not current velocity.
		if ( cansuperjump &&
			( pmove->cmd.buttons & IN_DUCK ) &&
			( pmove->flDuckTime > 0 ) &&
			Length( pmove->velocity ) > 50 )
		{
			pmove->punchangle[0] = -5;

			for (i =0; i < 2; i++)
			{
				pmove->velocity[i] = pmove->forward[i] * PLAYER_LONGJUMP_SPEED * 1.6;
			}
		
			pmove->velocity[2] = sqrt(2 * 800 * 56.0);
		}
		else
		{
			pmove->velocity[2] = sqrt(2 * 800 * 45.0);
		}
	}
	else
	{
		pmove->velocity[2] = sqrt(2 * 800 * 45.0);
	}

	// Decay it for simulation
	PM_FixupGravityVelocity();

	// Flag that we jumped.
	pmove->oldbuttons |= IN_JUMP;	// don't jump again until released
}
Full Code :

Code:
void PM_Jump (void)
{
	int i;
	qboolean tfc = false;

	qboolean cansuperjump = false;

	if (pmove->dead)
	{
		pmove->oldbuttons |= IN_JUMP ;	// don't jump again until released
		return;
	}

	tfc = atoi( pmove->PM_Info_ValueForKey( pmove->physinfo, "tfc" ) ) == 1 ? true : false;

	// Spy that's feigning death cannot jump
	if ( tfc && 
		( pmove->deadflag == ( DEAD_DISCARDBODY + 1 ) ) )
	{
		return;
	}

	// See if we are waterjumping.  If so, decrement count and return.
	if ( pmove->waterjumptime )
	{
		pmove->waterjumptime -= pmove->cmd.msec;
		if (pmove->waterjumptime < 0)
		{
			pmove->waterjumptime = 0;
		}
		return;
	}

	// If we are in the water most of the way...
	if (pmove->waterlevel >= 2)
	{	// swimming, not jumping
		pmove->onground = -1;

		if (pmove->watertype == CONTENTS_WATER)    // We move up a certain amount
			pmove->velocity[2] = 100;
		else if (pmove->watertype == CONTENTS_SLIME)
			pmove->velocity[2] = 80;
		else  // LAVA
			pmove->velocity[2] = 50;

		// play swiming sound
		if ( pmove->flSwimTime <= 0 )
		{
			// Don't play sound again for 1 second
			pmove->flSwimTime = 1000;
			switch ( pmove->RandomLong( 0, 3 ) )
			{ 
			case 0:
				pmove->PM_PlaySound( CHAN_BODY, "player/pl_wade1.wav", 1, ATTN_NORM, 0, PITCH_NORM );
				break;
			case 1:
				pmove->PM_PlaySound( CHAN_BODY, "player/pl_wade2.wav", 1, ATTN_NORM, 0, PITCH_NORM );
				break;
			case 2:
				pmove->PM_PlaySound( CHAN_BODY, "player/pl_wade3.wav", 1, ATTN_NORM, 0, PITCH_NORM );
				break;
			case 3:
				pmove->PM_PlaySound( CHAN_BODY, "player/pl_wade4.wav", 1, ATTN_NORM, 0, PITCH_NORM );
				break;
			}
		}

		return;
	}

	// No more effect
 	if ( pmove->onground == -1 )
	{
		// Flag that we jumped.
		// HACK HACK HACK
		// Remove this when the game .dll no longer does physics code!!!!
		pmove->oldbuttons |= IN_JUMP;	// don't jump again until released
		return;		// in air, so no effect
	}

	if ( pmove->oldbuttons & IN_JUMP )
		return;		// don't pogo stick

	// In the air now.
    pmove->onground = -1;

	PM_PreventMegaBunnyJumping();

	if ( tfc )
	{
		pmove->PM_PlaySound( CHAN_BODY, "player/plyrjmp8.wav", 0.5, ATTN_NORM, 0, PITCH_NORM );
	}
	else
	{
		PM_PlayStepSound( PM_MapTextureTypeStepType( pmove->chtexturetype ), 1.0 );
	}

	// See if user can super long jump?
	cansuperjump = atoi( pmove->PM_Info_ValueForKey( pmove->physinfo, "slj" ) ) == 1 ? true : false;

	// Acclerate upward
	// If we are ducking...
	if ( ( pmove->bInDuck ) || ( pmove->flags & FL_DUCKING ) )
	{
		// Adjust for super long jump module
		// UNDONE -- note this should be based on forward angles, not current velocity.
		if ( cansuperjump &&
			( pmove->cmd.buttons & IN_DUCK ) &&
			( pmove->flDuckTime > 0 ) &&
			Length( pmove->velocity ) > 50 )
		{
			pmove->punchangle[0] = -5;

			for (i =0; i < 2; i++)
			{
				pmove->velocity[i] = pmove->forward[i] * PLAYER_LONGJUMP_SPEED * 1.6;
			}
		
			pmove->velocity[2] = sqrt(2 * 800 * 56.0);
		}
		else
		{
			pmove->velocity[2] = sqrt(2 * 800 * 45.0);
		}
	}
	else
	{
		pmove->velocity[2] = sqrt(2 * 800 * 45.0);
	}

	// Decay it for simulation
	PM_FixupGravityVelocity();

	// Flag that we jumped.
	pmove->oldbuttons |= IN_JUMP;	// don't jump again until released
}
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
creeperdank
Senior Member
Join Date: Dec 2004
Location: IL
Old 03-22-2010 , 23:10   Re: LongJump Enabler
Reply With Quote #27

So witch one do i dl?
The first or the second post?
__________________
creeperdank is offline
Send a message via MSN to creeperdank
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-23-2010 , 03:57   Re: LongJump Enabler
Reply With Quote #28

The second uses Orpheu, it's a more efficient version.
__________________
Arkshine is offline
creeperdank
Senior Member
Join Date: Dec 2004
Location: IL
Old 03-25-2010 , 09:52   Re: LongJump Enabler
Reply With Quote #29

Off topic but what is Orpheu?
I haven't used amxx in a while.
__________________
creeperdank is offline
Send a message via MSN to creeperdank
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-25-2010 , 10:22   Re: LongJump Enabler
Reply With Quote #30

It's a new and extremely powerful module for Amxx. Follow the link in my post and read.
__________________
Arkshine is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode