View Full Version : DLight?
dosap
01-13-2002, 09:09 PM
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
harSens
01-14-2002, 04:22 PM
pev->effects |= EF_BRIGHTLIGHT;
there are some more fx for this, just search the code :)
dosap
01-14-2002, 07:03 PM
Thanks
dosap
01-15-2002, 02:18 AM
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?
harSens
01-15-2002, 07:06 AM
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.
dosap
01-15-2002, 09:57 PM
Super thanks......
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;
}
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.