-=*Raz0r*=- Posted November 5, 2006 Posted November 5, 2006 Hey, Ok so i tryed adding in a heal effect into jka for my own clan mod... In cg_main.c I added the Heal line. cgs.effects.forceLightning = trap_FX_RegisterEffect( "effects/force/lightning.efx" ); cgs.effects.forceLightningWide = trap_FX_RegisterEffect( "effects/force/lightningwide.efx" ); cgs.effects.forceDrain = trap_FX_RegisterEffect( "effects/mp/drain.efx" ); cgs.effects.forceHeal = trap_FX_RegisterEffect( "effects/mp/heal2.efx" ); cgs.effects.forceDrainWide = trap_FX_RegisterEffect( "effects/mp/drainwide.efx" ); cgs.effects.forceDrained = trap_FX_RegisterEffect( "effects/mp/drainhit.efx"); In cg_local.c I added the heal line. //FORCE fxHandle_t forceLightning; fxHandle_t forceLightningWide; fxHandle_t forceDrain; fxHandle_t forceDrainWide; fxHandle_t forceDrained; fxHandle_t forceHeal Then i saved them, and tryed building my mod. 1404 errors, 333 warning. Build Log: http://www.savefile.com/files/228771
ensiform Posted November 5, 2006 Posted November 5, 2006 you need a ; after it in cg_local.h and that isn't going to be enough to make it spawn. you need to call it somewhere.
-=*Raz0r*=- Posted November 7, 2006 Author Posted November 7, 2006 How do i call it? (Yeah, im new to coding.)
-=*Raz0r*=- Posted November 7, 2006 Author Posted November 7, 2006 Nevermind, i got it to work.. Thanks for pointing me in the right direction.
Tinny Posted November 7, 2006 Posted November 7, 2006 Now what I wanna work on is effects that stay bolted onto a ghoul model like in sp .
razorace Posted November 12, 2006 Posted November 12, 2006 That would be pretty cool Tinny. Let us know if you figure it out. OJP could use that.
ensiform Posted November 13, 2006 Posted November 13, 2006 Now what I wanna work on is effects that stay bolted onto a ghoul model like in sp . extern vmCvar_t cg_drawBreath; static void CG_BreathPuffs( centity_t *cent )//, vec3_t angles, vec3_t origin ) { int bolt = -1; int contents; vec3_t vEffectOrigin; mdxaBone_t boltMatrix; if (cent->localAnimIndex > 1) { //Sorry, the humanoid IS IN ANOTHER CASTLE. return; } if (cg.snap && CG_IsMindTricked(cent->currentState.trickedentindex, cent->currentState.trickedentindex2, cent->currentState.trickedentindex3, cent->currentState.trickedentindex4, cg.snap->ps.clientNum)) { return; //this entity is mind-tricking the current client, so don't render it } if ( !cent || cg_drawBreath.integer == 0 || cent->currentState.eFlags & EF_DEAD || cgs.clientinfo[cent->currentState.number].breathPuffTime > cg.time ) return; if ( cent->currentState.number == cg.snap->ps.clientNum && !cg.renderingThirdPerson ) { if ( ( !cg_trueguns.integer && cg.predictedPlayerState.weapon != WP_SABER && cg.predictedPlayerState.weapon != WP_MELEE) || ( cg.predictedPlayerState.weapon == WP_SABER && cg_truesaberonly.integer ) || cg.predictedPlayerState.zoomMode) { return; } } switch ( cent->currentState.NPC_class ) { default: break; case CLASS_SAND_CREATURE: case CLASS_R2D2: case CLASS_R5D2: case CLASS_ATST: case CLASS_VEHICLE: case CLASS_GONK: case CLASS_INTERROGATOR: case CLASS_MARK1: case CLASS_MARK2: case CLASS_GALAKMECH: case CLASS_MOUSE: case CLASS_PROBE: case CLASS_PROTOCOL: case CLASS_SENTRY: case CLASS_SEEKER: case CLASS_SABER_DROID: case CLASS_ASSASSIN_DROID: case CLASS_ROCKETTROOPER: case CLASS_HAZARD_TROOPER: case -1: // invalid class return; break; } bolt = trap_G2API_AddBolt(cent->ghoul2, 0, "*head_front"); // Get the head-front bolt/tag. if ( bolt == -1 ) { return; } /* cg_drawBreath.integer == 0 - Don't draw at all. == 1 - Draw both (but bubbles only when under water). == 2 - Draw only cold breath. == 3 - Draw only under water bubbles (when under water) */ trap_G2API_GetBoltMatrix( cent->ghoul2, 0, bolt, &boltMatrix, cent->turAngles, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale ); BG_GiveMeVectorFromMatrix( &boltMatrix, ORIGIN, vEffectOrigin ); contents = trap_CM_PointContents( vEffectOrigin, 0 ); // If they're submerged in something bad, leave. if ( contents & ( CONTENTS_SLIME | CONTENTS_LAVA ) ) { return; } // Show bubbles effect if we're under water. if ( (contents & CONTENTS_WATER) && ( cg_drawBreath.integer == 1 || cg_drawBreath.integer == 3 ) ) { trap_FX_PlayBoltedEffectID( cgs.effects.waterBreath, vEffectOrigin, cent->ghoul2, bolt, cent->currentState.number, 0, 0, qtrue ); } // Draw cold breath effect. else if ( cg.snowParsed && cg_drawBreath.integer == 1 || cg_drawBreath.integer == 2 ) { trap_FX_PlayBoltedEffectID( cgs.effects.breath, vEffectOrigin, cent->ghoul2, bolt, cent->currentState.number, 0, 0, qtrue ); } // TODO: It'd be nice if they breath faster when they're more damaged or when running... if ( trap_S_GetVoiceVolume(cent->currentState.number) > 0 ) {//make breath when talking cgs.clientinfo[cent->currentState.number].breathPuffTime = cg.time + 300; // every 200 ms } else { cgs.clientinfo[cent->currentState.number].breathPuffTime = cg.time + 3000; // every 3 seconds. } } the breath effect follows teh player around
Tinny Posted November 13, 2006 Posted November 13, 2006 Ahhhhhhhhhhhhh!!!! Didn't know they had this: trap_FX_PlayBoltedEffectID
razorace Posted November 13, 2006 Posted November 13, 2006 Well, it would be great if you could create the temp entities nessicary to make it work for calls from the server. I know there's several general calls used to make several effects that should be bolted but end up being static.
Tinny Posted November 13, 2006 Posted November 13, 2006 Want me to do this and up this to the repository sometime this week Razor? Or do you want to to do it.
Tinny Posted November 16, 2006 Posted November 16, 2006 The bolted effects work beautifully, problem is unlike the other effects I don't think you can control the angle of the effect and I don't know how to kill it if I don't want it to loop anymore.
razorace Posted November 16, 2006 Posted November 16, 2006 mmm, maybe just quit calling the effect syscall?
Tinny Posted November 17, 2006 Posted November 17, 2006 Nah, you call the effect once and you have an option to make it looping so you don't keep spawning effects as it stays bolted on the person. I just don't know how to terminate it.
ensiform Posted November 17, 2006 Posted November 17, 2006 well SP has an event to stop effects, but mp does not.
razorace Posted November 17, 2006 Posted November 17, 2006 Nah, you call the effect once and you have an option to make it looping so you don't keep spawning effects as it stays bolted on the person. I just don't know how to terminate it. Hmmm, is there some sort of handle passed back or something? There's gotta be a way to turn it off.
Tinny Posted November 17, 2006 Posted November 17, 2006 I looked last night. SP has a spiffy ev_stop_effect which goes through a syscall that stops effects at a specific bolt on a ghoul2 entity. MP doesn't have any such syscall, now if you knew what kind of entity effects were couldn't you just deallocate it?
razorace Posted November 17, 2006 Posted November 17, 2006 well, that's certainly special. Have you tried looking thru the syscall list to see if you can find a similar function?
ensiform Posted November 18, 2006 Posted November 18, 2006 There's no such syscall to delete an effect period, not even one not listed in the cg_syscalls.c but import or export define in cg_public (where all the CG_... calls are declared). Plus I don't think the effects are centity_t pointers or centity_t's at all. Edit: Tinny, please merge your code that you've added to Basic to Enhanced also.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.