1) Add a new .void def :
Code: Select all
.void () th_jump; // in defs.qc in an appropriate location.
2) Define the new function in client.qc in the [ PutClientInServer () ] function...near the self.th_die; for example :
Code: Select all
self.th_die = PlayerDie;
self.th_jump = player_jump; // << here
3) Paste the new animation macro set in an appropriate location.
Code: Select all
void () player_jump = [ 85, player_jump1 ]
{
};
void () player_jump1 = [ 86, player_jump2 ]
{
};
void () player_jump2 = [ 87, player_jump3 ]
{
};
void () player_jump3 = [ 66, player_jump4 ]
{
setsize (self, VEC_HULL_MIN, (VEC_HULL_MAX - '1 0 32')); // Adjust hitbox size - optional.
};
void () player_jump4 = [ 66, player_jump5 ]
{
};
void () player_jump5 = [ 86, player_jump6 ]
{
setsize (self, VEC_HULL_MIN, VEC_HULL_MAX); // Reset hitbox size
};
void () player_jump6= [ 85, player_run ] // << was player_stand 1 previously .... change as per leileilol and Frag.machine, looks better
{
};
If you paste at the top of player.qc , you will need to re-declare the player_jump function someplace higher up in the code such as defs.qc by entering :
Code: Select all
void () player_jump;
4) Lastly, place the call to the new macro reference in client.qc in the [ PlayerJump() ] function:
Code: Select all
self.flags = (self.flags - FL_ONGROUND);
self.th_jump (); // <<< here
Code: Select all
self.velocity_z = 225;
self.th_jump (); // <<< here
Video of it in action here:
http://youtu.be/aH0b737M-sM