|
"More Fun Than Fragging Monster_Scientist"
|
|
Coding
Barney's Weapon |
|
Coding Barney's Weapon Say you want to change Barney's weapon from the 9mm pistol to a 357. Here's how. Examine this code from Barney.cpp -
This is the line of code that makes him shoot the bullet:
See how BULLET_PLAYER_9MM is Barney's regular bullet?
|
|
Now look in weapons.h, find this code:
The above "typedef enum" is a list of the various types of bullets. Modify Barney.cpp like this, using the bullet type of your choice:
Now he's firing 357 ammo. You might also want to change this line:
Instead of "barney/ba_attack2.wav", substitute the 357 sound. (I don't know the name of the .wav file, you'll have to look it up.) |
|
Rate of fire -- I'm not certain how to set the rate at which Barney fires, but I think it's in here:
Notice this particular line of code:
The value 1.5 indicates number of seconds between shots (I think). The 357 fires slower than the 9mm pistol, so use a value larger than 1.5 to indicate the delay between shots. Having made your changes, compile HL.DLL, put it in the "dlls" directory, and run the game. |
|
Barney Model The standard Barney model uses the 9mm pistol. If you want the Barney model to use a 357 or some other weapon, you'll have to modify the model. For more info, see Models. |
|
Changing
Barney's Weapon
|
|
"Handy
Vandal" and "Handy Vandal's Almanac" copyright 2008 by
Karl Gregory Jones Half-Life © 1998-99 Sierra On-line and Valve L.L.C. All rights reserved. Half-Life and the Half-Life logo are trademarks of Sierra On-Line. Valve and the Valve logo are trademarks of Valve L.L.C. Half-Life images, textures, music, sound effects, and other graphic or audio content © 1998-99 Valve L.L.C. All rights reserved. |