Raised This Month: $100 Target: $400
 25% 

LongJump Sound


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Half-Life        Category:   Technical/Development        Approver:   ConnorMcLeod (74)
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 07-23-2011 , 12:52   LongJump Sound
Reply With Quote #1



Plugin make 'Sound' when player doing longjump, like in Opposing Force

If you have Opposing Force, just copy pow_big_jump.wav from gearbox/sound/ctf to valve/sound/misc
If not, download and copy that wav to valve/sound/misc
Attached Files
File Type: sma Get Plugin or Get Source (lj_sound.sma - 1647 views - 628 Bytes)
File Type: zip pow_big_jump.zip (10.7 KB, 945 views)
__________________
The functional way is the right way

Last edited by GordonFreeman (RU); 06-09-2013 at 09:54. Reason: update
GordonFreeman (RU) is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-23-2011 , 13:23   Re: LongJump Sound
Reply With Quote #2

Check if entity is on ground. Should fix the problem.
__________________
Accepting paid work for clans and communities. !Plugins & Models!
Don't hesitate to contact me.
bibu is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 07-23-2011 , 18:27   Re: LongJump Sound
Reply With Quote #3

a longjump plugin, and from Gordon Freeman himself. that's awesome !!

but, just a question, should it work in counter-strike ? cause there is a longjump module in some maps, and in CSDM too.

regards.
__________________

Last edited by ANTICHRISTUS; 07-23-2011 at 18:37.
ANTICHRISTUS is offline
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 07-24-2011 , 12:09   Re: LongJump Sound
Reply With Quote #4

Quote:
Originally Posted by bibu View Post
Check if entity is on ground. Should fix the problem.
I don't know how make check of ES_OnGround

Bug fixed, finnaly
I used player's model's frame. And it work!
Fakemeta has very interesting functions.

PS: Play with p_longjump.amxx plugin ;)

Quote:
Originally Posted by ANTICHRISTUS
should it work in counter-strike ?
It will be work if you replace 9 to 7 in code. (seq==7&&frame==0)
LongJump sequence in HL is 9, in CS is 7
__________________
The functional way is the right way
GordonFreeman (RU) is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-24-2011 , 12:21   Re: LongJump Sound
Reply With Quote #5

Quote:
Originally Posted by GordonFreeman (RU) View Post
It will be work if you replace 9 to 7 in code. (seq==7&&frame==0)
LongJump sequence in HL is 9, in CS is 7
Check the game and do it.
__________________
Accepting paid work for clans and communities. !Plugins & Models!
Don't hesitate to contact me.
bibu is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 07-24-2011 , 19:41   Re: LongJump Sound
Reply With Quote #6

Quote:
Originally Posted by GordonFreeman (RU)
It will be work if you replace 9 to 7 in code. (seq==7&&frame==0)
LongJump sequence in HL is 9, in CS is 7
tested in CSDM 2.1.2k, the sound isn't working
__________________
ANTICHRISTUS is offline
KORD_12.7
Senior Member
Join Date: Aug 2009
Location: Russia, Vladivostok
Old 07-24-2011 , 20:22   Re: LongJump Sound
Reply With Quote #7

GordonFreeman (RU), GJ.

Can you make a plugin to remove longjump sound from Opposing Force?
__________________

Vi Veri Veniversum Vivus Vici
Russian Half-Life and Adrenaline Gamer community
KORD_12.7 is offline
Send a message via ICQ to KORD_12.7
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-26-2011 , 01:49   Re: LongJump Sound
Reply With Quote #8

I think that proper way is to hook Ham_Player_Jump as post and there check if m_IdealActivity (or m_Activity) is equal to ACT_LEAP and frame (or gaitsequence) is equal to 0.

From HLSDK :
Code:
void CBasePlayer::Jump()
{
	Vector		vecWallCheckDir;// direction we're tracing a line to find a wall when walljumping
	Vector		vecAdjustedVelocity;
	Vector		vecSpot;
	TraceResult	tr;
	
	if (FBitSet(pev->flags, FL_WATERJUMP))
		return;
	
	if (pev->waterlevel >= 2)
	{
		return;
	}

	// jump velocity is sqrt( height * gravity * 2)

	// If this isn't the first frame pressing the jump button, break out.
	if ( !FBitSet( m_afButtonPressed, IN_JUMP ) )
		return;         // don't pogo stick

	if ( !(pev->flags & FL_ONGROUND) || !pev->groundentity )
	{
		return;
	}

// many features in this function use v_forward, so makevectors now.
	UTIL_MakeVectors (pev->angles);

	// ClearBits(pev->flags, FL_ONGROUND);		// don't stairwalk
	
	SetAnimation( PLAYER_JUMP );

	if ( m_fLongJump &&
		(pev->button & IN_DUCK) &&
		( pev->flDuckTime > 0 ) &&
		pev->velocity.Length() > 50 )
	{
		SetAnimation( PLAYER_SUPERJUMP );
	}

	// If you're standing on a conveyor, add it's velocity to yours (for momentum)
	entvars_t *pevGround = VARS(pev->groundentity);
	if ( pevGround && (pevGround->flags & FL_CONVEYOR) )
	{
		pev->velocity = pev->velocity + pev->basevelocity;
	}
}
Code:
// Set the activity based on an event or current state
void CBasePlayer::SetAnimation( PLAYER_ANIM playerAnim )
{
	/* [ ... ] */

	switch (m_IdealActivity)
	{
	case ACT_HOVER:
	case ACT_LEAP:
	case ACT_SWIM:
	case ACT_HOP:
	case ACT_DIESIMPLE:
	default:
		if ( m_Activity == m_IdealActivity)
			return;
		m_Activity = m_IdealActivity;

		animDesired = LookupActivity( m_Activity );
		// Already using the desired animation?
		if (pev->sequence == animDesired)
			return;

		pev->gaitsequence = 0;
		pev->sequence		= animDesired;
		pev->frame			= 0;
		ResetSequenceInfo( );
		return;

So in Jump hook post, you come right after SetAnimation( PLAYER_SUPERJUMP ).
__________________
- tired and retired -
ConnorMcLeod is offline
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 07-30-2011 , 02:50   Re: LongJump Sound
Reply With Quote #9

Done.
Thanks for KORD for offsets
__________________
The functional way is the right way
GordonFreeman (RU) is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-30-2011 , 05:55   Re: LongJump Sound
Reply With Quote #10

Quote:
Originally Posted by GordonFreeman (RU) View Post
Done.
Thanks for KORD for offsets
You forgot to POST hook Ham_Player_Jump.
Also, you don't need to create act and frame vars because you only use their value once.
You should name offset and sequence for readability (const or define).

So, works the way i suggested ?
__________________
- tired and retired -
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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 00:35.


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