Archive for the ‘Counter-Strike: Global Offensive – SDK’ Category

In this post I will teach you how to turn an image file such as (.jpg, .bmp, .png) into a texture which then can be used in CS:GOs Hammer Editor.

Hammer editor takes texture files as .vtf and .vmt.

VTF (Valve Texture Format) – Is the proprietary texture format used by the Source engine. VTF files are generally referenced in a Material instead of being accessed directly, which allows re-use in different ways.

VMT (Valve Material Type) – Is a text file that defines a two-dimensional surface. It contains all of the information needed for Source to simulate the surface visually, aurally, and physically.

So it works as VTF the texture and VMT is the information that hammer needs to use that texture.

So for the purpose of this post you will need two things;

1- Converter (VTFEditor)

This will use to convert image into .vmt and .vft files. The converter that you will be required to use can be found Here (vtfedit125-11 Archive Version). If link does not work then download it from here.

Open the zip file and extract the files within it. (I use WinRAR to open zip files, if you don’t have it download it here: WinRAR). There will be the files within vtfedit125-11;

vtfeditor

Double click the vtfedit application to open it and under optiosn tab make sure that ‘Auto Create VMT file’ is selected.

vtfeditor1

Now you have that done we move on to selecting image.

 

2- Image file (.jpg, .png ..etc)

Note: Source engine requires images dimensions to be of power of two (64×64, 128×128, 1024×1024, 128×512 256×1024 …etc).

I have created an image that is 128×128 (Right click the image and ‘Save image as..’ if you want it);

RedSteel

 

Converting Image File

Now that we have converter downloaded and have the image that we want to convert, we move on now to creating the vmt and vtf files.

Open up vtfeditor, under File tab select Import

import

A Dialog box will open, here you will search for the image file that you want to import in the software. When you find it double click it to select it. After selecting it another a ‘VTF Options’ window will show, leave everything and just press OK.

vtfoptions

Now you will reach to this stage

vtfeditorred

All is left to do is name and save it at the appropriate file location. Hit file table and click ‘Save’ or ‘Save As’. A dialog box will show, give the file a name and save it in the game materials folder. Here;

C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\materials

savesteel

All you need to do now is check if the information in the .vmt file is correct. Select and right click the file, and click on ‘Open With’. (If you don’t see ‘Open With’ then double click it and select option ‘Select a program from a list of installed programs. Select Notepad and deselect ‘Always use the selected program to open this kind of file’) This is how vmt file will show;

vmt

If you plan to save them in a custom sub folder, then make sure you add sub folders name before the texture in vmt file. Like so “$basetexture” “CustomTexture/RedSteel”. If not then leave it as it is.

Note: Make sure that they both in the materials folder.

 

Testing the Texture in Editor and in game

Now that you have the texture, launch CS:GO hammer editor. Select the browse button located on right side of the editor to open the ‘Textures’ window. Filter for name of the texture (mine is RedSteel)

ingame

Apply it on to an block and then Compile and Run the game to test it in-game.

2014-05-10_00001

In this post I will teach you how to add and config a few other entities, such as;

  • env_shooter, which I’ll use to create a dispenser that gives out drinks.
  • env_shake, to create an earthquake effect.
  • env_steam, to add detail to damaged pipes.
  • chicken, add a few chickens into the level, why not?

entities

R-L

env_shooter – is a point entity available in all Source games. It shoots giblets out of its origin. These gibs can be either models or sprites.

env_shake – is a point entity available in all Source games. It controls screen shakes on players. With this entity you can simulate tremors (earthquakes, blast waves, passing vehicles).

env_steam – is a point entity available in all Source games. It is used to create a jet of steam or heat wave distortion.

chicken – Chicken is a chicken.

 

env_shooter (Dispenser)

shootericon

To do this I will need; env_shooter and prop (preferred prop_dynamic).

Select the Entity Tool and use Objects dropdownlist to find prop_dynamic then left click in the level to add it. Double click the entity to open its properties. Open the Model Browser by selecting World Model and clicking browse. Select the vending machine model (vending_machine.mdl), then hit OK. Hit apply and close when finished (Reposition if necessary)

Select the Entity Tools again and filter this time for env_shooter and add it to your level. Reposition it to where the you want the giblets to come out from the bottom of the vending machine.

shooter

Double click the env_shooter entity to open its properties. You will notice it has a lot of properties that you can set. Here a few of the important ones;

env_shooter

 

  • Gib Direction – The direction the gibs will fly.
  • Gib Angle – The orientation of the spawned gibs.
  • Gib Life – Time in seconds for gibs to live +/- 5%.
  • Gib Velocity – Speed of the fired gibs.
  • Number of Gibs – Total number of gibs to shoot each time it’s activated.
  • Model – Thing to shoot out. Can be a .mdl or a .vmt.
  • Simulate – Type of Model it will shoot it.
  • Delay Between Shots – Delay (in seconds) between shooting each gib. If 0, all gibs shoot at once.

For the purpose of this post, I will set a few changes to these properties to allow bottles to shoot out from the vending machine.

  • Start with the model. Select the Model property and hit browse button to open the Model Browser. Filter for bottle and select water bottle (water_bottle.mdl). Hit OK to apply it.
  • Set the Simulate to be physics, as we want the bottle to have physics properties.
  • Set number of gibs to be one, as we want one bottle at a time.
  • Leave the Delay Between Shot at zero and Gib Velocity at 200 (The larger the value the further and fast it will go out).
  • For Gib life is optional, as it relays on how long you want bottle to say in the level. I’m going with 100.
  • Gib Angle 90 0 0. It will shoot the bottle side ways.
  • Use  Top view port to config Gib Direction.

shooter1

 

Lastly click the Flag tab and enable the repeatable setting to allow you use the env_shooter more than once.

Now that you have done that you will need to add a button to the machine to shoot out the bottle. I am sure you able to do that by now (hint create a brush with the invisible texture and tie it to button entity. In the Output tab set the Via this input to shoot).

Compile and run the map to test it.

 

env_shake (earthquake)

earth

Select the Entity Tools and Filter for env_Shake in the Objects dropdownlist. Left click to add to the level, then double click the entity to open its properties.

earth2

Properties are;

  • Amplitude – The amount of noise in the screen shake. Should be a range between 0 and 16.
  • Effect Radius – The radius around this entity in which to affect players.
  • Duration – The length of time in which to shake the player’s screens.
  • Frequency – The frequency used to apply the screen shake. Should be a value between 0 and 255, where 0.1 = jerk, and 255.0 = rumble.

Flags setting are;

  • GlobalShake – Shaking occurs throughout the entire map.
  • In Air – Objects in the air are affected by the shaking.
  • Physics – Shake physical objects to create realistic feel.
  • Ropes –  Shakes ropes.
  • Don’t shake view – Doesn’t shake players view.

 

This entity requires some testing to figure out the right property values. I have create two, each connected to a button to test the difference in-game

1- Default Amplitude and Frequency, but increase duration to notice the affect.

shake2

2- Increased the Amplitude 10, set the frequency to 180 with duration 10.

shake1

Attach these to button so that they can be triggered when used activates them. Compile and run the game.

 

env_steam (pipes)

steamicon

Select the Entity Tools and search for env_steam in the objects dropdownlist. Left click in the level to add it. Double click the Entity to display its properties.

steamprop

Properties are;

  • Initial State – Option if starts enabled.
  • Particle Type – Steam effect type. There are two; normal or heatwave. Steam effect type,
  • Spread Speed -The amount of random spread in the particle’s velocity after they spawn.
  • Speed – The default speed at which the particles move after they spawn.
  • Particle Start Size – The initial size of the particles after they spawn.
  • Particle end Size – The size of the particles at the point at which they are removed.
  • Emission Rate – The rate of particle emission. i.e. particles per second.
  • Color – Steam colour, only used if emissive flag is set.
  • Length of stream jet – The length of the jet determines the lifetime of each particle.
  • Translucency – Render alpha value.
  • Pitch Yaw Roll (X Y Z) – This entity’s orientation in the world.

Flag settings;

  • Emissive – Provides colour to the steam.

Will create three env_steam entities with different properties;

1- Initial state on, pointing up with Emissive setting selected to give white colour.

steam1

2- Initial state on, pointing up, particle speed 40, end size 30, 30 emission rate and coloured green (need to make sure Emissive is selected to activate the colour)

steam2

3- Initial state on, point up, but type is set to heatwave (It will not show steam but a heatwave)

steam3

Compile and run the game to view them in-game.

 

Chickens (bwak)

chicken1

This entity is very simple to add. Select the Entity Tools and add an entity to your level. Double click the entity to open its properties.  Type in the Class dropdownlist Chicken and hit enter. The entity should change to look like the image above. This entity has no properties.

chicken

Nothing else to do. Compile and run the map.

 

Video 

In this post I will teach you how to add and configure four env entities;

env_fire – is a point entity available in all Source games. It handles a single flame at its origin. The flame causes heat ‘damage’ to other env_fire entities around it, and will eventually ignite non-flaming env_fire entities nearby causing fire to spread.

env_explosion – is a point entity available in all Source games. It creates and exposition  at its origin. To create an invisible explication that moves objects that moves objects within a radius use env_phyexplosion.

env_spark – is a point entity available in all Source games. It is used to create sparks at its origin.

env_laser –  is a point entity available in all Source games. It creates a laser beam between itself and a given target.

env

Select the Entity tools and filter in the objects dropdownlist in the bottom right side of the hammer editor for the appropriate env entity. Left click in the world to add that entity. After you have added the entity double click the it to open it.

1- env_fire

env2

fire1

Properties are;

  • Duration – Amount of time the fire will burn.
  • Size – Height (in world units) of the flame.
  • Attack – Amount of time the fire takes to grow to full strength.
  • Type – Either Natural or Plasma. Natural is a general all purpose flame, like wood fire.
  • Damage Scale – Multiplier of the burn damage done by the flame.
  • Ignition Point – Amount of heat ‘damage’ to take before this flame should ignite.

As well as these properties you are able to set certain settings, they can be found under the Flag tab;

  • Infinite Duration – This will set the fire to have infinite duration (it will ignore the duration property).
  • Smokeless – It will remove smoke from the entity.
  • Start On – (Self explanatory) start on, no need for ignition points.
  • Start Full – Start with the fire
  • Don’t drop – (Not sure, never used it).
  • No glow – The fire entity will not give a glow (I recommend adding light entity for the glow).
  • Delete when out – When the fire is extinguished it will delete itself.
  • Visible from above –

Here are different fire types with different property values (R-L).

1- Standard fire, default properties with settings Start On and Start Full.

2- Lower flame, lowered the size of the flame to 10. Same settings (Start on and Start Full).

3- Standard fire. Attack set to 30 because the flame start on but not full. (Unable to notice, due its a picture)

2014-04-10_00001

If you plan on adding the fire entity on top of a prop,  then you need to make sure that prop is prop_static not prop_dynamic or prop_physics. (Left prop_dynamic and right prop_static).

2014-04-10_00002

 

 

2- env_explosion

env3

explosion

properties are;

  •  Magnitude – The amount of damage done by the explosion.
  • Radius Override – If specified, the radius in which the explosion damages entities, If unspecified, the radius will be based on the magnitude.
  • Fireball Sprite – Sprite of the fireball.
  • Render Mode – Render mode of the fireball. 0 Normal, 4 Solid, 5 Additive.
  • Ignored Entity – Do not harm or affect the named entity.

Setting for the entity can be found under the flag tab (all are self explanatory);

explosion1

This entity is better used when it is connected to a button or even to trigger the explosion.

3- env_spark

env4

spark

properties are;

  • Pitch Yaw Roll (X Y Z) – This entity’s orientation in the world.
  • Max Delay – The longest delay between sparks (in seconds).
  • Magnitude – The size of the sparks.
  • Spark Trail Length – Length of the spark trails.

Settings;

  •  Start On – Start when map loads
  • Glow – It gives off glow when there are sparks.
  • Silent – Sparks make no sound when on.
  • Directional – Spark go off in a certain direction provided by value in the Pitch Yaw Roll.

Here a few examples (R-L);

1- Default properties and with the Start on setting selected.

2- 5 second Max delay, with Glow and Start on setting selected.

3- 5 second Max delay, Large Magnitude,  medium Spark Trail Length and with Start on setting selected.

2014-04-10_00007

 

 

4- env_laser

This entity is different to the other env entities in this post, as it requires a target. You have two options when coming to add a target, you can use entity info_target or use a normal prop to be a target. I’ll show both cases.

laser

laser1

properties are;

  • Target of Laser -Name of entity, or entities, to strike at. The target is randomly chosen if there are multiple entities matching the given name.
  • Brightness - Beam brightness.
  • Beam Color  Beam color.
  • Width of Beam - The width of the laser beam, in pixels.
  • Amount of noise – The amount of noise in the beam. 0 is a perfectly straight beam.
  • Sprite Name - The material used to draw the laser beam.
  • End Sprite - If specified, this sprite will be drawn at the end of the laser beam.
  • Texture Scroll Rate – Rate at which the beam texture should scroll along the beam.
  • Starting Frame - The frame to start the beam texture on.
  • Damage / second - How much damage this laser does. per second. to things it hits.
  • Dissolve Type - Dissolve effect type.

Setting that env_spark has;

  • Start On – Start on when map is loaded.
  • Start Sparks – Sparks appear where the laser starts.
  • End Sparks –  Sparks appear where the laser ends (target).
  • Decal End – Where the laser ends decal is added on the surface of the object.

Examples;

1- Prop Target

So will start by making a prop as the target. You will need to add prop_dynamic, its the only prop entity that allows you to give it a name (prop_dynamic_override will do too).  Once you have selected the appropriate model and given the prop entity a name, add an env_laser entity and open its properties.

Here we will set a few different settings. First set the Target of Laser to the name of the prop. Also set the sprite of the laser. to do that select Sprite Name property and press the browse button to open the textures window. Unfortunately CS:GO SDK only has three types of sprites that fit with env_laser;

  • physbeam
  • laserbeam
  • purplelaser

Filter for one of them and double click it to select it. Leave all the other property values set to default. Lastly under flag tab select the Start On setting.

2- Using info_Target

Select the Entity Tool and use object dropdownlist to find ‘info_target’. Left click in the level to add it (reposition it if necessary). Open the info_target properties and give it a name. Now that is done go back to the env_laser and set the Target of Laser to be the info_target name. Leave all the other env_laser properties to default. Again go under the flag tab and select the Start on setting

Make sure in both cases you have Start On setting selected. It can be found under the Flag tab. If you dont have it select then it wont start (Unless you plan on using a trigger to activate it)

In-game

2014-04-10_00008

 

 Video:

I this post I will teach you how to use two make two things; Dust by using func_dustcloud and Fog by using env_fog_controller.

  • func_dustcloud is a brush entity available in all Source games. It spawns randomly-sized dust particles within its volume. Use the trigger texture with this entity.
  • env_fog_controller is a point entity available in all Source games. It determines the density of aerial fog for the whole map.

func_dushtcloud

To create a dustcloud we first need to select the correct texture, open up the Textures window by selecting the browse button, In Textures use the filter by adding ‘trigger’. Double click the trigger texture to select it.

buy1

 

Now that you have the trigger texture, we move on to creating the a brush. Select the Block Tools and create a template in the area you want the dustcloud to cover. When you have the right click the template and select Create Object or hit Enter.

dustcloud

Resize or reposition the brush if required.

We now need to tie the brush to an entity (func_dustcloud), so select the brush, right click the brush and select Tie to Entity or hit Ctrl + T. The Object properties will show, under the Class dropdownlist search for ‘func_dustcloud’ select it and hit apply.

dustcloud2

Properties you need to take into account are;

  • Name – The name that other entities refer to this entity by.
  • Particle Color – Color of the particles.
  • Start Disable – If set to Yes it will not then create particles when spawned.
  • Pericles per second – Number of particles to spawn, per second.
  • Maximum Particle Speed – Maximum speed that the particles can move after spawning.
  • Maximum Particle Lifetime – Maximum number of second until each particle dies.
  • Minimum Particle Lifetime – Minimum number of seconds until each particle dies.
  • Maximum Visible Distance – Maximum distance at which particles are visible. They fade to translucent at this distance.
  • Frozen – When set, this entity spawns the number of particles in SpawnRate immediately, and then goes inactive.
  • Maximum Particle Size – Maximum size the particles can be
  • Minimum Particle Size – Minimum size the particles can be

There is a lot to take in but the most important are;

  • Name (if you plan to start the cloud to be triggered by a button or event).
  •  Particle Color (To set the color depending on the enviroment).
  • Start Disabled (set to yes so that then you can enable it when there is an event).
  • Maximum Visible Distance (Make sure it is visible from a far).

So in the case of the his post I will duplicate the entity brush and set different properties. Properties I will change are the visible distance, colour and particle per second number.

Brush 1 – Green colour, greater particles per second, with maximum distance of 1024

dustcloud3

Brush 2 – Red, with 40 particles per second and maximum visible distance of 500

dustcloud4

Compile and run the game to see them in-game.

 2014-04-02_00002

2014-04-02_00001

 

env_fog_controller

To add fog into your level, select the Entity Tool and use Objects dropdownlist to search for env_fog_controller. Left click in the world to add the entity. Its position is not necessary (well it has to be inside the skybox).

fog

Double click the entity to open the object properties.

fog2

 

The properties that you need to take into account are;

  • Fog Enable – Enable fog on map load (This is important if you want fog in your level to show).
  • Primary Fog Color – Primary Fog Colour.
  • Secondary Fog Color – Secondary Fog Colour. (Primary will do, but you can set this if you want to use Fog Blend).
  • Fog Blend – This will enable blending between Primary fog colour and secondary fog colour, based on the direction the player is looking.
  • Fog Start – How far from the viewer the fog should start.
  • Fog End – How far from the viewer the scene should be completely fogged.

To set these setting you are required to go back and forth between the editor and game to get the perfect result. If you want a head start, then here are a few hints;

1 – Make sure that you have Fog Enable set to Yes.

2 – Selecting the fog Colour – You don’t want to colour to be left at default colour (which is white) or it will look like this in-game;

2014-04-03_00001

So what you want to do is open the light_environment properties and take the colour value from the brightness and set it as the fog Primary fog Colour.

fog4

 

Do the same with a Ambient and the Secondary Fog Colour. Make sure to set Fog Blend before you Compile and Run the game.

2014-04-03_00003

 

If you think the colours are still slightly briht, then go to the fog colour properties (primary and secondary) and make the colours slightly darker by hitting ‘Pick color‘ and using scroll on the right hand side.

fog5

 

 

3 –  Setting the Fog Start and End – Lowering the Fog Start value will bring the fog closer, while lowering the Fog End will bring the fog density closer.

With Low Fog Start

2014-04-03_00004

With Low Fog End

2014-04-03_00005

 

Setting these properties is dependent on the size of the map. If you have a big map then increase the Fog End value to around 3000 and leave the Fog Start at 500. While if the map is open (a lot of grass, only few buildings) then good idea to lower the Fog Start value to 100, and leave the Fog End at 2000.

Play about with the values to get the best result.

In this post I will teach you on how to add hostage rescue zones and hostages to your map. Will also add overlay/decal to define the rescue zones to make is easier to identify the area.

Updated hostage rescue rules allow to display only two hostages per map and you will need only one hostage to be rescued.

Adding Hostages

To add a hostage to the game, select the Entity Tool and search through object drop down list (bottom right side of hammer editor) for either;

  • info_hostage_spawn
  • hostage_entity

Both of them look the same and work the same way.

h2

As you are allowed two hostages per map, I recommend adding up to six, with each hostage entity is set at a different position on the map. The game will automatically select two at random when the match starts.

You can add hostages to an exclusion group that will allow you to define which hostage entities you do not want to spawn together. To do this select the hostages what you do not want to spawn together as a group. Open their properties by double clicking on one of the hostages or right click and selecting properties. Then set the Hostage Spawn Exclusion Group set to ‘Do not spawn together’. Here is example from a map that I have made;

h1

Adding Rescue Zone

Now we move on to adding rescue zone to allow CT players to bring hostages back to. Rescue zones are very simple to do.

We start by adding overlay/decal to identify the area where rescue zone will be. This is done by selecting Apply Overlays or Shift + O, then selecting a overlay by clicking the Browse button to open the Textures window. Search for ‘decals/militiahostagerescue

h3

To apply overlay/decal, left click mouse button on floor brush too apply.

Now we move on to the adding the rescue zone. You will need a brush that will have trigger texture applied to it. So start by selecting the trigger texture by selecting Browse button to open the textures window and search for ‘trigger’.

buy1

Now we create the brush by selecting Block Tool and build the brush that covers the rescue zone decal. Here is an example the map that I built:

h4

Tie the rescue zone brush to entity by right clicking and selecting ‘Tie to entity’ or hitting Ctrl+T. This will open up object properties. Under class drop down list search for ‘func_hostage_rescue’ and hit apply.

h5

Finished. Add Counter Terrorist player entity, compile and run the game to test it.

In-game

2014-01-05_00001 2014-01-05_00002 2014-01-05_00003 2014-01-05_00004

In this post I will teach you how to create bomb sites for CS:GO. These sites will be similar to the ones that are on maps that are provided with the game. Maps such as; de_aztec, de_dust and de_inferno.

Each bomb defusal map should hold two bomb sites; A & B. The first site you make will automatically be assigned as bomb size A. The second bombsite will be automatically assigned as bomb site B.

To set the bombsites you will need two brushes that will have the trigger texture and these brushes will also be required to be tied to an entity ‘func_bomb_target’.

So we start by adding overlay/decal to identify the bomb areas on the map. To do this by clicking the Browse button to open the Texture window and we search for reasonable target decal. Here are a few:

  • ‘bombsite_a’ or ‘bombsite_b’
  • ‘bombsite_letter_a’ or ‘bombsite_letter_b’
  • ‘bombsite_x’

After you have selected a decal/overlay, you will now need to place it on a brush.

To add the decal/overlay select the Apply Overlays overlay or Shift+O, then left click on the surface of the brush to apply it.

overlay2

Now we move on to adding the bomb zone brush, to do this we first click on the browse button to open the Texture window. Use filer by typing ‘trigger’ and select the texture that should look like this;

buy1

Once the texture has been selected, you will then need to create a brush. Select the Block Tool and create a brush that covers an area that you would want to be the bomb target.

bombsite1

Once you have done that we then move on to tying the brush to entity. You can do this by right clicking the brush from front,side or top views and select tie to entity, or simply selecting the brush and hitting Ctrl+T.

The brushes object properties will show up. In the Class drop down list search for ‘func_bomb_target’, then hit apply and you are done.

bombsite2

As I said at the start, the game mode will require you to create two bomb sites. You can simply duplicate the existing brush by selecting the brush, and while holding down the left mouse button drag it to the second target zone, then hold down the shift button and release the left mouse button. It should then create a duplicate brush.

bombsite3

Finally just add a terrorist player entity into the level and then compile and run the game to test the bomb sites. The overlay/decal will make it easier to identify the areas in-game.

In this post I will show you how to create spawn points for Counter Terrorist and Terrorist units. I’ll also include creating weapon buy zones for each side. I’ll also show you the best way to run the map.

Spawn Players

There are two ways of adding spawn points into map; either individually or as a bulk (5 players) by using func_instance.

We will start by adding them individually. To do this you will need to select the entity tool or [Shift+E], then filter for either;

  • ‘info_player_terrorist’ for Terrorists (This is set as a default for the entity tool)
  • ‘info_player_counterterrorist’ for Counter Terrorists

In the right bottom side of hammer editor, in the Objects drop down list.

Once you have picked on, then you will need left-click in the textured view somewhere in the word to add the entity. You may need to rotate the player start to make sure that when the player spawns, they will face the direction you want them to. Most maps and modes allow up to five player entities per side/team. You could add more that five but only five will show in-game.

spawn1

Now we go on to adding players in a bulk. Select the entity tool and filter for func_instance’. Once you have added the entity to where you want players to spawn, enter the func_instance entity properties. In VMF Filename field select the Browse button.

spawn2

A dialogue window will pop up and will displaying the contents of the maps folder. There will be folder by name ‘instances’, double click the folder. Within the instances folder there should be two vmf files; spawn_t.vmf and spawn_ct.vmf. Selecting spawn_t will give you five terrorists player entities, while spawn_ct will give give counter terrorists player entities. Select spawn_t.vmf as we already added five CT players. Then click apply.

You will notice that five T players show hovering over func_instance entity. Last things left to do is to rotate the entity to allow the players to face the right direction and make sure that entity is touching the floor of the world.

spawn3

Player Buy Zones

Now we move on to Buy Zones. You will need buy zones for each team to allow players purchase weapons and gear. Buy zones are very simple to set up.

To create a Buy zone you will need to create a brush/block with the ‘trigger’ texture. Select the Block Tools or [Shift+B]. Then select browse from the right side of the editor to open the Textures window. Filter for ‘Trigger’ and select it. Texture should look like this;

buy1

Create block that holds the entity players within the block/brush

buy2

To turn the brushes to buy zones, you need to select one of the brushes and then hit [Ctrl+T] (or right click the brush on side,front or top view and select Tie to entity). A properties window will show;

buy3

Then you need to turn Class to ‘func_buyzone’ and then hit apply.

buy4

Now depending on the brush covering which team, change the field value for Team Number (int) to the team the brush covers. In this case I have selected the brush covering the terrorist team, so I set Team Number (int) to Terrorist.

buy5

Do the same for the other team but have field value to Counter-Terrorist and hit apply.

Running the Map

To start running map, select Run Map counter strike 1.42  located at the top of the hammer editor or hit F9 on your keyboard. A window will open looking like this;

runmap

  • BSP –  BSP tool is the one that actually converts the .vmf file data into a usable .bsp file that the game engine can load.
  • VIS – This tool creates the visibility matrix for the map based on the level’s geometry. This matrix is what determines which polygons the player can see, might see, and can’t see from any given point within the level in game.
  • RAD – The RAD tool, or Radiosity tool, is responsible for generating and applying all lighting effects in a level.

I wont go into different options, just set the setting on Run Map window to be same as shown on the image above. If you run map on these setting, you will need to make sure to add skybox and light_environment before running map.

 

In-game Images

2013-12-26_00001 

2013-12-26_00002

During the lighting post I did not give tutorial light_dynamic, and did not give tutorial for prop_physics during the prop post. The reason for this is require explaining props and lighting before giving tutorial as require abit of each when it comes to use them in CS:GO SDK. So I’ll give a tutorial on how to add physical ceiling light.

Previous Posts:

Physical Ceiling Light

Entities required are:

  • light_dynamic.
  • prop_physics.
  • phys_ballsocket – It simulates a rigid connection between the centre of its constrained entities and its own location that prevents them from changing relative distance and makes their rotation point its own location.
  • Building (Made up from brushes/walls).
  • (optional) point_spotlight (for effect).

Step 1 – Building a Dark Room

We start by creating a dark room to add our light into to see the effect more clearly. Start by select a texture by selecting browse from the right side of the hammer editor to call the Textures window. Preferred a dark or a grey texture, up to you (I’ll be going with ‘metal/citadel_tilefloor016a’)

darktext

Now move on to the building. Select the Block Tool or [Shift + B] blocktool. Then make sure that Objects drop down list on the bottom right side of hammer editor is set to ‘Block’. Then create four big walls and a roof.

A fast way of making four walls is by duplicate a single wall into four, and turn two of the walls 90 degrees. To duplicate select the object/brush, drag the brush somewhere on the map and while hold shift, release the left mouse button.
duplicate

To turn/rotate the object, right click the object/brush and select Transform and a small window will pop up. Make sure to Mode is set to Rotate and set the Z value to 90 then click OK.

rotate

Then all you have to do is connect together with no gaps and add a roof block. Should look like this from the inside;

building

Step 2 – Adding Physics light model

Select the entity tool, and filter for prop_physics and then left click on the roof block. In the prop entity properties under World Model select Browse button. Filter for ‘light’. While you have the info tab selected look for light model that is compatable with physics.

physics

Once you have found one click OK on the Model Browser. Give the prop entity a name (e.g. light1) and then select apply in the properties. You may need to rearrange the position of the entity to fit the world.

light

Step 3 – Adding a phys_ballsocket 

This is basically a connector, which is connecting physics object to the wall. Select the entity tools and filter in the bottom right side of hammer editor, in the objects drop down list for ‘phys_ballsocket’. Left click on the roof block to add the entity. Then rearrange position to be directly above the physics prop entity. like so;

socket

Then enter phys_ballsocket properties. Then set the Entity 1 field value to equal the physics prop entity name, which you gave (e.g. light1)

ballsocket

Then select Apply.

Step 4 – Adding light_dynamic

Select the entity tool and filter for ‘light_dynamic’, then left click in the world to add the entity. Position it to be set under the light model entity and make sure that centre x marker of light_dynamic entity is not within parameters of the light model entity. Like so:

lightdyn

Once that is done we move on to setting the light_dynamic entity values. Go into its properties by double clicking the entity.

properties

You will need to set the values of:

  • Parent to equal the light model entity (in my example is light1).
  • The inner and outer values to cover more surface area (60 for inner and 75 for outer is good)
  • Brightness (requires some in-game testing to get the best value)
  • Pitch Yawn Roll – 90 0 0 (Facing down)

properties2

Finally you need to set the Maximum Distance to view the affect light. To do this once you have selected the light_dynamic entity, you will notice a yellow circle in the side,front and top views or yellow sphere in the texture view. Select a white square from either the side or front view and stretch it until it inner and outer  emission lights are within the sphere.

maximum distance

Now test it by running the map.

(Optional) Step 5 – Adding point_spotlight

Select the entity tool and filter for point_spotlight. Add it to the world by left clicking and position it in the same position as the light_dynamic entity. Within its properties set these values:

  • Parent – light1.
  • Spotlight length 100, keep the Spotlight With on 50.
  • Pitch Yawn Roll – 90 0 0 (Make sure the spotlight is facing down)

In-game shots

2013-12-19_00001(Light emitting at me after being shot)

2013-12-19_00002(Light going in the other direction)

In this post I will cover props. Props are model entities. I will go though the types of props available in Counter-Strike: Global Offensive-SDK. I will go though how to use them properly within the editor.

There many different types of props available in SDK, these are the types:

  • prop_detailed – Detail geometry – static models that do not move. Do not contain any physics properties or collision data. Cannot break. Do not cast shadows. Can be automatically placed by assigning a detail type to a material. Generally not placed individually by level designers. The least expensive geometry to render. These may not even be rendered on low-end machines. (e.g. grass, rocks and plants)
  • prop_static – Static geometry – models that do not move. Does not contain physics properties other than collision, and cannot break. Cannot have any joints or animation. Casts lightmap shadows. Inexpensive geometry to render. (e.g. pipes, light fixtures, rocks and telephone poles)
  • prop_dynamic – Models that can be placed in hierarchy and can have joints and play animations. Can also be configured to break when taking enough damage. Can be hierarchically attached to other objects. Can cast dynamic shadows. More expensive than static geometry, less expensive than physics geometry. (Used for models that have animation such as Robotic arms etc…)
  • prop_physics – Models with built-in physical properties. Moves and collides using the rigid-body physics system. Can be constrained to other physics objects using hinges or other constraints. It can also be configured to break when it takes enough damage. Casts dynamics shadows. Expensive to move and render. (e.g. barrels, small debris and furniture)
  • prop_ragdoll – Physics props with ragdoll physics skeletons. Have all the properties of physics props and can also use the rigid body ragdoll physics system to have multiple colliding or bending parts. Very expensive to move and render. (e.g. Corpses, multi-piece cardboard boxes and mattresses)
  • prop_physics_multiplayer – Physics props using a simplified physics collision system designed for multiplayer games. Have less networking overhead than standard physics props, necessary for the bandwidth-limited environment of multiplayer games.
  • prop_dynamic_override – Special prop type used to convert a model that is designed to be used as a prop_static, and giving it the properties of a prop_dynamic. Has identical cost of a prop_dynamic.

Inserting Prop Models

To add a prop model, first select the entity tool

Then on the right hand side of the hammer editor, use the objects drop down menu filter for the entity you want to place. Choose either prop_static, prop_physics, prop_physics_multiplayer, prop_dynamic_override, prop_ragdoll or prop_dynamic.

In perspective/Texture viewport, left click to place the entity.Now we will have a place holder for a prop model. Double click on the red entity place holder. In object properties for the model prop, select World Model and click on Browse.

prop

Model Browser will open up, and then you are able to choose a model from the hundreds of models available. Use the filter option to type in a search for specific models you are looking for.prop2

Depending on which prop entity you chose (static, dynamic or physics) click over to Info tab to see if that prop model supports your prop type. (If dynamic it will also support prop_ragdoll, prop_dynamic_override. Else if physics then it will support prop_physics_multiplayer)

prop3

Once you have the model you want, select OK on Model Browser, then Apply on the entity properties.

Hints:

  • If adding physics models, use prop_physics_multiplayer instead of prop_physics.
  • On certain light models its best to use them as prop_dynamic_override instead of prop_static.

Inserting Prop_Dynamic (Animation)

To add animated object first need to search for object that has animation to it. Add an prop_dynamic entity.

In object properties for the model prop, select World Model and click on Browse. In purpose of this tutorial filer for ‘helicopter’. You will notice that under the sequences tab there are few different sequential events.

animationThese events are the animation that mode can perform. So to allow animation on the model need to first select this model then click OK in the Model Browser. As you return to the the models’ properties window search for field Default Animation and set the parameter to equal one of the sequences, like so (I have set it to 3ready):

animation2

Once you have set the Default Animation, then it’s done. Select Apply to finish.

Hint: If a model does have an animation, but the only sequence is idle then set the default animation of the entity to idle.

In this post will go through different types of lights available in the Counter-Strike:Global Offensive-SDK. I’ll also give tutorials on how add some of these lights, show how they work and show how they would look like in-game.

The types of lighting in source sdk can be split up into two:

Static Sources, static lighting is compiled into Lightmaps, which illuminate brushes and models, and Cubemaps, which provide static reflection. Dynamic Sources, dynamic lighting is calculated at runtime, which makes it expensive to render. This includes entity lights:

  • light – A static, omni-directional point light source (e.g. naked light bulb)
  • light_spot – A static, uni-directional point light source (e.g. torch or flashlight).
  • light_environment (Covered this in the last post here: http://goo.gl/VxnKGw )
  • light_directional –  It is a directional light with no falloff.
  • light_dynamic -A simple, uni-directional dynamic light that can be moved, turned, and adjusted.
  • point_spotlight – A dynamic spotlight beam effect, with an optional dynamic light source where it hits a surface.
  • beam_spotlight – Will draw a beam when the player views it side on, and a halo when it’s facing towards the player.

MAT_FULLBRIGHT

If you compile your map and run it in-game, Source will default your lighting to full bright. Once you insert a light into your map, the engine will switch full bright off and begin calculating your lighting. The console command for full bright are:

  • mat_fullbright 0
  • mat_fullbright 1

Mat_Fullbright is a useful command in Source. You can use it to gameplay test your map without worrying about setting up lights. Unfortunately right now, mat_fullbright is buggy and does not produce full bright map.

Adding Light to Map

Enough with the back ground lecture, now I’ll show you how to add certain light entities into your map. I’ll go through these light entities; light, light_spot, point_spotlight and beam_spotlight.

To add light entity first select the entity tool entity tool

Then type in the bottom right hand side of the hammer editor, under object ‘light’

Then to add the light entity just left click somewhere in the world (Where you would like to place it, just make sure not add it within an existing brush/object)

Hint – The x simple on the entity represents the centre, but can also represent the point of where the light starts emitting. So make sure if you want to light the objects/brushes around do not have x within an object/brush or prop.

light

Double click the entity to display the properties to alter any necessary settings.

lightprop

Useful fields that you need to take into consideration when using light entity:

  • Name – Could give name to the light entity for reference or parenting.
  • Brightness – takes four values, first three (255 255 255) is the colour of the light. The fourth (200) is the brightness of the light.
  •  Appearance –  Is how the light could appear in-game. Normal is constant light emission, Fluorescent flicker is that light will flicker and you will get the rest.

Here is in-game view of light at with different values for fields. (R-L) Standard light, Brightness set at 750, Colour change to blue and final appearance set to flicker (unfortunately unable to view the flicker in action with a screenshot).

2013-12-04_00001

Now we move on to light_spot. This entity only works by emitting light in one direction and it is not as bright as light entity. To add the entity select the entity tools and filter for ‘light_spot’ under objects in the right hand side of the hammer editor.Left-click where you would like to place the entity in the world.

light_spotprop

Useful fields that you need to take into consideration when using light_spot entity:

  • The ones that were included in the light entity properties (Name, brightness and appearance).
  • Pitch Yaw Roll (X Y Z) – The direction of where the light is emitting.
  • Inner (Bright) angle – Focus light.
  • Outer (Fade) angle – Outer fade light.

Here is in-game view of light_spot at with different values for fields. (R-L) Standard light_spot, Brightness set at 750, Colour change to blue and last has its Inner and outer set to 60 and 75 (Notice the light cover more surface area and first one)

2013-12-04_00002

beam_spotlight and point_spotlight are similar so I’ll cover them together (I sometimes forger which does what). Again after selecting the entity tool, filter the object for either ‘beam_spotlight’ or ‘point_spotlight’ (depending on what you need). Left-click on the in the world to add the entity. The arrow should indicate the direction of where the entity will emit.

beam&point

The additional field provided in their properties that will interest you are:

  • Spotlight Length
  • Spotlight Width

I do not need to need explain these, I’m sure you already understand what they point to.

Here is in-game view of beam_spotlight(top) and point_spotlight(bottom). Main and most notisable difference is that point_spotlight is stronger and brighter than beam_spotlight.  (R-L) Standard values, Colour change to red, then I halved the spotlight length and width. The last one is mistake, its the same as standard values.

2013-12-04_00003

I think you have noticed that beam_spotlight and point_spotlight do not provide any light to the environment. They are more than an effect that helps make the map or objects more interesting.

I’ll not show light_directional because there isn’t much use for it, as well as I’m not sure how to set it up, as I never was required to use it. light_dynamic cannot be used alone, and as I haven’t introduced props yet I have decided to save this for a future post.