Sprinkle: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(still creating)
(finished the page)
Line 1: Line 1:
[[Category:Hammer Tools]]
[[Category:Hammer Tools]]
[[Image:Entitysprinkledialog.png|right|]]
[[Image:Entitysprinkledialog.png|right|]]
[[Image:Entitytoolexample.gif|right|thumb|The '''Sprinkle Tool''' in use.]]
__TOC__
The '''Sprinkle Tool''' allows for quick placement of pre-defined [[entities]] onto your map. The '''Sprinkle Tool''' requires a custom script in order for it to place entities.
The '''Sprinkle Tool''' allows for quick placement of pre-defined [[entities]] onto your map. The '''Sprinkle Tool''' requires a custom script in order for it to place entities.
{{note|Is only in the [[Counter-Strike: Global Offensive]] branch of Hammer}}


To open the '''Sprinkle Tool''':
To open the '''Sprinkle Tool''':
# Choose '''Sprinkle...''' from the '''Tools Menu''' or use the shortcut {{key|CTRL}}+{{key|ALT}}+{{key|S}} to open the '''Entity Sprinkle''' [[dialog]].
# Choose '''Sprinkle...''' from the '''Tools Menu''' or use the shortcut {{key|CTRL}}+{{key|ALT}}+{{key|S}} to open the '''Entity Sprinkle''' [[dialog]].
# Holding '''Left Click''' around your map will allow you to use the tool.
# Holding '''Right Click''' and moving the mouse will change the '''Radius''' size.
# Holding {{key|CTRL}} while '''Left Clicking''' will temporarily change the mode to '''Subtractive'''.


==Type==
==Type==


Types are script files that are used to define what should be placed around the map. They're located at <code>''game abbreviation''/scripts/hammer/sprinkle</code>.
'''Types''' are script files that are used to define what should be placed around the map. They're located at <code>''game abbreviation''/scripts/hammer/sprinkle</code>.
==Mode==
==Mode==


This lets you select how the tool will act when placing entities. There are four options:
This lets you select how the tool will act when placing entities. There are four options:


* '''Additive''' -  Adds entities in the Radius and will overwrite any existing entities in the Radius.
* '''Additive''' -  Adds entities in the '''Radius''' and will overwrite any existing entities in the '''Radius'''.
* '''Subtractive''' - Removes entities in the Radius.
* '''Subtractive''' - Removes entities in the '''Radius'''.
* '''Replace''' - Replaces all entities in the Radius, acts like Additive and Subtractive.
* '''Replace''' - Replaces all entities in the '''Radius''', acts like '''Additive''' and '''Subtractive'''.
* '''Overwrite''' - Overwrite entities in the Radius, acts like Additive but only on already existing entities.  
* '''Overwrite''' - Overwrite entities in the '''Radius''', acts like '''Additive''' but only on already existing entities.
 
{{note|The tool will not replace already existing entities, only entities created by the '''Sprinkle Tool'''.}}
==Density==
 
Determines the chance of an entity being placed.
==Grid Offset==
 
{{todo}}
==Grid Size==
 
Determines how close together entities are place in the '''Radius'''. By default it uses the '''Grid Size''' defined in the script, but if ''''Use Grid Size from Definition'''' is unticked, a custom '''Grid Size''' can be entered. Pressing ''''Use Grid'''' will use the current '''Snap Grid Size'''.
==Use Grid Size From Definition==
 
Determines if the '''Grid Size''' from the '''Definition''' is used or not. If unticked a custom '''Grid Size''' can be entered.


{{note|The tool will not replace any existing entities, only entities created by the Sprinkle Tool.}}
Looks for the 'grid' keyword in the '''Definition'''.
==Random Yaw==


Will randomly spin the entities on their '''Yaw'''.
==Adding Types==
==Adding Types==
To add types to the tool, you'll need to make a Sprinkle script. All Sprinkle scripts are located at <code>''game abbreviation''/scripts/hammer/sprinkle</code>, which usually doesn't exist by default.


A script file can be named anything, along as it ends with the <code>.txt</code> file extension.
To add types to the tool, you'll need to make a '''Sprinkle Definition'''. All '''Sprinkle definitions''' are located at <code>''game abbreviation''/scripts/hammer/sprinkle</code>, which usually doesn't exist by default.
 
A '''definition file''' can be named anything, as long as it ends with the <code>.txt</code> file extension.
==Definition File Example==
 
<source>
<source>
"Agave Plants" //This is what shows up in Type
"Agave Plants" //This is what shows up in Type

Revision as of 21:34, 7 December 2018

Entitysprinkledialog.png
The Sprinkle Tool in use.

The Sprinkle Tool allows for quick placement of pre-defined entities onto your map. The Sprinkle Tool requires a custom script in order for it to place entities.

Note.pngNote:Is only in the Counter-Strike: Global Offensive branch of Hammer

To open the Sprinkle Tool:

  1. Choose Sprinkle... from the Tools Menu or use the shortcut CTRL+ALT+S to open the Entity Sprinkle dialog.
  2. Holding Left Click around your map will allow you to use the tool.
  3. Holding Right Click and moving the mouse will change the Radius size.
  4. Holding CTRL while Left Clicking will temporarily change the mode to Subtractive.

Type

Types are script files that are used to define what should be placed around the map. They're located at game abbreviation/scripts/hammer/sprinkle.

Mode

This lets you select how the tool will act when placing entities. There are four options:

  • Additive - Adds entities in the Radius and will overwrite any existing entities in the Radius.
  • Subtractive - Removes entities in the Radius.
  • Replace - Replaces all entities in the Radius, acts like Additive and Subtractive.
  • Overwrite - Overwrite entities in the Radius, acts like Additive but only on already existing entities.
Note.pngNote:The tool will not replace already existing entities, only entities created by the Sprinkle Tool.

Density

Determines the chance of an entity being placed.

Grid Offset

[Todo]

Grid Size

Determines how close together entities are place in the Radius. By default it uses the Grid Size defined in the script, but if 'Use Grid Size from Definition' is unticked, a custom Grid Size can be entered. Pressing 'Use Grid' will use the current Snap Grid Size.

Use Grid Size From Definition

Determines if the Grid Size from the Definition is used or not. If unticked a custom Grid Size can be entered.

Looks for the 'grid' keyword in the Definition.

Random Yaw

Will randomly spin the entities on their Yaw.

Adding Types

To add types to the tool, you'll need to make a Sprinkle Definition. All Sprinkle definitions are located at game abbreviation/scripts/hammer/sprinkle, which usually doesn't exist by default.

A definition file can be named anything, as long as it ends with the .txt file extension.

Definition File Example

"Agave Plants" //This is what shows up in Type
{
	base //The base values of what you want to sprinkle. Every entity will have these values, but you do not need to put anything here
	{
		"classname" "prop_static"
		grid "64 64" // The default grid size of this script, this can be overridden in Hammer
	}
	
	10 //This is the chance of this set of values being used, this can be any number
	{
		"model" "models/props/de_dust/hr_dust/foliage/agave_plant_01.mdl" //The values of this case
	}
	10
	{
		"model" "models/props/de_dust/hr_dust/foliage/agave_plant_02.mdl"
		"rendercolor" "13 204 75"
	}
	10
	{
		"model" "models/props/de_dust/hr_dust/foliage/agave_plant_03.mdl"
		"rendercolor" "13 204 75"
	}
	10 //Since there's 4 cases with the same chance, each case has a 1/4 chance of being placed
	{
		"model" "models/props/de_dust/hr_dust/foliage/agave_plant_04.mdl"
		"uniformscale" "1.3"
	}
}