.qc (dot qc) - the group for quake c coders of all denominations. If you make quake one mods and write code in quake c, join our group! I'll try to answer any quake c questions - please post your inquiry in the forums...

Forum Thread
  Posts  
New player jump frames reusing old ones. (Groups : qc : Forum : hard_code() : New player jump frames reusing old ones.) Locked
Thread Options
Dec 6 2015 Anchor

This came out pretty nice if I must say so myself. Posted a while ago on another forum but cant find it. Basically we reuse the frames already in player.mdl and make a new realistic looking jump animation that can be called from the existing player_jump () function. Or as I have done, for more flexibility, I created a new .void called: .th_jump which points to this new sequence. Also this does not look too bad when put into FL_WATERJUMP either, and its simple to put it there.

Here is the main new animaiton sequence, its done not using the Frame Macro stuff which in some cases winds up being more flexable depending on what you intend to do.

void () player_jump6 =
{

 self.frame = 85;
self.think = player_run;
self.nextthink = time + 0.15;
 

//player_run ();
};
void () player_jump5 =
{

 self.frame = 86;
 self.think = player_jump6;
 self.nextthink = time + 0.1;
};
void () player_jump4 =
{

 self.frame = 66;
 self.think = player_jump5;
 self.nextthink = time + 0.1;
};

void () player_jump3 =
{

 self.frame = 66;
 self.think = player_jump4;
 self.nextthink = time + 0.1;
};

void () player_jump2 =
{

 self.frame = 87;
 self.think = player_jump3;
 self.nextthink = time + 0.1;
};
void () player_jump1 =
{

 self.frame = 86;
 self.think = player_jump2;
 self.nextthink = time + 0.1;
};

void () player_jump =
{

 self.frame = 85;
 self.think = player_jump1;
 self.nextthink = time + 0.1;
};

Thats it. Simple, and uses no new models other than what Quake / QW originally came with. I have made a video of it in action:




numbersix
numbersix quake-c coder++
Dec 11 2015 Anchor

I'll have to throw this in some time, slow down the action and watch the frame seq.

I need to do that with some of my new animation sets anyway.

I took various frames and coded up a pistol firing seq. Vanilla had no pistol, but I added a couple with some of my mods.
I've been looking for something to include the deepsleep gun with.

The deal with the original macro is - it eliminates this bit of typing every time its used:

{
	self.frame = 85;
	self.think = player_jump1;
	self.nextthink = time + 0.1;
};

You just have:

void() player_jump = [85, player_jump1 ] { };

That compiles the exact same code. Or so we are told.
I'd like to modify fteqcc to output the actual code compiled.

Edited by: numbersix

--

\|/
-*- Support free code: Patreon.com
/|\

Dec 12 2015 Anchor




void() player_jump = [85, player_jump1 ] { };


Yea, that shortens it up a bit. The only difference is that, I believe the nextthink is not gonna be 0.1 , rather it will be the default I think framerate or systicrate, also known as the constant "frametime" in QC...at least for that frame.

Kool you got a pistol. In my Tekbot mod I have a player_f (female) model someone made a long while back. Shes got a big pistol , holds with 2 hands, looks pretty good, however no pistol v_models out there where you see 2 hands on 1 gun. I found one that has one pistol in each hand, and the v_model flips the guns around like in an old western movie, but not exactly what I was looking for.

numbersix
numbersix quake-c coder++
Dec 12 2015 Anchor

You can modify the parms set by the macro:

void() player_jump = [85, player_jump1 ]
{
	self.nextthink = time + 0.2;
	self.frame = 87;
};

How about that...tabs. They used an html pre tag. I thought I tried that once and it didnt work.

Anyway, the macro sets its values and then runs the code. So the code in braces runs last.

--

\|/
-*- Support free code: Patreon.com
/|\

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.