Author: {wf}shadowspawn <shadowspawn_at_shadowspawn_dot_net>     Reply to Message
Date: 12/17/2003 7:13:04 PM
Subject: RE: the pb seems so... small

it's not broadcast; but the sound is phs and not pvs. the damage is pvs also.

if it goes off like say on the flag in cancer, you won't see it outside. i was thinking about broadcasting it, but that would also mean damage through walls since the shock is actually related to damage amounts; minimal damage, minimal bouncing around.

all that from one EV_PLASMAEXPLODE. I was thinking of making it team-specific but wasn't sure, also thinking about making it pass a parm for scale; frames.

its the emp shader as it was intended to look; using code that is in no form like missionpack stuff; i'm not even sure how TA did it to be honest; its 4 local entities (3 scaling at different rates, one poly for the explosion) and the original math for the q2 pb explosion that was taken out in 4.2 cause of broadcast overflows.

the shockview is run every frame anyway; when the event comes through it increases the client's 'shock time', so the more damage the more shock time, the bigger the difference in time the more violent the effects.

i was learning refdef's for my attempt at a skyportal.


lentity_t *CG_AllocExpandingPoly ( letype_t type, const vec3_t origin, const vec3_t angles, int frames, float scale,
float light, float lr, float lg, float lb, struct model_s *model, struct shader_s *shader );

void CG_PBExplosion ( vec3_t start )
{
int i;
vec3_t Vec[8];
int x=128;
int y;
lentity_t *le,*le2,*le3;

for (y=1; y<3; y++)
{

VectorSet(Vec[0],x/y,x/y,0);
VectorSet(Vec[1],x/y,-x/y,0);
VectorSet(Vec[2],-x/y,-x/y,0);
VectorSet(Vec[3],-x/y,x/y,0);
VectorSet(Vec[4],0,0,x/y);
VectorSet(Vec[5],0,0,-x/y);

for (i=0;i<8; i++)
VectorAdd(Vec[i],start,Vec[i]);

for (i=0;i<4; i++)
CG_RailTrail (start,Vec[i],0);
for (i=0;i<4; i++)
CG_RailTrail (Vec[i],Vec[4],0);
for (i=0;i<4; i++)
CG_RailTrail (Vec[i],Vec[5],0);

CG_RailBeam(start,Vec[5]);
CG_RailBeam(start,Vec[4]);
}

le = CG_AllocExpandingPoly ( LE_RGB_FADE|LE_EXPANDING, start, vec3_origin, 4, 5, 600, 255, 0, 255, CG_MediaModel (cgs.media.modExplodeball), NULL);
le->light = 60;
le->ent.rotation = rand () % 360;
le2 = CG_AllocExpandingPoly ( LE_RGB_FADE|LE_EXPANDING, start, vec3_origin, 4, 7, 600, 255, 0, 255, CG_MediaModel (cgs.media.modExplodeball), NULL);
le2->light = 60;
le2->ent.rotation = rand () % 360;
le3 = CG_AllocExpandingPoly ( LE_RGB_FADE|LE_EXPANDING, start, vec3_origin, 5, 8, 600, 255, 0, 255, CG_MediaModel (cgs.media.modEmpwave), NULL);
le3->light = 60;
le3->ent.rotation = rand () % 360;
}
void CG_ShockView (void)
{
float p=0;
if (cg.shocktime > cg.time)
{
p = (cg.shocktime-cg.time);
p /=250;
cg.refdef.viewangles[PITCH] -=p*crandom();
cg.refdef.viewangles[YAW] -=p*crandom();
cg.refdef.viewangles[ROLL] -=p*crandom();
p *=crandom();
}

cg.refdef.vieworg[0] += (1.0/16) + p;
cg.refdef.vieworg[1] += (1.0/16) + p;
cg.refdef.vieworg[2] += (1.0/16) + p;

cg.refdef.x = scr_vrect.x;
cg.refdef.y = scr_vrect.y;
}

  


_