lfnetwork.com mark read register faq members calendar

Thread: Facing ?
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 08-03-2005, 02:59 PM   #1
GangsterAngel
Rookie
 
GangsterAngel's Avatar
 
Join Date: May 2004
Posts: 139
Facing ? ( Solved )

Hey , id realy appreciate help here.

im doing a 'Thing' where if you "Use" the player you are gripping
aslong as u have been gripping them for 2 secconds you throw them.

i need to know how i make the player be thrown to the left evry time
( no matter what direction the thrower is facing )

im a little lost to tell the truth.....

heres the code i have now.

Code:
	//RPG MOD ======== ( Throwing someone ) [ Let go of user so they can be thrown ]
	if (ent->client->pers.RPG_StopGripTime !=NULL && ent->client->pers.RPG_StopGripTime < level.time) {
//=============================
//Make sure thrower is still gripping
		if( UsingFP(ent,FP_GRIP) == 1 && ent->health > 0/* && ent->client->ps.torsoAnim==BOTH_FORCEGRIP3THROW*/) {
//=============================
	gentity_t *gripped = &g_entities[ent->client->ps.fd.forceGripEntityNum];
//===============================
WP_ForcePowerStop(ent,FP_GRIP);
gripped->client->pers.RPG_ThrowTime=level.time+50;
ent->client->pers.RPG_StopGripTime=NULL;

		}
		else {
//Invalid throw . no longer gripping or dead
ent->client->pers.RPG_StopGripTime=NULL;
		}
	}

	//RPG MOD ============================== ( Been Thrown )
	if (ent->client->pers.RPG_ThrowTime !=NULL && ent->client->pers.RPG_ThrowTime < level.time) {
//Make sure they are still gripped
//		if(ent->client->ps.fd.forceGripBeingGripped > level.time) {

//Make sure the thrower is still alive and in the BOTH_FORCEGRIP3THROW anim

//FIXME: Work out what direction user is facing, and throw to the left.

ent->client->ps.velocity[0]+=400;
ent->client->ps.velocity[1]+=60;
ent->client->ps.velocity[2]+=300;

/*
//FIX: That Dosent work lol
gentity_t *gripper = &g_entities[ent->client->pers.RPG_Gripper];
vec3_t fwd, tto;
AngleVectors(gripper->client->ps.viewangles, fwd, NULL, NULL);
	tto[0] += fwd[0]+400;
	tto[1] +=60;
	tto[2] += fwd[2]+300;
//---
ent->client->ps.velocity[0]+=tto[0];
ent->client->ps.velocity[2]+=tto[1];
ent->client->ps.velocity[3]+=tto[2];
//---
*/

ent->client->pushEffectTime =level.time+100;

			ent->client->ps.forceHandExtend = HANDEXTEND_KNOCKDOWN;
			ent->client->ps.forceDodgeAnim = 0;
			ent->client->ps.forceHandExtendTime = level.time + 600;
			ent->client->ps.quickerGetup = qfalse;

	G_Sound(ent, CHAN_WEAPON, G_SoundIndex( "sound/weapons/force/push.mp3" ) );
	G_Sound(ent, CHAN_WEAPON, G_SoundIndex( "sound/weapons/force/push.wav" ) );

	ent->client->pers.RPG_ThrowTime=NULL;
	//	}//<< still been gripped

	}
	//===================================

Last edited by GangsterAngel; 08-03-2005 at 08:26 PM.
GangsterAngel is offline   you may: quote & reply,
Old 08-03-2005, 06:30 PM   #2
GangsterAngel
Rookie
 
GangsterAngel's Avatar
 
Join Date: May 2004
Posts: 139
come on , i know some of u out their could help me..eg ,Razor !.. PLEASE! , lol
GangsterAngel is offline   you may: quote & reply,
Old 08-03-2005, 07:09 PM   #3
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
look at debugthrow maybe in g_cmds.c or how the rancor tosses you possibly.

also there is a G_Throw function somewhere if i remember correctly.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-03-2005, 08:25 PM   #4
GangsterAngel
Rookie
 
GangsterAngel's Avatar
 
Join Date: May 2004
Posts: 139
Got it , thanx

Code:
//FIXME: Work out what direction user is facing, and throw to the left. ( FIXED )
vec3_t angs;
vec3_t pushDir;
gentity_t *gripper = &g_entities[ent->client->pers.RPG_Gripper];
VectorCopy( gripper->client->ps.viewangles, angs );
//--Ad abit of randimizeation
angs[YAW] += flrand( 25, 50 );
angs[PITCH] = flrand( -25, -15 );
angs[ROLL] = 210;//120; // + = Left , -= Right
//---------------------------
AngleVectors( angs, pushDir, NULL, NULL );
G_Throw( ent, pushDir, 65 + gripper->client->ps.fd.forcePower);
GangsterAngel is offline   you may: quote & reply,
Old 08-04-2005, 12:54 AM   #5
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,187
Actually [ROLL] is like the motion caused by rocking your head left/right while staring straight forward.

instead I'd do...
Code:
//FIXME: Work out what direction user is facing, and throw to the left. ( FIXED )
vec3_t angs;
vec3_t pushDir;
gentity_t *gripper = &g_entities[ent->client->pers.RPG_Gripper];
VectorCopy( gripper->client->ps.viewangles, angs );
//--Ad abit of randimizeation
angs[YAW] += flrand( 25, 50 );
angs[PITCH] = flrand( -25, -15 );
//---------------------------
//finding the vector pointing to the right of the angles set by angs.
AngleVectors( angs, NULL, pushDir, NULL ); 
//reversing our right vector to make it point left.
VectorScale(pushDir, -1, pushDir);
G_Throw( ent, pushDir, 65 + gripper->client->ps.fd.forcePower);
This way you're actually doing your vector math right instead of winging it.


---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 08-04-2005, 02:18 PM   #6
GangsterAngel
Rookie
 
GangsterAngel's Avatar
 
Join Date: May 2004
Posts: 139
Humm . yeah , thats alot more left.
with my code it was kinda alot fowards and a little left. looked ok though.

but yeah , urs is deffantly alot more left. thanx razor
GangsterAngel is offline   you may: quote & reply,
Old 08-04-2005, 04:05 PM   #7
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,187
My method is using vector math left, which is what I thought you were shooting for.

And you're welcome.


---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,
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 > Facing ?

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 12:44 AM.

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