News: SMF - Just Installed!
 
Welcome, Guest. Please login or register.
+  AnthraxBio
|-+  Return to Castle Wolfenstein
| |-+  Coding Tutorials
| | |-+  Wolf Kick
« previous next »
Pages: [1] Print
Author Topic: Wolf Kick  (Read 338 times)
SkreamerVirii
Administrator
Full Member
*****
Posts: 133


View Profile
« on: September 03, 2008, 11:01:54 PM »

I Rhino didnt write this tutorial Mike Did
Were going to be showing you how to enbale the wolfkick from singleplayer


Go in g_active.c and find
// Rafael wolfkick
//int validkick;
//static int wolfkicktimer = 0;
client = ent->client;
change to
// Rafael wolfkick
int validkick;
static int wolfkicktimer = 0;
ok now in g_active.c find
// server cursor hints
if ( ent->lastHintCheckTime < level.time ) {
G_CheckForCursorHints(ent);

ent->lastHintCheckTime = level.time + FRAMETIME;
}
change it to this
// server cursor hints
if ( ent->lastHintCheckTime < level.time ) {
G_CheckForCursorHints(ent);
// =====code out of the (Single Player) code=======
// Rafael Kick
if (ucmd->wolfkick && ent->health > 0)
{
validkick = Cmd_WolfKick_f (ent);
if (validkick)
wolfkicktimer = level.time + 1000;
}

if (ent->client->ps.persistant[PERS_WOLFKICK] && !ent->melee && !(ent->active))
{
if (wolfkicktimer < level.time)
ent->client->ps.persistant[PERS_WOLFKICK] = 0;
else
{
ent->client->ps.persistant[PERS_WOLFKICK] = (int) (22 - ((wolfkicktimer - level.time) / 50));
if (ent->client->ps.persistant[PERS_WOLFKICK] > Cool
ent->client->ps.persistant[PERS_WOLFKICK] = 0;
}
}
else if (ent->melee)
{
if (wolfkicktimer > level.time)
{
ent->client->ps.persistant[PERS_WOLFKICK] = 0;
if (ent->health <= 0) {
ent->melee = NULL;
ent->client->ps.eFlags &= ~EF_MELEE_ACTIVE;
} else {
ent->melee->s.density = (int) (22 - ((wolfkicktimer - level.time) / 50));
if (ent->melee->s.density > 12)
ent->melee->s.density = 1;
}
}
else
ent->melee->s.density = 1;
}
//end
ent->lastHintCheckTime = level.time + FRAMETIME;
}

Now go to g_cmds.c i won't copy all the code belong to this its to big now find

// Rafael WolfKick
//===================
// Cmd_WolfKick
//===================
#define WOLFKICKDISTANCE 96
int Cmd_WolfKick_f (gentity_t *ent)
{
trace_t tr;
vec3_t end;
gentity_t *traceEnt;
vec3_t forward, right, up, offset;
gentity_t *tent;
static int oldkicktime = 0;
int kicktime = level.time;
qboolean solidKick = qfalse; // don't play "hit" sound on a trigger unless it's an func_invisible_user

int damage = 15;
// DHM - Nerve :: No kick in wolf multiplayer
if ( g_gametype.integer >= GT_WOLF )
return 0;
if(ent->client->ps.leanf)
return 0; // no kick when leaning
if (oldkicktime > kicktime)
return (0);
else
oldkicktime = kicktime + 1000;
// play the anim

Comment this like so

// Rafael WolfKick
//===================
// Cmd_WolfKick
//===================
#define WOLFKICKDISTANCE 96
int Cmd_WolfKick_f (gentity_t *ent)
{
trace_t tr;
vec3_t end;
gentity_t *traceEnt;
vec3_t forward, right, up, offset;
gentity_t *tent;
static int oldkicktime = 0;
int kicktime = level.time;
qboolean solidKick = qfalse; // don't play "hit" sound on a trigger unless it's an func_invisible_user

int damage = 15;
// DHM - Nerve :: No kick in wolf multiplayer
//if ( g_gametype.integer >= GT_WOLF )
// return 0;
if(ent->client->ps.leanf) // if you want to kick when you are leaning you can block it o
return 0; // no kick when leaning
if (oldkicktime > kicktime)
return (0);
else
oldkicktime = kicktime + 1000;
// play the anim

Now go to cg_weapons.c find

//wolfkickModel = trap_R_RegisterModel( "models/weapons2/foot/v_wolfoot_10f.md3" );
hWeaponSnd = trap_S_RegisterSound("sound/weapons/mg42/37mm.wav");
hWeaponEchoSnd = trap_S_RegisterSound("sound/multiplayer/mg42_far.wav"); // JPW NERVE for mg42 echo
//hflakWeaponSnd = trap_S_RegisterSound ("sound/weapons/flak/flak.wav");

Change to
wolfkickModel = trap_R_RegisterModel( "models/weapons2/foot/v_wolfoot_10f.md3" );
hWeaponSnd = trap_S_RegisterSound("sound/weapons/mg42/37mm.wav");
hWeaponEchoSnd = trap_S_RegisterSound("sound/multiplayer/mg42_far.wav"); // JPW NERVE for mg42 echo
hflakWeaponSnd = trap_S_RegisterSound ("sound/weapons/flak/flak.wav");

Now open cg_main.c find

/* JPW NERVE kick pulled from MP to prevent bind cheats
cgs.media.fkickwall = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav" );
cgs.media.fkickflesh = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav" );
cgs.media.fkickmiss = trap_S_RegisterSound( "sound/weapons/melee/fstmiss.wav" );
*/

change to
//JPW NERVE kick pulled from MP to prevent bind cheats
cgs.media.fkickwall = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav" );
cgs.media.fkickflesh = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav" );
cgs.media.fkickmiss = trap_S_RegisterSound( "sound/weapons/melee/fstmiss.wav" );
ok now in cg_main.c find

/* JPW NERVE -- kick pulled from MP (cheat issues)
trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav" );
trap_S_RegisterSound( "sound/weapons/melee/fstmiss.wav" );
trap_S_RegisterSound( "sound/Loogie/spit.wav" );
trap_S_RegisterSound( "sound/Loogie/sizzle.wav" );
*/

change to
//JPW NERVE -- kick pulled from MP (cheat issues)
trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav" );
trap_S_RegisterSound( "sound/weapons/melee/fstmiss.wav" );
// trap_S_RegisterSound( "sound/Loogie/spit.wav" );
// trap_S_RegisterSound( "sound/Loogie/sizzle.wav" );
now compile see if it work for you if not ill send you the source!!!!
..mike..
Now bind a key to kick like so
/bind w +kick
this is what Mike said
go in Wolfenstein folder open your wolfconfig_mp.cfg with notepad
find bind f "+activate" put this on the bottom of it bind g "+kick"

change g to what you want to use let me know if that help

You can all thank Mike For this tutorial
« Last Edit: September 03, 2008, 11:29:10 PM by SkreamerVirii » Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Free SMF 1.1.5 Forum Theme by Tamuril. © 2008.