Prop Footsteps: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(14 intermediate revisions by 12 users not shown)
Line 1: Line 1:
[http://mercedesbenzhead.injelly.info/ mercedes benz head light] [http://2007nissanaltima.desdee.info/ 2007 nissan altima] [http://pennsylvaniastate.footle.info/ pennsylvania state elections] [http://ancientgreece.shippon.info/ ancient greece map island] [http://sweetdreamare.sinkhead.info/ sweet dream are made of this lyrics] [http://reasoningabout.coolish.info/ reasoning about numbers] [http://alumforsale.desdee.info/ alum for sale] [http://pornos.desdee.info/ pornos] [http://animalringtones.sinkhead.info/ animal ringtones] [http://swingerparty.betrunk.info/ swinger party] [http://airportglasgow.whacks.info/ airport glasgow inn travel] [http://fallweddingflowers.footle.info/ fall wedding flowers] [http://securitysystems.footle.info/ security systems] [http://moopoint.desdee.info/ moo point] [http://whendoes.injelly.info/ when does] [http://creativewedding.footle.info/ creative wedding invitation] [http://ferrari.footle.info/ ferrari] [http://businesssoftware.coolish.info/ business software] [http://postpartumhealth.sinkhead.info/ postpartum health] [http://startabusiness.skunkish.info/ start a business] [http://artinstitute.footle.info/ art institute of chicago fashion show] [http://freeringtone.stratose.info/ free ringtone downloads for sprint] [http://u2downloadable.desdee.info/ u2 downloadable music] [http://wordproblems.sinkhead.info/ word problems] [http://buyingvicodin.desdee.info/ buying vicodin online] [http://murphybedwith.stratose.info/ murphy bed with book case] [http://vipdiscountauto.whacks.info/ vip discount auto] [http://automotivecompany.shippon.info/ automotive company finance household] [http://episodesguides.whacks.info/ episodes guides] [http://smokingfactsand.betrunk.info/ smoking facts and statistics] [http://asianxxx.footle.info/ asian xxx] [http://marrieddatingsites.coolish.info/ married dating sites] [http://neilyounghuman.sinkhead.info/ neil young human highway] [http://ferraricar.footle.info/ ferrari car] [http://firestonetires.betrunk.info/ firestone tires] [http://plussizesummerclothes.shippon.info/ plus size summer clothes] [http://jobsforportuguese.coolish.info/ jobs for portuguese speakers] [http://iraqcountrystudy.whacks.info/ iraq country study] [http://privateinsignia.injelly.info/ private insignia] [http://vegas.injelly.info/ vegas] [http://mechanicstruck.shippon.info/ mechanics truck bodies] [http://robiewilliams.shippon.info/ robie williams angel lyric] [http://sinkhead.info/index3_666.html homepage] [http://phonenumber.shippon.info/ phone number] [http://cricketringtones.desdee.info/ cricket ringtones] [http://healthydiet.betrunk.info/ healthy diet] [http://researchingstocks.stratose.info/ researching stocks] [http://1999corollareview.desdee.info/ 1999 corolla review] [http://logomobilesonnerie.footle.info/ logo mobile sonnerie] [http://acnehomeremedies.whacks.info/ acne home remedies] [http://nudeassvideo.whacks.info/ nude ass video] [http://whichbroadband.whacks.info/ which broadband] [http://electricblankets.desdee.info/ electric blankets] [http://realsexpic.skunkish.info/ real sex pic] [http://tiponcleaning.skunkish.info/ tip on cleaning the face] [http://ussrpropaganda.skunkish.info/ ussr propaganda] [http://ladynightnude.shippon.info/ lady night nude] [http://steampoweredairplane.betrunk.info/ steam powered airplane] [http://openstock.sinkhead.info/ open stock] [http://18wheelerjobs.injelly.info/ 18 wheeler jobs] [http://orderphentermine.stratose.info/ order phentermine] [http://islamicaccounting.sinkhead.info/ islamic accounting standard] [http://mathlessonfor.shippon.info/ math lesson for kids] [http://replicacoach.footle.info/ replica coach handbag] [http://exoticmensdress.shippon.info/ exotic mens dress shoes] [http://customcarpartand.skunkish.info/ custom car part and accessory] [http://autoshutdownxp.shippon.info/ auto shutdown xp professional] [http://pledgeofalliegence.injelly.info/ pledge of alliegence] [http://multifunctionperipherals.whacks.info/ multifunction peripherals] [http://naturalwoman.sinkhead.info/ natural woman] [http://ringtonesfor.injelly.info/ ringtones for us cellular] [http://electricheater.injelly.info/ electric heater wall] [http://viscositytemperature.desdee.info/ viscosity temperature chart] [http://sereno.betrunk.info/ sereno] [http://albumthriller.sinkhead.info/ album thriller] [http://vanderveen.betrunk.info/ vander veen] [http://basketballshoes.whacks.info/ basketball shoes] [http://sex-shemale.shippon.info/ sex-shemale] [http://andersenproducts.footle.info/ andersen products inc] [http://caraudio.sinkhead.info/ car audio] [http://automobileshop.shippon.info/ automobile shop manual] [http://listofmortgagebrokers.whacks.info/ list of mortgage brokers in arizona] [http://betrunk.info/index5_250.html page] [http://metricenglish.coolish.info/ metric english conversion tables] [http://informationon.stratose.info/ information on sponge] [http://electronicthesis.desdee.info/ electronic thesis submission] [http://adultcostume.coolish.info/ adult costume] [http://thistleedinburgh.coolish.info/ thistle edinburgh] [http://buttseymore.coolish.info/ butt seymore] [http://orchidshowcalifornia.shippon.info/ orchid show california] [http://shirttvintage.footle.info/ shirt t vintage wholesale] [http://realringtones.sinkhead.info/ real ringtones] [http://thescienceof.shippon.info/ the science of mind and behavior] [http://excelsiorcollege.whacks.info/ excelsior college] [http://celiacdisease.skunkish.info/ celiac disease] [http://onlinetramadol.desdee.info/ online tramadol] [http://federalprisons.skunkish.info/ federal prisons] [http://americaemaillist.betrunk.info/ america email list stockholder] [http://tattooyourolling.injelly.info/ tattoo you rolling stones] [http://joinadultfriend.shippon.info/ join adult friend finder]
{{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.}}
 
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.
{{note|This will not make any difference if <code>PlayStepSound</code> is overridden by the player entity (i.e. HL2MP).}}
{{note|This will not make any difference if <code>PlayStepSound</code> is overridden by the player entity (i.e. HL2MP).}}
Line 8: 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 18: 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 30: 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 39: 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 48: 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 69: 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 79: 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