Prop Footsteps: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Untabbed)
Line 3: Line 3:
==Basic Fix==
==Basic Fix==
===src\cl_dll\c_baseplayer.cpp===
===src\cl_dll\c_baseplayer.cpp===
<dl><dd>
====Shift Start Up====
====Shift Start Up====
{|style="background:transparent;"
{|style="background:transparent;"
Line 21: Line 20:
|<pre style="margin:0px 0px 0px 0px;"> UTIL_TraceRay( ray, MASK_PLAYERSOLID, this, COLLISION_GROUP_PLAYER_MOVEMENT, &trace );</pre>
|<pre style="margin:0px 0px 0px 0px;"> UTIL_TraceRay( ray, MASK_PLAYERSOLID, this, COLLISION_GROUP_PLAYER_MOVEMENT, &trace );</pre>
|}
|}
</dd></dl>
===src\game_shared\gamemovement.cpp===
===src\game_shared\gamemovement.cpp===
<dl><dd>
====Shift Start Up====
====Shift Start Up====
{|style="background:transparent;"
{|style="background:transparent;"
Line 44: Line 40:
</pre>
</pre>
|}
|}
</dd></dl>
[[Category:Programming]]
==HL2MP Override Removal==
==HL2MP Override Removal==
<dl><dd>
===src\cl_dll\hl2mp\c_hl2mp_player.h===
===src\cl_dll\hl2mp\c_hl2mp_player.h===
====Prototype Removal====
====Prototype Removal====
Line 65: Line 58:
* PlayStepSound
* PlayStepSound
* PrecacheFootStepSounds
* PrecacheFootStepSounds
</dd></dl>
[[Category:Programming]]

Revision as of 22:36, 30 March 2006

For player footsteps, Valve used MASK_PLAYERSOLID_BRUSHONLY rather than MASK_PLAYERSOLID. This difference made it so only the static world would have dynamic footsteps. The following precedure will show how to fix this issue.

Note.pngNote:This will not make any difference if PlayStepSound is overridden by the player entity (i.e. HL2MP).

Basic Fix

src\cl_dll\c_baseplayer.cpp

Shift Start Up

	// Straight down
	end.z -= 64;
	// Straight down
	start.z += 1;
	end.z -= 64;

Change Trace Mask

	UTIL_TraceRay( ray, MASK_PLAYERSOLID_BRUSHONLY, this, COLLISION_GROUP_PLAYER_MOVEMENT, &trace );
	UTIL_TraceRay( ray, MASK_PLAYERSOLID, this, COLLISION_GROUP_PLAYER_MOVEMENT, &trace );

src\game_shared\gamemovement.cpp

Shift Start Up

	// Straight down
	end[2] -= 64;
	// Straight down
	start[2] += 1;
	end[2] -= 64;

Change Trace Mask

	TracePlayerBBox( start, end, MASK_PLAYERSOLID_BRUSHONLY, COLLISION_GROUP_PLAYER_MOVEMENT, trace ); 
	TracePlayerBBox( start, end, MASK_PLAYERSOLID, COLLISION_GROUP_PLAYER_MOVEMENT, trace ); 

HL2MP Override Removal

src\cl_dll\hl2mp\c_hl2mp_player.h

Prototype Removal

  • PlayStepSound
  • PrecacheFootStepSounds

src\game_shared\hl2mp\hl2mp_player_shared.cpp

Symbol Removal

  • PlayStepSound
  • PrecacheFootStepSounds

src\dlls\hl2mp_dll\hl2mp_player.cpp

Precache

Remove

	PrecacheFootStepSounds();

From function CHL2MP_Player::Precache

src\dlls\hl2mp_dll\hl2mp_player.h

Prototype Removal

  • PlayStepSound
  • PrecacheFootStepSounds