Sprinkle: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (following previous edit to replace 'game abbreviation' to '<gameinfo path>' to make page more consistent)
mNo edit summary
 
(10 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Hammer Tools]]
{{LanguageBar}}
[[Image:Entitysprinkledialog.png|right|]]
 
[[Image:Sprinkletoolexample.gif|right|thumb|The '''Sprinkle Tool''' in use.]]
[[File:Entitysprinkledialog.png|right|thumb|'''Sprinkle Tool''' in {{Csgo}}{{As}}{{Portal2}}]]
__TOC__
[[File:Sprinkle tool - GMOD.png|right|thumb|'''Sprinkle Tool''' in {{GMOD}}]]
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.
[[File:SprinkleTool-Hammer++.png|right|thumb|'''Sprinkle Tool''' in {{Hammer++}}]]
[[File:Sprinkletoolexample.gif|right|thumb|The '''Sprinkle Tool''' in use.]]


{{note|Tested on [[Counter-Strike: Global Offensive]] and [[Alien Swarm]] Hammer.}}
{{since|{{As}}}}{{also|{{hammer++}}{{GMOD}}}}
The '''Sprinkle Tool''' allows for quick placement of pre-defined [[entities]] onto your map. This is ideal for painting foliage, rocks, litter, etc, but can be used with any entity, like decals or NPCs. '''Sprinkle Tool''' requires that you make a custom .txt script before it can place entities.


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+Alt+S}} to open the '''Entity Sprinkle''' [[dialog]].
# Holding '''Left Click''' around your map will allow you to use the tool.
# 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 '''Right Click''' and moving the mouse will change the '''Radius''' size.
# Holding {{key|CTRL}} while '''Left Clicking''' will temporarily change the mode to '''Subtractive'''.
# Holding {{key|CTRL}} while '''Left Clicking''' will temporarily change the mode to '''Subtractive''', acting as an eraser.


==Type==
{{only|{{Hammerplusplus}}{{GMOD}}}} [[Hammer_Map_Tools_Toolbar|Hammer Map Tools Toolbar]] has an additional icon for the '''Sprinkle Tool'''.


'''Types''' are defined in script files that are used to define what should be placed around the map. They're located at <code>''<gameinfo path>''/scripts/hammer/sprinkle</code>.
__TOC__


==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|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==
==Adding Types==


To add types to the tool, you'll need to make a '''Sprinkle Definition'''. All '''Sprinkle definitions''' are located at <code>''<gameinfo path>''/scripts/hammer/sprinkle/</code>, (ex. <code> Counter Strike Global Offensive/csgo/scripts/hammer/sprinkle/</code>) which usually doesn't exist by default.
'''Types''' define what should be placed with the tool. They're located at <code>''<gameinfo path>''/scripts/hammer/sprinkle</code> (ex. <code> Counter-Strike: Global Offensive/csgo/scripts/hammer/sprinkle/</code>), a folder that must be manually created.  


A '''definition file''' can be named anything, as long as it ends with the <code>.txt</code> file extension.
To add your own types, you'll need to add a '''Definition File''' in this folder. It can be named anything, as long as it's a <code>.txt</code> file.
==Definition File Example==
==Definition File Example==


<source>
<source>
"Agave Plants" //This is what shows up in Type
"Agave Plants" //This is the name that will appear in the Sprinkle menu
{
{
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
base //The base values of what you want to sprinkle. You can add any keyvalue, ex. "fademaxdist", and it will be applied to every entity
{
{
"classname" "prop_static"
"classname" "prop_static"
grid "64 64" // The default grid size of this type, this can be overridden in Hammer
grid "64 64" // The default grid size of this type, this can be overridden in the Sprinkle menu
}
}
10 //This is the chance of this set of values being used, this can be any number
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
"model" "models/props/de_dust/hr_dust/foliage/agave_plant_01.mdl" //The values of this case. More keyvalues can be added, ex. "skin" or "rendercolor"
}
}
10
10
{
{
"model" "models/props/de_dust/hr_dust/foliage/agave_plant_02.mdl"
"model" "models/props/de_dust/hr_dust/foliage/agave_plant_02.mdl"  
"rendercolor" "13 204 75"
"rendercolor" "13 204 75"
}
}
Line 81: Line 57:
}
}
</source>
</source>
==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|The tool will not replace already existing entities, only entities created by the '''Sprinkle Tool'''.}}
==Density==
Slider from 0% to 100%. Determines the chance of an entity being placed.
==Random X/Y/Z==
{{only|{{GMOD}}}}
Also known as '''Grid Offset'''. After an entity is placed, it will be moved a random distance on this axis; your input is the maximum distance. If this value is too high, your entities will be floating or clipping. NOT TO BE CONFUSED with '''Random Yaw'''.
==Item Offset (Z)==
{{only|{{GMOD}}}}
Following the terrain, uniformly raises or lowers the placement. Useful for when a prop has empty space on its bottom.
==Grid Size==
Determines how close together entities are placed in the '''Radius'''. By default it uses the 'grid' 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 Hammer's current '''Snap Grid Size'''.
==Random Yaw==
Will randomly spin the entities on their '''Yaw'''. Good for breaking up repetition.
[[Category:Hammer Tools]]

Latest revision as of 15:51, 20 August 2024

English (en)中文 (zh)Translate (Translate)
Sprinkle Tool in Counter-Strike: Global OffensiveAlien SwarmPortal 2
Sprinkle Tool in Garry's Mod
Sprinkle Tool in Hammer++
The Sprinkle Tool in use.

(in all games since Alien Swarm)(also in Hammer++Garry's Mod) The Sprinkle Tool allows for quick placement of pre-defined entities onto your map. This is ideal for painting foliage, rocks, litter, etc, but can be used with any entity, like decals or NPCs. Sprinkle Tool requires that you make a custom .txt script before it can place entities.

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, acting as an eraser.

(only in Hammer++Garry's Mod) Hammer Map Tools Toolbar has an additional icon for the Sprinkle Tool.


Adding Types

Types define what should be placed with the tool. They're located at <gameinfo path>/scripts/hammer/sprinkle (ex. Counter-Strike: Global Offensive/csgo/scripts/hammer/sprinkle/), a folder that must be manually created.

To add your own types, you'll need to add a Definition File in this folder. It can be named anything, as long as it's a .txt file.

Definition File Example

"Agave Plants" //This is the name that will appear in the Sprinkle menu
{
	base //The base values of what you want to sprinkle. You can add any keyvalue, ex. "fademaxdist", and it will be applied to every entity
	{
		"classname" "prop_static"
		grid "64 64" // The default grid size of this type, this can be overridden in the Sprinkle menu
	}
	
	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. More keyvalues can be added, ex. "skin" or "rendercolor"
	}
	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"
	}
}

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

Slider from 0% to 100%. Determines the chance of an entity being placed.

Random X/Y/Z

(only in Garry's Mod)

Also known as Grid Offset. After an entity is placed, it will be moved a random distance on this axis; your input is the maximum distance. If this value is too high, your entities will be floating or clipping. NOT TO BE CONFUSED with Random Yaw.

Item Offset (Z)

(only in Garry's Mod)

Following the terrain, uniformly raises or lowers the placement. Useful for when a prop has empty space on its bottom.

Grid Size

Determines how close together entities are placed in the Radius. By default it uses the 'grid' 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 Hammer's current Snap Grid Size.

Random Yaw

Will randomly spin the entities on their Yaw. Good for breaking up repetition.