The Simple Questions Thread.

Any aspects of level design for the Source engine.

Re: those simple questions thread...

Postby Zecrah on Fri Apr 09, 2010 8:19 pm

I'd also recommend just going through the options, mainly "2D view" and tweaking them as you want. My favourite is "Snap to 15 degree rotations" or whatever. Never looked back after using that. ^^
Major Banter wrote:Zecrah, you've come from nowhere yet have rapidly become a Hammer God.

Wtf.


Check out my weapons tutorial
Zecrah
Design Section Moderator
 
Joined: Sat Sep 27, 2008 10:56 am

Re: those simple questions thread...

Postby samwalton on Fri Apr 09, 2010 9:02 pm

That worked Zecrah, thanks so much for posting a solution. I can't believe I didn't look there (I already have the 15 degree toggle set in 2d view and just didn't see the 3d tab!) You are awesome.
samwalton
Dumpling
Dumpling
 
Joined: Fri Apr 09, 2010 5:37 pm

Re: those simple questions thread...

Postby jgoodroad on Sat Apr 10, 2010 12:16 am

is there anyway to change the area of a weapons spread via console? I am thinking about the shotgun acting more as a shotgun-rifle (like the kind used in skeet) because it would be awesome...
===[]"

Image
current projects: nmo_boardwalk, nmo_asylum
User avatar
jgoodroad
Senior Member
Senior Member
 
Joined: Thu Apr 09, 2009 4:44 am
Location: on a boat... unless it's a farm.

Re: those simple questions thread...

Postby Smurftyours on Sat Apr 10, 2010 6:19 am

Probable not, but I don't think it would be too big of a code change.
jangalomph wrote:Wise words from a wise man. ^
User avatar
Smurftyours
Senior Member
Senior Member
 
Joined: Tue Aug 04, 2009 6:11 pm
Location: California, US.

Re: those simple questions thread...

Postby Zecrah on Sat Apr 10, 2010 10:24 am

I think it's quite an easier code change indeed. I'll look at it myself later, I had similar intentions.
Major Banter wrote:Zecrah, you've come from nowhere yet have rapidly become a Hammer God.

Wtf.


Check out my weapons tutorial
Zecrah
Design Section Moderator
 
Joined: Sat Sep 27, 2008 10:56 am

Re: those simple questions thread...

Postby joe_rogers_11155 on Sun Apr 11, 2010 2:31 pm

isnt that something you can do by editing the script?

http://developer.valvesoftware.com/wiki/Weapon_script

If you still have an issue, ask me because I have a buddy who is doing the same thing for his mod.
"Day breaks, but decay soon follows." - Ava Winona
Currently developing in radio silence... 99 Bolts
Here's another project of mine... Assault on Overwatch
Are you new to Source SDK? VDC
joe_rogers_11155
Veteran
Veteran
 
Joined: Wed Oct 08, 2008 11:11 pm
Location: United States

Re: those simple questions thread...

Postby Zecrah on Sun Apr 11, 2010 3:12 pm

Nope, as far as I know.

I found the code anyway. I'm presuming you're running the latest Ep2 SP code and using VC++ 2005 Express. You can probably adapt it if you're not.


-Open your project and then open the Server Episodic soluton, expand the "Source files" folder followed by "HL2 DLL."

-Open weapon_shotgun.cpp and go to line 46, which should read something like:

Code: Select all
virtual const Vector& GetBulletSpread( void )

-This is where the bullet spread vector is set, i.e. how accurate the gun is. If you understand the code even a little, you'll see that what Valve have done is given vital allies (E.g. Alyx) a lot more accuracy and the player less. This is visible by the:
Code: Select all
static Vector vitalAllyCone = VECTOR_CONE_3DEGREES;
which sets the vital allies' accuracy vector to 3 degrees.

-Look below and you'll see the player one:
Code: Select all
static Vector cone = VECTOR_CONE_10DEGREES;
This is what you want to change.

-In "basecombatweapon_shared.h" lies the list of predefined vector cones. I'll list them here:
Code: Select all
// NOTE: The way these are calculated is that each component == sin (degrees/2)
#define VECTOR_CONE_PRECALCULATED   vec3_origin
#define VECTOR_CONE_1DEGREES      Vector( 0.00873, 0.00873, 0.00873 )
#define VECTOR_CONE_2DEGREES      Vector( 0.01745, 0.01745, 0.01745 )
#define VECTOR_CONE_3DEGREES      Vector( 0.02618, 0.02618, 0.02618 )
#define VECTOR_CONE_4DEGREES      Vector( 0.03490, 0.03490, 0.03490 )
#define VECTOR_CONE_5DEGREES      Vector( 0.04362, 0.04362, 0.04362 )
#define VECTOR_CONE_6DEGREES      Vector( 0.05234, 0.05234, 0.05234 )
#define VECTOR_CONE_7DEGREES      Vector( 0.06105, 0.06105, 0.06105 )
#define VECTOR_CONE_8DEGREES      Vector( 0.06976, 0.06976, 0.06976 )
#define VECTOR_CONE_9DEGREES      Vector( 0.07846, 0.07846, 0.07846 )
#define VECTOR_CONE_10DEGREES      Vector( 0.08716, 0.08716, 0.08716 )
#define VECTOR_CONE_15DEGREES      Vector( 0.13053, 0.13053, 0.13053 )
#define VECTOR_CONE_20DEGREES      Vector( 0.17365, 0.17365, 0.17365 )


-Valve added a helpful note (For those of us who suck at maths... *ahem*) as to how to calculate your own vectors. Simply change it to however accurate you would like to be. I tested out 3 in my own mod, and it was still good but for a rifle I recommend 2, or for a sniper use 1.

-To make it more rifle like, open up "cfg/skill.cfg" in your mod folder (Extract it if it doesn't exist, make sure it's relevent to your engine branch) and change the constants that end in _buckshot (Around lines 148 for me) to suit.


For the shits and giggles, you could set up a massive pellet count, and a vector cone of about 60 degrees and add a few zeroes to the damage and wreak havoc.
Major Banter wrote:Zecrah, you've come from nowhere yet have rapidly become a Hammer God.

Wtf.


Check out my weapons tutorial
Zecrah
Design Section Moderator
 
Joined: Sat Sep 27, 2008 10:56 am

Re: those simple questions thread...

Postby jgoodroad on Sun Apr 11, 2010 6:00 pm

so, without code,You can change dmg, and you can change pellets (count)but If you want to change the spread you need to use code.
===[]"

Image
current projects: nmo_boardwalk, nmo_asylum
User avatar
jgoodroad
Senior Member
Senior Member
 
Joined: Thu Apr 09, 2009 4:44 am
Location: on a boat... unless it's a farm.

Re: those simple questions thread...

Postby Oskmos on Sun Apr 11, 2010 7:38 pm

Wich is better for making a large slope with displacements:

1. Making brushes that tilts, then "displaceing" them.

2. raising the displacement on flat brushes.

both work just fine i guess, but just wondering if one way is better for performance or whatever :D
User avatar
Oskmos
Regular
Regular
 
Joined: Thu Apr 01, 2010 9:08 pm
Location: Sweden

Re: those simple questions thread...

Postby Zecrah on Sun Apr 11, 2010 7:57 pm

jgoodroad wrote:so, without code,You can change dmg, and you can change pellets (count)but If you want to change the spread you need to use code.


Yes.


Oskmos wrote:Wich is better for making a large slope with displacements:

1. Making brushes that tilts, then "displaceing" them.

2. raising the displacement on flat brushes.

both work just fine i guess, but just wondering if one way is better for performance or whatever :D


Both the same. Personally, I'd do number 1, but I think for performance there's no difference. Except that sewing and aligning may be harder.
Major Banter wrote:Zecrah, you've come from nowhere yet have rapidly become a Hammer God.

Wtf.


Check out my weapons tutorial
Zecrah
Design Section Moderator
 
Joined: Sat Sep 27, 2008 10:56 am

Re: those simple questions thread...

Postby Terr on Sun Apr 11, 2010 9:06 pm

Oskmos wrote:1. Making brushes that tilts, then "displaceing" them.
2. raising the displacement on flat brushes.


The choice will largely be decided on whether you need to sew any displacements together. If so, I'd go with #1, so that all the edges are nice.
Terr
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Mon Oct 12, 2009 11:35 pm

Re: those simple questions thread...

Postby Zecrah on Sun Apr 11, 2010 10:27 pm

Also, jgoodroad, I posted a tutorial just for you. xD Well not just for you, but you inspired it :d
Major Banter wrote:Zecrah, you've come from nowhere yet have rapidly become a Hammer God.

Wtf.


Check out my weapons tutorial
Zecrah
Design Section Moderator
 
Joined: Sat Sep 27, 2008 10:56 am

Re: those simple questions thread...

Postby samwalton on Sun Apr 11, 2010 11:13 pm

Some of the materials have a shininess attribute to them, requiring the use of an environment map. The thing is that there are some similar materials that don't have this attribute (like roads and plaster walls). Is there an easy way (a flag) to disable or enable this?
samwalton
Dumpling
Dumpling
 
Joined: Fri Apr 09, 2010 5:37 pm

Re: those simple questions thread...

Postby Zecrah on Sun Apr 11, 2010 11:33 pm

I believe you're talking about specular reflections. These are quite easy to disable, I think it's just a case of removing the envmap key from the material file.

So open the material of the file you want to change (the .VMT) and find the key called $envmap. Remove or comment it out and it'll stop creating specular reflections. The reason plaster doesn't have it is because, well it isn't reflective. ^^ Likewise, to enable it, add the line $envmap env_cubemap to the VMT to tell it to create specular reflections using an environment map from the nearest env_cubemap entity.

See the link below for more info
http://developer.valvesoftware.com/wiki/$envmap
Major Banter wrote:Zecrah, you've come from nowhere yet have rapidly become a Hammer God.

Wtf.


Check out my weapons tutorial
Zecrah
Design Section Moderator
 
Joined: Sat Sep 27, 2008 10:56 am

Re: those simple questions thread...

Postby samwalton on Sun Apr 11, 2010 11:49 pm

Thanks! I'm creating a wet environment, where I would want specular highlights even on plaster. There are some road materials that have it and don't which was bugging me. Thanks again for the info mate!
samwalton
Dumpling
Dumpling
 
Joined: Fri Apr 09, 2010 5:37 pm
PreviousNext

Return to Hammer Editor Help

Who is online

Users browsing this forum: No registered users