View Single Post
Re: TRACE_TEXTURE weirdnesses
Old
  (#4)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: TRACE_TEXTURE weirdnesses - 06-05-2004

To check what sort of footstep sound belongs to a texture, call the PM_FindTextureType() function in the Game DLL interface. Any MOD code should feature this function. You feed it with the texture name char pointer, and it will return the character describing what type of material it is, according to what's specified in your materials.txt file.

Here's what I am doing:
Code:
		 // ask the engine for the texture name on pGroundEntity under the player's feet
		 texture_name = TRACE_TEXTURE (pGroundEntity, pPlayer->v_origin, Vector (0, 0, -9999));
		 // if the engine found the texture, ask the game DLL for the texture type
		 if (texture_name != NULL)
			texture_type = MDLL_PM_FindTextureType ((char *) texture_name); // ask for texture type
The MDLL_ prefix before PM_FindTextureType is metamod's syntax. If you don't use metamod, don't use the MDLL_ macros and directly call PM_FindTextureType.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote