lfnetwork.com mark read register faq members calendar

Thread: [Fix] 2handed Lightning
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 03-31-2010, 03:31 PM   #1
Kimberly
Rookie
 
Join Date: Mar 2010
Posts: 11
[Fix] 2handed Lightning

I just want to share this fix you guys

----------------------------------------
The following code is made by the author
----------------------------------------

In w_force.c
(that part handles the damage)

Search "jackin' 'em up" and replace the conditions with this code:
Code:
/*
 *
 * Added by Kimmy
 * Conditions for 2handed lightning
 *
 */
if ( self->client->ps.weapon == WP_NONE
|| self->client->ps.weapon == WP_MELEE
|| self->client->ps.weapon == WP_SABER 
&& self->client->ps.saberHolstered
&& self->client->ps.fd.forcePowerLevel[FP_LIGHTNING] > FORCE_LEVEL_2 )
				{//2-handed lightning
					//jackin' 'em up, Palpatine-style
					dmg *= 2;
				}

In cg_players.c
(the origin and such stuff)

Search "doing the electrocuting"

And add this part

Code:
/*
 * Added by Kimmy
 * 2handed lightning should work now
 *
 */

		vec3_t axis[3];
		vec3_t tAng, fAng, fxDir;
		vec3_t efOrgL; //origin left hand
		vec3_t efOrgR; //origin right hand

		VectorSet( tAng, cent->turAngles[PITCH], cent->turAngles[YAW], cent->turAngles[ROLL] );

		VectorSet( fAng, cent->pe.torso.pitchAngle, cent->pe.torso.yawAngle, 0 );

		AngleVectors( fAng, fxDir, NULL, NULL );

		if ( cent->currentState.torsoAnim == BOTH_FORCE_2HANDEDLIGHTNING_HOLD )
		{
			mdxaBone_t 	rHandMatrix;
			trap_G2API_GetBoltMatrix(cent->ghoul2, 0, ci->bolt_rhand, &rHandMatrix, cent->turAngles, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale);
			efOrgR[0] = rHandMatrix.matrix[0][3]; //right hand matrix -> efOrgR
			efOrgR[1] = rHandMatrix.matrix[1][3];
			efOrgR[2] = rHandMatrix.matrix[2][3];	
			
			if (!gotLHandMatrix)
			{
				trap_G2API_GetBoltMatrix(cent->ghoul2, 0, ci->bolt_lhand, &lHandMatrix, cent->turAngles, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale);
				gotLHandMatrix = qtrue;
			}
			efOrgL[0] = lHandMatrix.matrix[0][3]; //left hand matrix -> efOrgL
			efOrgL[1] = lHandMatrix.matrix[1][3];
			efOrgL[2] = lHandMatrix.matrix[2][3];
		}
		else
		{
			if (!gotLHandMatrix)
			{
				trap_G2API_GetBoltMatrix(cent->ghoul2, 0, ci->bolt_lhand, &lHandMatrix, cent->turAngles, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale);
				gotLHandMatrix = qtrue;
			}
			efOrgL[0] = lHandMatrix.matrix[0][3]; //just for the simple lightning from the left hand
			efOrgL[1] = lHandMatrix.matrix[1][3];
			efOrgL[2] = lHandMatrix.matrix[2][3];
		}

		AnglesToAxis( fAng, axis );

/* 
 * Added by Kimmy
 * This should fix playing the single hand effect at two places
 *
 */
		if ( cent->currentState.activeForcePass > FORCE_LEVEL_2 )

		{//arc
			//trap_FX_PlayEffectID( cgs.effects.forceLightningWide, efOrg, fxDir );
			//trap_FX_PlayEntityEffectID(cgs.effects.forceLightningWide, efOrg, axis, cent->boltInfo, cent->currentState.number, -1, -1);
			if ( pm->ps->weapon == WP_NONE || pm->ps->weapon == WP_MELEE || ( pm->ps->weapon == WP_SABER && pm->ps->saberHolstered ) )
			{
				trap_FX_PlayEntityEffectID(cgs.effects.forceLightningWide, efOrgR, axis, -1, -1, -1, -1); // thats the solution - we need to play the fx from two origins
			}

			trap_FX_PlayEntityEffectID(cgs.effects.forceLightningWide, efOrgL, axis, -1, -1, -1, -1);
		}
		else
		{//line
			//trap_FX_PlayEffectID( cgs.effects.forceLightning, efOrg, fxDir );
			//trap_FX_PlayEntityEffectID(cgs.effects.forceLightning, efOrg, axis, cent->boltInfo, cent->currentState.number, -1, -1);
			trap_FX_PlayEntityEffectID(cgs.effects.forceLightning, efOrgL, axis, -1, -1, -1, -1);
		}

		/*
		if (cent->bolt4 < cg.time)
		{
			cent->bolt4 = cg.time + 100;
			trap_S_StartSound(NULL, cent->currentState.number, CHAN_AUTO, trap_S_RegisterSound("sound/weapons/force/lightning.wav") );
		}
		*/
	}
The end is "fullbody push effect"



In bg_pmove.c
(animation)


Between "gripping" and "draining"

Code:
/* 
 * Added by Kimmy
 * improved 2handed animation fix
 *
 */

			else if ( (pm->ps->fd.forcePowersActive&(1<<FP_LIGHTNING)) )
			{//lightning
				if ( pm->ps->weapon == WP_MELEE ||
					 pm->ps->weapon == WP_NONE ||
					 pm->ps->weapon == WP_SABER && pm->ps->saberHolstered )
				{//2-handed lightning
					desiredAnim = BOTH_FORCE_2HANDEDLIGHTNING_HOLD;
				}
				else
				{
					desiredAnim = BOTH_FORCELIGHTNING_HOLD;
				}
			}



If you want you can give me credit

-Kimberly aka Nomi Halcyon-
Kimberly is offline   you may: quote & reply,
Old 04-05-2010, 11:25 AM   #2
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
Thanks for the heads up, are you working on a mod?


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 04-05-2010, 08:10 PM   #3
Kimberly
Rookie
 
Join Date: Mar 2010
Posts: 11
well, im just helping Didz with Coremod and Stoiss with Evolution of Combat
what about you r ya working at a mod atm
Kimberly is offline   you may: quote & reply,
Old 04-06-2010, 07:22 AM   #4
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
Working on trying to finish up version 2 of the old school mod i was making. Really trying to get it done by this summer.


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 04-06-2010, 09:28 AM   #5
Kimberly
Rookie
 
Join Date: Mar 2010
Posts: 11
a kewl

is force destruction and force blinding a complete new force or just a changed force (like lightning and rage to destruction and blinding)
Kimberly is offline   you may: quote & reply,
Old 04-06-2010, 10:05 AM   #6
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
I tried to add new force powers, but the way the bases are defined in q_shared.h makes it hard to expand. I replaced force team heal and energize and integrated them into force heal and force drain when at full health. Ooh, read up on coremod, i was trying to implement some of the same stuff with lua script.


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 04-06-2010, 03:31 PM   #7
Kimberly
Rookie
 
Join Date: Mar 2010
Posts: 11
well i thought so

but you can add new force level and implent so similar forces

Lightning Level 1
-> Force Bolt

Lightning Level 2
-> Force Shock

Lightning Level 3
-> Force Lightning

Lightning Level 4
-> Force Lightningstorm

Lightning Level 5
-> Force Lightningbomb

:P
Kimberly is offline   you may: quote & reply,
Old 04-06-2010, 11:19 PM   #8
-=*Raz0r*=-
Rookie
 
-=*Raz0r*=-'s Avatar
 
Join Date: Oct 2006
Location: Australia
Posts: 243
* Raz0r blabs about a nice little community of the active coders for JA on IRC at irc.arloria.net/#JACoders
-=*Raz0r*=- is offline   you may: quote & reply,
Old 04-08-2010, 05:28 AM   #9
Kimberly
Rookie
 
Join Date: Mar 2010
Posts: 11
* slaps Raz0r around a bit with a large rainbow trout
Kimberly 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 > [Fix] 2handed Lightning

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 02:17 AM.

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