Prop Footsteps: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(11 intermediate revisions by 10 users not shown)
Line 1: Line 1:
[http://goldteeth.orbitar.cn/ gold teeth] [http://ftareceivers.clootie.cn/ fta receivers] [http://ipodsoftware.drover.cn/ ipod software] [http://pedicure.vulkanik.cn/ pedicure] [http://pogoclub.catchers.cn/ pogo club] [http://clootie.cn/index6_250.html index] [http://medicaltranscription.clootie.cn/ medical transcription] [http://sexclothing.catchers.cn/ sex clothing] [http://drover.cn/index0_250.html page] [http://bodybuilderporn.peyote.cn/ body builder porn] [http://sweetsixteenparty.peyote.cn/ sweet sixteen party favors] [http://marinegps.emptio.cn/ marine gps] [http://celebsmovies.mary-jane.cn/ celebs movies] [http://securityguards.catchers.cn/ security guards] [http://evoker.cn/index7_666.html homepage] [http://poliodisease.outstay.cn/ polio disease] [http://gaymuscle.orbitar.cn/ gaymuscle] [http://uggboots.drover.cn/ ugg boots] [http://willowlanebunkbeds.mary-jane.cn/ willow lane bunk beds] [http://clootie.cn/index3_666.html link] [http://outstay.cn/index8_666.html url] [http://apartments.emptio.cn/ apartments] [http://depakotesideeffects.outstay.cn/ depakote side effects] [http://downloadfree3gp.outstay.cn/ download free 3gp] [http://pontiacg6.outstay.cn/ pontiac g6] [http://catchers.cn/index6_250.html link] [http://postoffice.mary-jane.cn/ post office] [http://missourimanufactured.drover.cn/ missouri manufactured homes] [http://drover.cn/index5_666.html link] [http://freephotopersonal.vulkanik.cn/ free photo personal] [http://tractorsupply.catchers.cn/ tractor supply] [http://misleadinggraphs.mary-jane.cn/ misleading graphs] [http://sexygirlfriend.emptio.cn/ sexy girlfriend] [http://vulkanik.cn/index2_666.html page] [http://benztropine.drover.cn/ benztropine] [http://sapphicerotica.catchers.cn/ sapphic erotica videos] [http://dinnerdashdownload.evoker.cn/ dinner dash download] [http://emptio.cn/index0_1000.html link] [http://cardealerlos.emptio.cn/ car dealer los angeles] [http://healthinsurance.catchers.cn/ health insurance quotes] [http://burberryhandbag.emptio.cn/ burberry handbag] [http://westjetairline.catchers.cn/ westjet airline] [http://gaypersonals.evoker.cn/ gay personals] [http://freepornompegs.orbitar.cn/ free porno mpegs] [http://disneytoonsxxx.mary-jane.cn/ disney toons xxx] [http://videodesexo.evoker.cn/ video de sexo] [http://charcoal.outstay.cn/ charcoal] [http://blowjob.vulkanik.cn/ blowjob] [http://blackanddecker.evoker.cn/ black and decker parts] [http://bannedbooks.peyote.cn/ banned books] [http://smallbusiness.clootie.cn/ small business credit card] [http://kitchenislands.orbitar.cn/ kitchen islands] [http://enellbra.clootie.cn/ enell bra] [http://catchers.cn/index5_1000.html index] [http://outstay.cn/index1_666.html map] [http://carolinaardohain.vulkanik.cn/ carolina ardohain] [http://eroticstory.vulkanik.cn/ erotic story] [http://floridaflights.mary-jane.cn/ florida flights] [http://soccercleats.vulkanik.cn/ soccer cleats] [http://phoenixapartments.evoker.cn/ phoenix apartments] [http://wardrobemalfunctions.catchers.cn/ wardrobe malfunctions] [http://freesexstories.catchers.cn/ free sex stories] [http://accuchekdiabetic.clootie.cn/ accuchek diabetic supply] [http://americanexpress.catchers.cn/ american express black card] [http://candystand.mary-jane.cn/ candystand] [http://freeantivirus.clootie.cn/ free anti virus download] [http://ravelshoes.drover.cn/ ravel shoes] [http://metaldetector.drover.cn/ metal detector] [http://steppermotors.clootie.cn/ stepper motors] [http://carauctions.peyote.cn/ car auctions] [http://lovehina.vulkanik.cn/ love hina] [http://vulkanik.cn/index1_1000.html page] [http://pedicure.outstay.cn/ pedicure] [http://burberry.vulkanik.cn/ burberry] [http://winampdownload.evoker.cn/ winamp download free] [http://hennessycognac.drover.cn/ hennessy cognac] [http://adirondackchair.orbitar.cn/ adirondack chair] [http://evoker.cn/ evoker.cn] [http://peyote.cn/index7_250.html map] [http://ringtonemaker.emptio.cn/ ring tone maker] [http://vulkanik.cn/ vulkanik.cn] [http://babyshoes.peyote.cn/ baby shoes] [http://chocolatefountains.outstay.cn/ chocolate fountains] [http://lemonadediet.catchers.cn/ lemonade diet] [http://catchers.cn/index0_1000.html site] [http://meds.outstay.cn/ meds] [http://california.emptio.cn/ california] [http://emptio.cn/index2_250.html home] [http://sexualpictures.drover.cn/ sexual pictures] [http://turkcemusic.mary-jane.cn/ turkce music] [http://shelbymustang.vulkanik.cn/ shelby mustang gt 500] [http://childrenvideo.evoker.cn/ children video] [http://bedbath.vulkanik.cn/ bed bath] [http://analsexmovies.evoker.cn/ anal sex movies] [http://skagenwatches.drover.cn/ skagen watches] [http://antiquechristmas.emptio.cn/ antique christmas post card] [http://rvsalesmaryland.evoker.cn/ rv sales maryland] [http://lipovarin.evoker.cn/ lipovarin] [http://clootie.cn/ clootie.cn] [http://semitrucks.catchers.cn/ semi trucks]
{{important|This issue has been resolved in the Half-Life 2: Episode Two codebase; if you are using its code, you should not try to implement this mod.}}
{{note|This issue has been resolved in the Half-Life 2: Episode Two codebase; if you are using its code, you should not try to implement this mod.}}


For player footsteps, Valve used <code>[[MASK_PLAYERSOLID_BRUSHONLY]]</code> rather than <code>[[MASK_PLAYERSOLID]]</code>. This difference made it so only the static world would have dynamic footsteps. The following precedure will show how to fix this issue.
For player footsteps, Valve used <code>[[MASK_PLAYERSOLID_BRUSHONLY]]</code> rather than <code>[[MASK_PLAYERSOLID]]</code>. This difference made it so only the static world would have dynamic footsteps. The following precedure will show how to fix this issue.
Line 10: Line 9:
|<pre style="margin:0px 0px 0px 0px;"> // Straight down
|<pre style="margin:0px 0px 0px 0px;"> // Straight down
end.z -= 64;</pre>
end.z -= 64;</pre>
| &rarr;
|
|<pre style="margin:0px 0px 0px 0px;"> // Straight down
|<pre style="margin:0px 0px 0px 0px;"> // Straight down
start.z += 1;
start.z += 1;
Line 20: Line 19:
ray.Init( start, end, GetPlayerMins(), GetPlayerMaxs() );</pre>
ray.Init( start, end, GetPlayerMins(), GetPlayerMaxs() );</pre>
|-
|-
|style="text-align:center;"|&darr;
|style="text-align:center;"|
|-
|-
|<pre style="margin:0px 0px 0px 0px;"> Ray_t ray;
|<pre style="margin:0px 0px 0px 0px;"> Ray_t ray;
Line 32: Line 31:
|<pre style="margin:0px 0px 0px 0px;"> UTIL_TraceRay( ray, MASK_PLAYERSOLID_BRUSHONLY, this, COLLISION_GROUP_PLAYER_MOVEMENT, &trace );</pre>
|<pre style="margin:0px 0px 0px 0px;"> UTIL_TraceRay( ray, MASK_PLAYERSOLID_BRUSHONLY, this, COLLISION_GROUP_PLAYER_MOVEMENT, &trace );</pre>
|-
|-
|style="text-align:center;"|&darr;
|style="text-align:center;"|
|-
|-
|<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>
Line 41: Line 40:
|<pre style="margin:0px 0px 0px 0px;"> // Straight down
|<pre style="margin:0px 0px 0px 0px;"> // Straight down
end[2] -= 64;</pre>
end[2] -= 64;</pre>
| &rarr;
|
|<pre style="margin:0px 0px 0px 0px;"> // Straight down
|<pre style="margin:0px 0px 0px 0px;"> // Straight down
start[2] += 1;
start[2] += 1;
Line 50: Line 49:
|<pre style="margin:0px 0px 0px 0px;"> TracePlayerBBox( start, end, MASK_PLAYERSOLID_BRUSHONLY, COLLISION_GROUP_PLAYER_MOVEMENT, trace );</pre>
|<pre style="margin:0px 0px 0px 0px;"> TracePlayerBBox( start, end, MASK_PLAYERSOLID_BRUSHONLY, COLLISION_GROUP_PLAYER_MOVEMENT, trace );</pre>
|-
|-
|style="text-align:center;"|&darr;
|style="text-align:center;"|
|-
|-
|<pre style="margin:0px 0px 0px 0px;"> Ray_t ray;
|<pre style="margin:0px 0px 0px 0px;"> Ray_t ray;
Line 71: Line 70:
===src\dlls\hl2mp_dll\hl2mp_player.cpp===
===src\dlls\hl2mp_dll\hl2mp_player.cpp===
====Precache====
====Precache====
{|
{| class=standard-table
!colspan="2" style="text-align:center;"| In function <tt>CHL2MP_Player::Precache</tt>
!colspan="2" style="text-align:center;"| In function <tt>CHL2MP_Player::Precache</tt>
|-
|-
Line 81: Line 80:
* PlayStepSound
* PlayStepSound
* PrecacheFootStepSounds
* PrecacheFootStepSounds
[[Category:Programming]]
 
[[Category: Programming]]

Latest revision as of 20:15, 16 March 2025

Icon-Important.pngImportant:This issue has been resolved in the Half-Life 2: Episode Two codebase; if you are using its code, you should not try to implement this mod.

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 Trace Start Up

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

Smaller Trace Box Height

	Ray_t ray;
	ray.Init( start, end, GetPlayerMins(), GetPlayerMaxs() );
	Ray_t ray;
	Vector mins = GetPlayerMins();
	Vector maxs = GetPlayerMaxs();
	maxs.z = mins.z + 1;
	ray.Init( start, end, mins, maxs);

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 Trace Start Up

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

Smaller Trace Box Height & Change Trace Mask

	TracePlayerBBox( start, end, MASK_PLAYERSOLID_BRUSHONLY, COLLISION_GROUP_PLAYER_MOVEMENT, trace );
	Ray_t ray;
	Vector mins = player->GetPlayerMins();
	Vector maxs = player->GetPlayerMaxs();
	maxs.z = mins.z + 1;
	ray.Init( start, end, mins, maxs);
	UTIL_TraceRay( ray, MASK_PLAYERSOLID, player, 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

In function CHL2MP_Player::Precache
Remove
	PrecacheFootStepSounds();

src\dlls\hl2mp_dll\hl2mp_player.h

Prototype Removal

  • PlayStepSound
  • PrecacheFootStepSounds