|
|
#1 |
![]() Join Date: Nov 2011
Reputation: 0
Posts: 11
|
Weapon Questions
Because I'm tired and feel bad about posting so many threads here, I'll just ask my three questions in one post, since they all relate to weapons. (This should keep me busy a while).
1) How do I make a new tracer? I added my bullet type to the hl2mp_gamerules list, but it still says it's undefined. Furthermore, I tell defined ammo types to have tracers (be they line, beam, etc.) and I see nothing. Where is the tracer info that I'm missing? The documentation is very poor on tracers. 2) Can somebody point me to documentation on secondary attacks? I can't figure it out either. Specifically, I want to add a melee secondary (like in L4D), but don't have the L4D weapon CPPs to look at. 3) Finally, does anyone have tips, or even the files I should look in for implementing weapon unlocks and configurable loadouts (like TF2 uses)? I know, I'm shooting high for this being a first project, but as the saying goes "shoot for the stars and you'll at least reach the Moon." This will hopefully be the last question I ask for a while, if I can figure these things out. Thanks! |
|
|
|
|
|
#2 |
![]() Join Date: Dec 2008
Reputation: 4
Posts: 42
|
For #2 look at the crowbar files
|
|
|
|
|
|
#3 |
![]() Join Date: Nov 2011
Reputation: 0
Posts: 11
|
Yeah, I did look at those some, but how would I go about implementing it as a secondary attack, instead of declaring the whole weapon as melee?
|
|
|
|
|
|
#4 |
![]() Join Date: Aug 2007
Reputation: 9
Posts: 555
|
I would try this in the ItemPostFrame function of your weapon:
Code:
/*
-------------------------------------------
♥♥♥♥♥ slapping code
-------------------------------------------
*/
if (pOwner->m_nButtons & IN_ATTACK2)
{
SlapThat♥♥♥♥♥();
}
This is only the basic code that detects when you press ATTACK2. Then you would have to fill the brackets with the melee stuff. |
|
|
|
|
|
#5 | |
![]() Join Date: Mar 2012
Reputation: 204
Posts: 895
|
Quote:
1. Not sure haven't tried. 2. Already replied, by replying to frostcat 3. Start with inventory, if you need one, then a new base weapon class, so it would read the scripts from a single file, or multiple. This way you won't have to create a new entity for every single weapon you add. I've done similar thing for my item inventory, but instead of weapons with stats the script file contains data, model, name and other requirements. This way you save time. For example my script file looks like this: Code:
// The name of item branch must me unique numeric value, should never be under 1
// 0 - determines NULL item model
//----------------------------------
// INFO ABOUT KEYVALUES
//----------------------------------
// MUST EXIST:
// Model
// Modelname - model name
// Spotlight - should be 1
// anglex_x,y,z - angle in model panel
// origin_x,y,z - origin in model panel
//
// OTHERS:
// Name - Item name || Def. ("unknown")
// Sound - Sound when used, etc..
// Type - Item type || Def. (0)
// Value - Extra info, effect depends on item type || Def. (0)
// NoFlame - Makes item non-flamable
//----------------------------------
"ItemList"
{
0
{
Name "#Inventory_empty"
"Model"
{
"Modelname" "models/items/flare.mdl"
}
}
1
{
Name "Wood"
Type "0"
"Model"
{
"Modelname" "models/props_debris/wood_chunk03b.mdl"
"spotlight" "1"
"angles_z" "65"
"origin_x" "80"
}
}
2
{
Name "Plank"
Type "0"
"Model"
{
"modelname" "models/props_debris/wood_board06a.mdl"
"spotlight" "1"
"angles_z" "65"
"origin_x" "55"
}
}
3
{
Name "Fence"
Type "1"
Value "500"
"Model"
{
"modelname" "models/props_wasteland/wood_fence01a.mdl"
"spotlight" "1"
"angles_y" "90"
"origin_x" "125"
}
}
4
{
Name "Melon"
Type "2"
"Value"
{
Hunger "75"
Thirst "250"
Rest "-5"
}
"Model"
{
"modelname" "models/props_junk/watermelon01.mdl"
"spotlight" "1"
"origin_x" "20"
}
}
}
|
|
|
|
|
|
|
#6 |
![]() Join Date: Nov 2011
Reputation: 0
Posts: 11
|
Thanks! Looks like a lot of work, a lot of learning, and a lot of trial, error, error, and more error in store for me :P
|
|
|
|
|
|
#7 | |
![]() Join Date: Aug 2007
Reputation: 9
Posts: 555
|
Quote:
|
|
|
|
|
|
|
#8 |
![]() Join Date: Mar 2012
Reputation: 204
Posts: 895
|
|
|
|
|
|
|
#9 |
![]() Join Date: Oct 2011
Reputation: 2
Posts: 160
|
Hacky you say... I would use that method! Maybe only a few times in the entir project, but it's ok if it's only a few times...
|
|
|
|
|
|
#10 | |
![]() Join Date: Aug 2007
Reputation: 9
Posts: 555
|
Quote:
|
|
|
|
|
|
|
#11 | |
![]() Join Date: Mar 2012
Reputation: 204
Posts: 895
|
Quote:
Maybe hackish is not the right word, but it's definetly a bad practice if you're thinking few steps ahead. I mean why would you need to worry about what is in baseclass, that's the beauty of OOP. Last edited by durrchet: 07-12-2012 at 01:03 PM. |
|
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|