DLight?

New Member
Joined
Jan 13, 2002
Messages
9
Best answers
0
Hey, i am woundering how did the coders of ESF made some attacks light up the area around it....

i checked in the DMC code, for quad damage or whatever to check how did it light up the area and i asked some people
they said they believe the rocket RPG and the DMC Quad damage thing used Dlights....

do you guys use it, and how would i use it my self...
like where in the SDK do they show you how did they use Dlight or whatever to light up the area....

i already checked in the CRPGRocket members and some stuff in the DMC client code( i found this gEngfuncs.pEfxAPI->CL_AllocDlight) .......

thanks
Dos
 
New Member
Joined
Nov 24, 2001
Messages
692
Best answers
0
pev->effects |= EF_BRIGHTLIGHT;

there are some more fx for this, just search the code :)
 
New Member
Joined
Jan 13, 2002
Messages
9
Best answers
0
Originally posted by harSens
pev->effects |= EF_BRIGHTLIGHT;

there are some more fx for this, just search the code :)
harSen, have you ever played DMC?

harSen do you know when you pick up a rune you light up the area around you with a nice aura, not the shell around the player but the light and it can have colours, do you have a clue how is this done?
 
New Member
Joined
Nov 24, 2001
Messages
692
Best answers
0
Well, no, i never played DMC. If you want to make a dlight use the DLIGHT temp entity serverside, or as you said, the gEngfuncs.pEfxAPI->CL_AllocDlight() clientside. Just check the code, i'm sure there is an example about how to use them.
 
New Member
Joined
Jan 13, 2002
Messages
9
Best answers
0
Super thanks......

Code:
	dlight_t *dl = gEngfuncs.pEfxAPI->CL_AllocDlight ( 0 );

	cl_entity_t *player = gEngfuncs.GetEntityByIndex( ent->clientIndex );
	
	if ( !player )
		return;

	VectorCopy ( player->origin, dl->origin ); // this here does some magic stuff by copying the origin of the player and make the dlight to be that origin

	dl->radius = 250;  // the dmc glow stuff... this here makes the player light up
	dl->dark = true;
	dl->die = gEngfuncs.GetClientTime() + 0.001; //Kill it right away

	if ( ent->entity.baseline.iuser2 == 1 ) // check if you are in a team
	{
		if ( ent->entity.baseline.iuser1 == 1 ) // power up type
		{
			dl->color.r = 255;
			dl->color.g = 128;
			dl->color.b = 128;
		}
		else if( ent->entity.baseline.iuser1 == 2 )
		{
			dl->color.r = 0;
			dl->color.g = 75;
			dl->color.b = 255;
		}
		else
		{
			dl->radius = 800;
			dl->color.r = 255;
			dl->color.g = 255;
			dl->color.b = 255;
		}

	}
	else if ( ent->entity.baseline.iuser2 == 2 )
	{
		if ( ent->entity.baseline.iuser1 == 1 )
		{
			dl->color.r = 255;
			dl->color.g = 128;
			dl->color.b = 0;
		}
		else if ( ent->entity.baseline.iuser1 == 2 )
		{
			dl->color.r = 0;
			dl->color.g = 128;
			dl->color.b = 250;
		}
		else 
		{
			dl->color.r = 255;
			dl->color.g = 75;
			dl->color.b = 0;
		}
	}
	else if ( ent->entity.baseline.iuser2 == 3 )
	{
		dl->color.r = 255;
		dl->color.g = 125;
		dl->color.b = 255;
	}
 

Users who are viewing this thread

Top Bottom