Jump to content

JediBantha

Members
  • Posts

    237
  • Joined

  • Last visited

Everything posted by JediBantha

  1. I didn't think to do it; I just copied those from lightning and went with that.
  2. @@eezstreet Also, what do you put into the missile code to prevent it from doing damage to the owner?
  3. cg_weapons.cpp: case WP_SABER: theFxScheduler.RegisterEffect( "force/destruction" ); //this doesn't work, even when listed under WP_DESTRUCTION theFxScheduler.RegisterEffect( "force/destructionexplode" ); //this works, for some reason break; case WP_DESTRUCTION: break; g_combat.cpp: case MOD_FORCE_DESTRUCTION: weapon = WP_DESTRUCTION; break; g_weapon.cpp: float weaponSpeed[WP_NUM_WEAPONS][2] = { { 0,0 },//WP_NONE, { 0,0 },//WP_SABER, // NOTE: lots of code assumes this is the first weapon (... which is crap) so be careful -Ste. { BRYAR_PISTOL_VEL,BRYAR_PISTOL_VEL },//WP_BLASTER_PISTOL, { BLASTER_VELOCITY,BLASTER_VELOCITY },//WP_BLASTER, { Q3_INFINITE,Q3_INFINITE },//WP_DISRUPTOR, { BOWCASTER_VELOCITY,BOWCASTER_VELOCITY },//WP_BOWCASTER, { REPEATER_VELOCITY,REPEATER_ALT_VELOCITY },//WP_REPEATER, { DEMP2_VELOCITY,DEMP2_ALT_RANGE },//WP_DEMP2, { FLECHETTE_VEL,FLECHETTE_MINE_VEL },//WP_FLECHETTE, { ROCKET_VELOCITY,ROCKET_ALT_VELOCITY },//WP_ROCKET_LAUNCHER, { TD_VELOCITY,TD_ALT_VELOCITY },//WP_THERMAL, { 0,0 },//WP_TRIP_MINE, { 0,0 },//WP_DET_PACK, { CONC_VELOCITY,Q3_INFINITE },//WP_CONCUSSION, { 2600,Q3_INFINITE },//WP_DESTRUCTION, { 0,0 },//WP_MELEE, // Any ol' melee attack { 0,0 },//WP_STUN_BATON, { BRYAR_PISTOL_VEL,BRYAR_PISTOL_VEL },//WP_BRYAR_PISTOL, { EMPLACED_VEL,EMPLACED_VEL },//WP_EMPLACED_GUN, { BRYAR_PISTOL_VEL,BRYAR_PISTOL_VEL },//WP_BOT_LASER, // Probe droid - Laser blast { 0,0 },//WP_TURRET, // turret guns { ATST_MAIN_VEL,ATST_MAIN_VEL },//WP_ATST_MAIN, { ATST_SIDE_MAIN_VELOCITY,ATST_SIDE_ALT_NPC_VELOCITY },//WP_ATST_SIDE, { EMPLACED_VEL,EMPLACED_VEL },//WP_TIE_FIGHTER, { EMPLACED_VEL,REPEATER_ALT_VELOCITY },//WP_RAPID_FIRE_CONC, { 0,0 },//WP_JAWA, { TUSKEN_RIFLE_VEL,TUSKEN_RIFLE_VEL },//WP_TUSKEN_RIFLE, { 0,0 },//WP_TUSKEN_STAFF, { 0,0 },//WP_SCEPTER, { 0,0 },//WP_NOGHRI_STICK, }; else if ( weapon != WP_NONE ) { switch( weapon ) { case WP_BRYAR_PISTOL: case WP_BLASTER_PISTOL: case WP_BLASTER: case WP_DISRUPTOR: case WP_BOWCASTER: case WP_ROCKET_LAUNCHER: case WP_CONCUSSION: return qtrue; break; //non-alt standard case WP_REPEATER: case WP_DEMP2: case WP_FLECHETTE: if ( !alt_fire ) { return qtrue; } break; //emplaced gun case WP_EMPLACED_GUN: return qtrue; break; //atst case WP_ATST_MAIN: case WP_ATST_SIDE: return qtrue; break; case WP_DESTRUCTION: return qtrue; break; } } return qfalse; case WP_DESTRUCTION: if (ent->count > 0) { ent->count = 0; gi.G2API_GetBoltMatrix( ent->ghoul2, ent->playerModel, ent->handLBolt, &boltMatrix, ent->s.angles, ent->s.origin, (cg.time?cg.time:level.time), NULL, ent->s.modelScale ); } else { ent->count = 1; gi.G2API_GetBoltMatrix( ent->ghoul2, ent->playerModel, ent->handRBolt, &boltMatrix, ent->s.angles, ent->s.origin, (cg.time?cg.time:level.time), NULL, ent->s.modelScale ); } gi.G2API_GiveMeVectorFromMatrix( boltMatrix, ORIGIN, org ); VectorCopy(org,muzzlePoint); break; vec3_t WP_MuzzlePoint[WP_NUM_WEAPONS] = {// Fwd, right, up. {0, 0, 0 }, // WP_NONE, {8 , 16, 0 }, // WP_SABER, {12, 6, -6 }, // WP_BLASTER_PISTOL, {12, 6, -6 }, // WP_BLASTER, {12, 6, -6 }, // WP_DISRUPTOR, {12, 2, -6 }, // WP_BOWCASTER, {12, 4.5, -6 }, // WP_REPEATER, {12, 6, -6 }, // WP_DEMP2, {12, 6, -6 }, // WP_FLECHETTE, {12, 8, -4 }, // WP_ROCKET_LAUNCHER, {12, 0, -4 }, // WP_THERMAL, {12, 0, -10 }, // WP_TRIP_MINE, {12, 0, -4 }, // WP_DET_PACK, {12, 8, -4 }, // WP_CONCUSSION, {0, 0, 0 }, // WP_DESTRUCTION, {0 , 8, 0 }, // WP_MELEE, {0, 0, 0 }, // WP_ATST_MAIN, {0, 0, 0 }, // WP_ATST_SIDE, {0 , 8, 0 }, // WP_STUN_BATON, {12, 6, -6 }, // WP_BRYAR_PISTOL, }; case WP_DESTRUCTION: ForceDestruction( ent ); break; wp_saber.cpp: static void ForceDestructionMissile( gentity_t *self ) {//a fast rocket-like projectile vec3_t start; vec3_t dir; vec3_t forward; gentity_t *traceEnt; int radius = forceDestructionRadius[self->client->ps.forcePowerLevel[FP_DESTRUCTION]]; int damage = forceDestructionDamage[self->client->ps.forcePowerLevel[FP_DESTRUCTION]]; float vel = 2600; if ( self->client->ps.forcePowersActive & (1 << FP_RAGE) ) { damage *= 2; } VectorCopy( self->client->renderInfo.handLPoint, start ); AngleVectors( self->client->ps.viewangles, dir, NULL, NULL ); WP_TraceSetStart( self, 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, self ); WP_MissileTargetHint( self, muzzle, forwardVec ); missile->classname = "destruct_proj"; missile->s.weapon = WP_DESTRUCTION; missile->fxID = G_EffectIndex( "force/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 = damage; missile->splashRadius = radius; // we don't want it to ever bounce missile->bounceCount = 0; int modPowerLevel = -1; if (missile->damage || missile->splashDamage) { modPowerLevel = WP_AbsorbConversion(traceEnt, traceEnt->client->ps.forcePowerLevel[FP_ABSORB], self, FP_DESTRUCTION, self->client->ps.forcePowerLevel[FP_DESTRUCTION], 1); } if (modPowerLevel != -1) { if ( !modPowerLevel ) { damage = 0; } else if ( modPowerLevel == 1 ) { damage = floor((float)damage/4.0f); } else if ( modPowerLevel == 2 ) { damage = floor((float)damage/2.0f); } else if ( modPowerLevel == 3 ) { damage = floor((float)damage/1.0f); } else if ( modPowerLevel == 4 ) { damage = floor((float)damage/0.5f); } else if ( modPowerLevel == 5 ) { damage = floor((float)damage/0.25f); } else if ( modPowerLevel == 6 ) { damage = floor((float)damage/0.12f); } else if ( modPowerLevel == 7 ) { damage = floor((float)damage/0.06f); } else if ( modPowerLevel == 8 ) { damage = floor((float)damage/0.03f); } else if ( modPowerLevel > 8 ) { damage = 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 ); } void ForceDestruction( gentity_t *self ) { if ( self->health <= 0 ) { return; } if ( !self->s.number && (cg.zoomMode || in_camera) ) { return; } if ( self->client->ps.leanofs ) { return; } if (self->client->ps.forcePowersActive & (1 << FP_PROTECT) ) { WP_ForcePowerStop( self, FP_PROTECT ); } if (self->client->ps.forcePowersActive & (1 << FP_ABSORB) ) { WP_ForcePowerStop( self, FP_ABSORB ); } if ( self->client->ps.forcePowerLevel[FP_DESTRUCTION] <= FORCE_LEVEL_2 && self->client->ps.forcePower < 80 || self->client->ps.forcePowerLevel[FP_DESTRUCTION] > FORCE_LEVEL_2 && self->client->ps.forcePower < 40 || !WP_ForcePowerUsable( self, FP_DESTRUCTION, 0 ) ) { return; } if ( self->client->ps.saberLockTime > level.time ) {//FIXME: can this be a way to break out? return; } if ( self->client->ps.forcePowerLevel[FP_DESTRUCTION] <= FORCE_LEVEL_2 ) { WP_ForcePowerStart( self, FP_DESTRUCTION, 80 ); NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCEPUSH, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD|SETANIM_FLAG_RESTART ); ForceDestructionShoot( self ); G_SoundOnEnt( self, CHAN_BODY, "sound/weapons/force/forcedestruct01.wav" ); } if ( self->client->ps.forcePowerLevel[FP_DESTRUCTION] > FORCE_LEVEL_2 ) { WP_ForcePowerStart( self, FP_DESTRUCTION, 40 ); NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCEPUSH, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD|SETANIM_FLAG_RESTART ); ForceDestructionShoot( self ); G_SoundOnEnt( self, CHAN_BODY, "sound/weapons/force/forcedestruct01.wav" ); } }
  4. @@Asgarath83 I'm still shooting invisible missiles, and the explosion's FX only seems to register when it's under WP_SABER, oddly enough... @@eezstreet I don't suppose I could paste the lines of code from FX_Destruction.cpp into wp_saber.cpp? Because I feel like listing a Force power as a weapon is part of the problem.
  5. What kind of configuration do you have in the files? You might already have this solved, by the look of things.
  6. Have you tested that in-game?
  7. Everything is proceeding as I have foreseen.
  8. @@Asgarath83 @@eezstreet FX_Destruction.cpp: void FX_DestructProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon ) { vec3_t forward; if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0.0f ) { forward[2] = 1.0f; } theFxScheduler.PlayEffect( "force/destruction", cent->lerpOrigin, forward ); } /* --------------------------- FX_DestructHitWall --------------------------- */ void FX_DestructHitWall( vec3_t origin, vec3_t normal ) { theFxScheduler.PlayEffect( "force/destruction_explode", origin, normal ); } /* --------------------------- FX_DestructHitPlayer --------------------------- */ void FX_DestructHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid ) { theFxScheduler.PlayEffect( "force/destruction_explode", origin, normal ); } cg_weapons.cpp: case WP_SABER: theFxScheduler.RegisterEffect( "force/destruction" ); theFxScheduler.RegisterEffect( "force/destruction_explode" );
  9. Doby's server was smokin' a Doobie.
  10. @@Asgarath83 Imagine the Concussion Rifle without Concussion/Shot.efx; That's what's happening with Destruction right now. Everything else is working fine, which means there's something else I'm missing in the actual SP code.
  11. @@Asgarath83 @@eezstreet I tried changing the .efx and .dat files, but no luck; The problem has to be in the code itself, but I don't know where to look.
  12. Single Player. A well-made campaign with enough content can keep you occupied for an entire month.
  13. I read the thread as Obi-WiFi, lol.
  14. @@Asgarath83 @@eezstreet My guess is that there's probably something I need to add in the shader files, or the code itself, for the projectile to actually play it's .efx file.
  15. @@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 ] }
  16. @@eezstreet @@Asgarath83 Didn't change anything, so it has to be in either the code, or the .efx
  17. I put these two under WP_DESTRUCTION for the lighting effect. It wouldn't make sense not to, in my opinion. missileLight 125 missileLightColor 1.0 0.25 0.25 As for the .efx, I simply renamed mp/small_fire_red.
  18. Sorry, glow effect, like a sort of light that a blaster bolt usually emanates.
  19. @@eezstreet (Update) Tried some stuff with weapons.dat, and it once again has a lighting effect as it flies by... The problem is either in the code or the efx.
  20. @@Asgarath83 It happens to the best of us, don't worry. @@eezstreet Is there anything specific that I need to add to the weapons.dat, or ForceDestructionMissile?
  21. Not everyone has an open mind about these kinds of things... Some people are passive, others are aggressive - Both drastically affect how people express themselves towards others, and how they interpret the information given to them.
  22. Constructive criticism = Addressing someone as an asshole, while holding them at gunpoint. But on a more serious note, it can be addressing the flaws in someone's work, and then encouraging them to improve on their project (possibly in their free time), and to never stop trying.
  23. None of the above seems to work either, and I already tried changing *ent to *self.
  24. 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 ).
×
×
  • Create New...