lfnetwork.com mark read register faq members calendar

Thread: Heal effect, Not compiling.
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 11-05-2006, 08:05 AM   #1
-=*Raz0r*=-
Rookie
 
-=*Raz0r*=-'s Avatar
 
Join Date: Oct 2006
Location: Australia
Posts: 243
Heal effect, Not compiling.

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.
Code:
	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.

Code:
	//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
-=*Raz0r*=- is offline   you may: quote & reply,
Old 11-05-2006, 11:07 AM   #2
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
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.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 11-06-2006, 08:52 PM   #3
-=*Raz0r*=-
Rookie
 
-=*Raz0r*=-'s Avatar
 
Join Date: Oct 2006
Location: Australia
Posts: 243
How do i call it?

(Yeah, im new to coding.)
-=*Raz0r*=- is offline   you may: quote & reply,
Old 11-06-2006, 11:40 PM   #4
-=*Raz0r*=-
Rookie
 
-=*Raz0r*=-'s Avatar
 
Join Date: Oct 2006
Location: Australia
Posts: 243
Nevermind, i got it to work..

Thanks for pointing me in the right direction.
-=*Raz0r*=- is offline   you may: quote & reply,
Old 11-07-2006, 04:28 PM   #5
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
Now what I wanna work on is effects that stay bolted onto a ghoul model like in sp .


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 11-12-2006, 06:21 PM   #6
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,162
That would be pretty cool Tinny. Let us know if you figure it out. OJP could use that.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 11-12-2006, 07:26 PM   #7
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Quote:
Originally Posted by Tinny
Now what I wanna work on is effects that stay bolted onto a ghoul model like in sp .
Code:
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


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 11-13-2006, 01:35 AM   #8
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
Ahhhhhhhhhhhhh!!!!

Didn't know they had this:

trap_FX_PlayBoltedEffectID


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 11-13-2006, 03:03 AM   #9
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,162
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.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 11-13-2006, 11:11 AM   #10
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
Want me to do this and up this to the repository sometime this week Razor? Or do you want to to do it.


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 11-14-2006, 02:57 AM   #11
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,162
Go for it. I already have a full plate.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 11-16-2006, 03:43 PM   #12
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
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.


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 11-16-2006, 06:49 PM   #13
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,162
mmm, maybe just quit calling the effect syscall?


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 11-16-2006, 09:28 PM   #14
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
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.


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 11-16-2006, 09:31 PM   #15
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
well SP has an event to stop effects, but mp does not.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 11-16-2006, 09:37 PM   #16
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,162
Quote:
Originally Posted by Tinny
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.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 11-17-2006, 10:59 AM   #17
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
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?


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 11-17-2006, 03:46 PM   #18
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,162
well, that's certainly special. Have you tried looking thru the syscall list to see if you can find a similar function?


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 11-17-2006, 04:57 PM   #19
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
Yeah, I might have missed it though.


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 11-17-2006, 09:43 PM   #20
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
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.


iojamp project lead / coder

Last edited by ensiform; 11-25-2006 at 12:11 AM.
ensiform is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > Heal effect, Not compiling.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:48 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.