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


View Profile
« on: September 03, 2008, 11:20:45 PM »

In this tutorial i will be showing you how to add addtional weapons to both classes in the mp version of the game i will be focusing on the enginner because wlli think this guy has potential

i will adding the venom to his list of main weapons its not choosable in any menus
but when you hit the 3 key on your keyboard a second time the venom will appear as ione of your weapons
this isnt anything fancy it just adds a little variety in the gameplay
So lets get started
g_clients.c
and go to around line 790
and find this part of the code
// Engineer gets dynamite
if ( pc == PC_ENGINEER ) {
COM_BitSet( client->ps.weapons, WP_DYNAMITE );
client->ps.ammo[BG_FindAmmoForWeapon(WP_DYNAMITE)] = 0;
client->ps.ammoclip[BG_FindClipForWeapon(WP_DYNAMITE)] = 1;
// NERVE - SMF
COM_BitSet( client->ps.weapons, WP_PLIERS);
client->ps.ammoclip[BG_FindClipForWeapon(WP_PLIERS)] = 1;
client->ps.ammo[WP_PLIERS] = 1;
}
now make it look like this
// Engineer gets dynamite
if ( pc == PC_ENGINEER ) {
COM_BitSet( client->ps.weapons, WP_DYNAMITE );
client->ps.ammo[BG_FindAmmoForWeapon(WP_DYNAMITE)] = 0;
client->ps.ammoclip[BG_FindClipForWeapon(WP_DYNAMITE)] = 1;
// NERVE - SMF
COM_BitSet( client->ps.weapons, WP_PLIERS);
client->ps.ammoclip[BG_FindClipForWeapon(WP_PLIERS)] = 1;
client->ps.ammo[WP_PLIERS] = 1;

COM_BitSet( client->ps.weapons, WP_VENOM );
client->ps.ammoclip[BG_FindAmmoForWeapon(WP_VENOM)] = 200;
client->ps.weapon = WP_VENOM;
}
Any 2 handed weapons will be assigned to the 3 key
So now you know how to blow things up give yourself addtional weapons and ammo
In the next tutorial i will show you how to give yourself a scuba suit

« Last Edit: September 03, 2008, 11:22:52 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.