New SurfaceParms

Locked
Landix
Posts: 123
Joined: Wed Feb 28, 2007 5:57 pm

New SurfaceParms

Post by Landix »

Huhu,

it is me again :)

I read about custom surface parms (wood snow etc.) without to
recompile q3map2

must i change the code in the q3engine to add this new parms?

Code: Select all

 We have to create a new *.txt file in the baseq3\scripts folder called custinfoparms.txt .now add the following to this file:

{     
}
{
wood 0x80000       // custom wood surface
}

Code: Select all

//CUSTOM SURFACEPARMS

textures/yourfolder/yourtexture
{
surfaceparm wood      // this is our new surfaceparm called "wood". 
{
map $lightmap
rgbGen identity
}
{
map textures/yourfolder/yourtexture.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
}
that is not enough, or?
I mean somewhere must come the sound from!? :))

Some hints!?
[img]http://www.q3geoball.quakeit.de/files/landix.jpg[/img]
Landix
Posts: 123
Joined: Wed Feb 28, 2007 5:57 pm

Re: New SurfaceParms

Post by Landix »

Add this?

Code: Select all

/*
================
PM_FootstepForSurface

Returns an event number apropriate for the groundsurface
================
*/
static int PM_FootstepForSurface( void ) {
	if ( pml.groundTrace.surfaceFlags & SURF_NOSTEPS ) {
		return 0;
	}
	if ( pml.groundTrace.surfaceFlags & SURF_METALSTEPS ) {
		return EV_FOOTSTEP_METAL;
	}
//newq3ball
	if ( pml.groundTrace.surfaceFlags & SURF_WOODSTEPS ) {
		return EV_FOOTSTEP_WOOD;
	}
//endnew
	return EV_FOOTSTEP;
}
[img]http://www.q3geoball.quakeit.de/files/landix.jpg[/img]
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: New SurfaceParms

Post by ^misantropia^ »

You'll still need to catch it client side and actually play the sound.
Landix
Posts: 123
Joined: Wed Feb 28, 2007 5:57 pm

Re: New SurfaceParms

Post by Landix »

All i have done yet is this:

in cg_event.c

Code: Select all

//newq3ball
	case EV_FOOTSTEP_WOOD:
		DEBUGNAME("EV_FOOTSTEP_WOOD");
		break;
//endnew
in bg_misc.c

Code: Select all

char *eventnames[] = {
	"EV_NONE",

	"EV_FOOTSTEP",
	"EV_FOOTSTEP_METAL",
//newq3ball	
"EV_FOOTSTEP_WOOD",
//endnew
	"EV_FOOTSPLASH",
	"EV_FOOTWADE",
	"EV_SWIM",
in /game/surfaceflags.h

Code: Select all

//newq3ball
#define	SURF_WOODSTEPS			0x50000	// woodsteps
//endnew
in this files : qcommon/surfaceflags.h

Code: Select all

//newq3ball
#define	SURF_WOODSTEPS			0x50000	// woodsteps
//endnew
in renderer/tr_shader.c

Code: Select all

//newwq3ball
	{"woodsteps",	0,	SURF_WOODSTEPS,0 },
//endnew
and in my first post: bg_pmove.c

Code: Select all

//newq3ball
   if ( pml.groundTrace.surfaceFlags & SURF_WOODSTEPS ) {
      return EV_FOOTSTEP_WOOD;
   }
//endnew
so what to do yet?
i must compile the map with this and play the sound when player on this surface!?
[img]http://www.q3geoball.quakeit.de/files/landix.jpg[/img]
Landix
Posts: 123
Joined: Wed Feb 28, 2007 5:57 pm

Re: New SurfaceParms

Post by Landix »

Super!

My EX-coder "canabis"
have remove all....

Code: Select all

		Com_sprintf (name, sizeof(name), "sound/player/footsteps/clank%i.wav", i+1);
		cgs.media.footsteps[FOOTSTEP_METAL][i] = trap_S_RegisterSound (name, qfalse);
He not response all my calls for weeks....... Great! :(
when i re put them in a lot of errors go through the output.

god damn i am very unhappy now! >:(
[img]http://www.q3geoball.quakeit.de/files/landix.jpg[/img]
Locked