Jump to content

Home

From Jet To Flight


D-style

Recommended Posts

ya i deleted the previous thread cuz it was messy..

neways 1st thing i did was add a fly type movement in bg_public.h

typedef enum {
PM_NORMAL,		// can accelerate and turn
PM_JETPACK,		// special jetpack movement
PM_FLOAT,		// float with no gravity in general direction of velocity (intended for gripping)
PM_NOCLIP,		// noclip movement
PM_SPECTATOR,	// still run into walls
PM_DEAD,		// no acceleration or turning, but free falling
PM_FREEZE,		// stuck in place with no control
PM_INTERMISSION,	// no movement or status bar
PM_SPINTERMISSION	// no movement or status bar
PM_FLY		//Flightmode by *Shady-D*
} pmtype_t;

 

The second thing i did was animate some flying animations for it and adding them in animtable.h and anims.h

than i copied some of the JP code and made the animations work with the PM_FLY

in bg_pmove.c

	//If we are flying, play anims
if (pm->ps->pm_type == PM_FLY)
{
	if (pm->cmd.rightmove > 0)
	{
		PM_ContinueLegsAnim(BOTH_FLY_RIGHT);
	}
	else if (pm->cmd.rightmove < 0)
	{
           PM_ContinueLegsAnim(BOTH_FLY_LEFT);
	}
	else if (pm->cmd.forwardmove > 0)
	{
		PM_ContinueLegsAnim(BOTH_FLY_FORWARD);
	}
	else if (pm->cmd.forwardmove < 0)
	{
		PM_ContinueLegsAnim(BOTH_FLY_BACKWARDS);
	}
	else
	{
		PM_ContinueLegsAnim(BOTH_FLY_IDLE);
	}

 

and now.. what do i do now? :p

Help me achieve my goal and receive a free COOKIE! :smash:

 

[edit]

well ensiform coded a console cmd for me.. i tried to compile and got 3 errors

c:\jkasdk\codemp\game\bg_pmove.c(11187) : error C2143: syntax error : missing ';' before 'type'
c:\jkasdk\codemp\game\bg_pmove.c(11190) : error C2065: 'finalTime' : undeclared identifier
g_active.c
c:\jkasdk\codemp\game\g_active.c(2174) : error C2065: 'PM_FlyMove' : undeclared identifier

 

i dun get it

Link to comment
Share on other sites

c:\jkasdk\codemp\game\bg_pmove.c(11187) : error C2143: syntax error : missing ';' before 'type'

 

Is saying you have a new line without using a ";" where you should have.

 

c:\jkasdk\codemp\game\bg_pmove.c(11190) : error C2065: 'finalTime' : undeclared identifier

g_active.c

 

is saying you have not defined "finalTime"

( int finalTime ) ( Case sensitive )

 

g_active.c

c:\jkasdk\codemp\game\g_active.c(2174) : error C2065: 'PM_FlyMove' : undeclared identifier

 

you did not call it "PM_FlyMove" in bg_public.h , you called it "PM_Fly"

or if PM_Fly is a Void , you have not included it in g_active.c

Link to comment
Share on other sites

/*
===================
PM_FlyMove

Only with the flight powerup
===================
*/
static void PM_FlyMove( void ) {
int		i;
vec3_t	wishvel;
float	wishspeed;
vec3_t	wishdir;
float	scale;

// normal slowdown
PM_Friction ();

scale = PM_CmdScale( &pm->cmd );

if ( pm->ps->pm_type == PM_SPECTATOR && pm->cmd.buttons & BUTTON_ALT_ATTACK) {
	//turbo boost
	scale *= 10;
}

//
// user intentions
//
if ( !scale ) {
	wishvel[0] = 0;
	wishvel[1] = 0;
	wishvel[2] = pm->ps->speed * (pm->cmd.upmove/127.0f);
} else {
	for (i=0 ; i<3 ; i++) {
		wishvel[i] = scale * pml.forward[i]*pm->cmd.forwardmove + scale * pml.right[i]*pm->cmd.rightmove;
	}

	wishvel[2] += scale * pm->cmd.upmove;
}

VectorCopy (wishvel, wishdir);
wishspeed = VectorNormalize(wishdir);

PM_Accelerate (wishdir, wishspeed, pm_flyaccelerate);

PM_StepSlideMove( qfalse );
}

 

heres the PM_FlyMove i want it to include while using my anims..

Link to comment
Share on other sites

c:\jkasdk\codemp\game\bg_pmove.c(3021) : error C2373: 'PM_FlyMove' : redefinition; different type modifiers

c:\jkasdk\codemp\game\bg_public.h(371) : see declaration of 'PM_FlyMove'

c:\jkasdk\codemp\game\bg_pmove.c(10675) : error C2063: 'PM_FlyMove' : not a function

c:\jkasdk\codemp\game\bg_pmove.c(11053) : error C2063: 'PM_FlyMove' : not a function

c:\jkasdk\codemp\game\bg_pmove.c(11187) : error C2143: syntax error : missing ';' before 'type'

c:\jkasdk\codemp\game\bg_pmove.c(11190) : error C2065: 'finalTime' : undeclared identifier

g_active.c

c:\jkasdk\codemp\game\g_active.c(9) : error C2061: syntax error : identifier 'PM_FlyMove'

c:\jkasdk\codemp\game\g_active.c(9) : error C2059: syntax error : ';'

c:\jkasdk\codemp\game\g_active.c(9) : error C2059: syntax error : 'type'

 

maybe i should get back to try and edit the JP again...

 

lemme just explain what i wanna do.. Go in spectator mode.. lovely huh? flying around like that? Well i want to make it so you can fly exactly like that with the exception that u can turn it off and go trhough doors and see your own player model lol.. *sighs*

Link to comment
Share on other sites

I think he means he wants it to work like the noclip. But he doesnt want to be able to fly through solid walls. And he wants it to work when the player types in a command or gets a powerup or something like that. But copying the noclip stuff would probably help, just edit the part that allows you to fly through walls.

Link to comment
Share on other sites

yeah tried that was buggy as hell.. (well i didnt try but Ben did a good coder)

very buggy you could go halfway trough walls and floors and stay stuck in there, and also instead of flying like in noclip the camera shaked like when u went in a elevator in jk2 remember?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...