Jump to content

Home

Heal effect, Not compiling.


-=*Raz0r*=-

Recommended Posts

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

Link to comment
Share on other sites

Now what I wanna work on is effects that stay bolted onto a ghoul model like in sp :p.

 

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.
}
}

 

:rolleyes:

 

the breath effect follows teh player around :o

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...