Jump to content

From Concussion to Destruction (Help)


Recommended Posts

 

I gave it another look. Try this:

static void ForceDestructionMissile( gentity_t *ent )
{//a fast rocket-like projectile
vec3_t start;
vec3_t dir;
int damage = forceDestructionDamage[ent->client->ps.forcePowerLevel[FP_DESTRUCTION]];
float vel = 2800;
 
VectorCopy( ent->client->renderInfo.handLPoint, start );
AngleVectors( ent->client->ps.viewangles, dir, NULL, NULL);

WP_TraceSetStart( ent, start, vec3_origin, vec3_origin );//make sure our start point isn't on the other side of a wall
 
gentity_t *missile = CreateMissile( start, dir, vel, 10000, ent, qfalse );
 
missile->classname = "destruct_proj";
missile->s.weapon = WP_DESTRUCTION;
missile->mass = 10;
 
// Make it easier to hit things
VectorSet( missile->maxs, ROCKET_SIZE, ROCKET_SIZE, ROCKET_SIZE );
VectorScale( missile->maxs, -1, missile->mins );
 
missile->damage = damage;
missile->dflags = DAMAGE_EXTRA_KNOCKBACK|DAMAGE_HEAVY_WEAP_CLASS;
 
missile->methodOfDeath = MOD_FORCE_DESTRUCTION;
missile->splashMethodOfDeath = MOD_FORCE_DESTRUCTION;
 
missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;
missile->splashDamage = floor((float)damage * 0.75f);
missile->splashRadius = forceDestructionRadius[ent->client->ps.forcePowerLevel[FP_DESTRUCTION]];
 
// we don't want it to ever bounce
missile->bounceCount = 0;
 /*
if ( ent && ent->client && ent->client->ps.powerups[PW_GALAK_SHIELD] )
{
//has shield up
missile->damage = 0;
missile->splashDamage = 0;
}
 */
// NOTENOTE: the above doesn't actually make any sense
int modPowerLevel = -1;
 
if ( missile->splashDamage 
|| missile->damage )
{
modPowerLevel = WP_AbsorbConversion(ent, ent->client->ps.forcePowerLevel[FP_ABSORB], ent, FP_DESTRUCTION, ent->client->ps.forcePowerLevel[FP_DESTRUCTION], 1);
}
 
if (modPowerLevel != -1)
{
if ( !modPowerLevel )
{
missile->damage = 0;
missile->splashDamage = 0;
}
else if ( modPowerLevel == 1 )
{
missile->damage = floor((float)damage/4.0f);
missile->splashDamage = floor((float)damage/4.0f);
}
else if ( modPowerLevel == 2 )
{
missile->damage = floor((float)damage/2.0f);
missile->splashDamage = floor((float)damage/2.0f);
}
else if ( modPowerLevel == 3 )
{
missile->damage = floor((float)damage/1.0f);
missile->splashDamage = floor((float)damage/1.0f);
}
else if ( modPowerLevel == 4 )
{
missile->damage = floor((float)damage/0.5f);
missile->splashDamage = floor((float)damage/0.5f);
}
else if ( modPowerLevel == 5 )
{
missile->damage = floor((float)damage/0.25f);
missile->splashDamage = floor((float)damage/0.25f);
}
else if ( modPowerLevel == 6 )
{
missile->damage = floor((float)damage/0.12f);
missile->splashDamage = floor((float)damage/0.12f);
}
else if ( modPowerLevel == 7 )
{
missile->damage = floor((float)damage/0.06f);
missile->splashDamage = floor((float)damage/0.06f);
}
else if ( modPowerLevel == 8 )
{
missile->damage = floor((float)damage/0.03f);
missile->splashDamage = floor((float)damage/0.03f);
}
else if ( modPowerLevel > 8 )
{
missile->damage = floor((float)damage/0.01f);
missile->splashDamage = floor((float)damage/0.01f);
}
}
}
 
void ForceDestructionShoot( gentity_t *self )
{
if ( self->health <= 0 )
{
return;
}
 
if ( !self->s.number && cg.zoomMode )
{//can't force lightning when zoomed in
return;
}
 
ForceDestructionMissile( self );
}

 

It fires exactly where your crosshairs are pointing towards, now all that's left is making the actual projectile appear.

Asgarath83 likes this
Link to comment

find on wp_saber.cpp "sound\weapons\force\lightning" and "force/lightning" for see the code lines about displaying of effects and sound of the force lightning. if you want to display effect like the blaster \ concussion shot, instead, watch on the FX_Concussion.cpp or FX_blaster.cpp. 

i think in that case is better a moving effect attacked to the damage pointer that not an "directionally area effect" like lightning or drain

Link to comment

Hi, sorry I was unable to reach you earlier, some personal stuff going on.

For the client-side effect you'll need to add a weapons.dat entry for WP_DESTRUCTION, make sure it's ordered the same way in weapons.dat as it is in the enum (ie if it comes after WP_BOWCASTER, make sure the entry comes directly after WP_BOWCASTER in the file).

For your own custom effect, you'll likely want to edit func_t funcs[] in g_weaponLoad.cpp to have your own new projectile effect. Should look something similar to this:

{ "destruction_func", FX_DestructionShot_Think }

 

FX_DestructionShot_Think isn't an actual function, so you'll need to do something similar to what the Bryar pistol, Blaster rifle, etc do there. It should be extremely straightforward, the function looks something like this. Basically you'll want yours to look roughly identical, except changing the bottom part to match your needs (the Bryar uses a different effect, effects/bryar/npcShot.efx, as shown in the last check, for NPCs. Players in SP always use client number 0)

 

Is your projectile actually doing its damage correctly? This is something I would like to know for sure

Link to comment

Hi, sorry I was unable to reach you earlier, some personal stuff going on.

For the client-side effect you'll need to add a weapons.dat entry for WP_DESTRUCTION, make sure it's ordered the same way in weapons.dat as it is in the enum (ie if it comes after WP_BOWCASTER, make sure the entry comes directly after WP_BOWCASTER in the file).

For your own custom effect, you'll likely want to edit func_t funcs[] in g_weaponLoad.cpp to have your own new projectile effect. Should look something similar to this:

{ "destruction_func", FX_DestructionShot_Think }

FX_DestructionShot_Think isn't an actual function, so you'll need to do something similar to what the Bryar pistol, Blaster rifle, etc do there. It should be extremely straightforward, the function looks something like this. Basically you'll want yours to look roughly identical, except changing the bottom part to match your needs (the Bryar uses a different effect, effects/bryar/npcShot.efx, as shown in the last check, for NPCs. Players in SP always use client number 0)

 

Is your projectile actually doing its damage correctly? This is something I would like to know for sure

 

It's cool man, I'm in no hurry.

 

And yes, it is doing it's own damages properly; All it's missing is it's own projectile FX (ex: concussion/shot ).

Link to comment

I'm doing final releases, and it crashes whenever I press 'F' while I have Destruction selected.

 

when i edited and customize sound and effect for the CLASSES of force power, i got same trouble when i got syntaxis error... mmm, no, are not syntaxis. the expression is correct: it's incompatibile with the previus part of the expressiom-

for example: if the code is for the "self" , thje istruction too need to be focused on "self"

example:

self BLABLABLABLABLA

if

Self->client->Npc_class == CLASS_ALORA blablabla <- this not crash.

 

self BLABLABLABLABLABLA

if

client->NPC_class == CLASS_ALORA blablabla <- the syntaxis is correct , building not make error,... but in game crashes when using the power with playermodel alora XD be careful. you need the expression and the setting is ever compatible with the declaration.

 

EDIT: LOl sorry, i have not seen an entire page of discussion. :S

Link to comment

@@Asgarath83

 

destruction.efx

 

repeatDelay 300
 
Particle
{
spawnFlags evenDistribution rgbComponentInterpolation
 
life 500 800
 
delay 0 200
 
origin 0 -2 -2 0 2 2
 
rotation 87 93
 
rotationDelta -4 4
 
velocity 0 -4 -4 10 4 4
 
gravity 0 50
 
rgb
{
start 0.6235 0.4118 0.01569 0.502 0 0
}
 
alpha
{
end 0
parm 80
flags linear nonlinear
}
 
size
{
start 4 5
end 12
parm 50
flags linear clamp
}
 
shaders
[
gfx/effects/fire2
gfx/effects/fire3
gfx/effects/fire4
]
}
 
Particle
{
flags useAlpha
 
spawnFlags evenDistribution rgbComponentInterpolation
 
life 500 1400
 
delay 0 200
 
cullrange 250
 
origin 5 -3 -3 10 3 3
 
velocity 5 0 0 10 0 0
 
acceleration 0 -10 -10 0 10 10
 
gravity 20 30
 
rgb
{
start 0.502 0 0
end 1 0 0
flags linear
}
 
alpha
{
end 0
parm 80
flags linear nonlinear
}
 
size
{
start 10 12
end 3 4
}
 
shaders
[
gfx/effects/alpha_smoke
gfx/effects/alpha_smoke2
]
}
 
Particle
{
name Copy of Unnamed Particle 1
 
spawnFlags evenDistribution
 
count 0 2
 
life 500 900
 
delay 0 200
 
cullrange 200
 
origin 10 -10 -10 20 10 10
 
velocity 15 0 0 25 0 0
 
acceleration 0 -5 -5 0 5 5
 
gravity 30 50
 
rgb
{
start 1 0 0
end 0 0 0
parm 70
flags linear nonlinear
}
 
alpha
{
end 0
parm 2 5
flags wave
}
 
size
{
start 0.6 1.5
end 1 2
}
 
shaders
[
gfx/effects/whiteFlare
]
}
 
Particle
{
name Extra
 
spawnFlags evenDistribution rgbComponentInterpolation
 
count 1 2
 
life 500 800
 
delay 0 200
 
cullrange 500
 
origin 0 -2 -2 0 2 2
 
rotation 87 93
 
rotationDelta -4 4
 
velocity 0 -4 -4 10 4 4
 
gravity 0 50
 
rgb
{
start 1 1 0 0.502 0 0
end 0.502 0 0
flags linear
}
 
alpha
{
end 0
parm 80
flags linear nonlinear
}
 
size
{
start 4 5
end 12
parm 50
flags linear clamp
}
 
shaders
[
gfx/effects/fire2
gfx/effects/fire3
gfx/effects/fire4
]
}
 
Link to comment

Okay, i checked on effectEd and as effect is okay, also nice, well done. :)

i checked on my mod replacing the concussion projectile with the your and shooting and i not see glowing effects or strange flashes.

so there are 3 possibility:

- a code issue about projectile fx parameters of lighting

- remove the weapon.dat vale about missilelight (that's set the intensity of lighting of missile)

- check the shaders of the fire, and other sprites, for avoid there are some "glow" paremeter on the primitives.

mmmm strange idea but... i have a suspect: if the your projectiles is shooted by saber and destruction is builded on the saber code, (i have understand that, maybe i am wrong) well, for same strange issue of the code, is possible the concussion effect are taking the glowing of the lightsabers blade O.o

Link to comment

I think i had misunderstood what you want. you want the effect glowing and emit lighting right?

in that case, there are two ways.

fast way: you can apply a flash light primitive into the efect of the projectile with same amount of duration second of the fire, and the corrispondent color and intensity. you can set color, intensity and duration of the flash light,. you can make a light that follow the effect because the light itself is part of effect.

i not use much this method because you need to be really carefyulll. dynamic light can be... evil for eyes and stress the sight. otherwise, that's kind of effect are dangerous for people witih epilessy and photosensibility. i am very sensible to that0s thing and also if i make spetactular effect for my mod, i avoid ever to use the Light primitives.

the other way is to make other 3 sprites for the shader: example

 

1 copy and rename: gfx/effects/fire2
gfx
/effects/fire3
gfx
/effects/fire4

in gfx/effects/firedestruction2 \ 3 \ 4

 

2 make a shader file for the new sprites that setting the glow and and light color and lightintensity for the new fire effect, you can use the paramter of the lightsaber shader + the lightning effect and color shader paramter of a shader of a sky with sun.

 

3: edit the efx of projectile for replace fire2,3,4 with firedestruction2,3 and 4.

now you have your glowing effect. :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...