Prefab: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(added links to sites that host custom made prefabs and models.)
(merge from prefabs, links)
Line 1: Line 1:
[[Category:Level Design]]
[[Category:Level Design]]
Prefab libraries allow you to easily store pieces from your levels that can be used over and over. Examples of useful prefabs include hallways, pillars, special entity setups, etc.
Premade Fabrications or ''Prefabs'' are objects that have been made before that are more complicated than brushes that you can insert into your map. Prefab libraries allow you to easily store pieces from your levels that can be used over and over. Examples of useful prefabs include hallways, pillars, special entity setups, etc.


=Creating Prefabs=
== Creating Prefabs ==


Prefabs are simply small map (.VMF) files that contain only the prefab data. These prefab files are stored in a particular folder, the prefab folder, so that Hammer can find them and allow you to easily insert them into your levels.
Prefabs are simply small map (.VMF) files that contain only the prefab data. These prefab files are stored in a particular folder, the prefab folder, so that Hammer can find them and allow you to easily insert them into your levels.


Prefabs are created by selected the objects you wish to make into a prefab, and selecting the Create Prefab command from the '''Tools Menu'''. Hammer opens a '''Save As...''' dialog open in the Hammer prefabs directory. Type in a name and click the '''Save''' button to add the prefab to the library. The prefab will now show up in the New Objects toolbar, ready to placed into levels.
Prefabs are created by selected the objects you wish to make into a prefab, and selecting the Create Prefab command from the '''Tools Menu'''. Hammer opens a '''Save As...''' dialog open in the Hammer prefabs directory. Type in a name and click the '''Save''' button to add the prefab to the library. The prefab will now show up in the [[Hammer New Objects Toolbar|New Objects]] toolbar, ready to placed into levels.


Please note that when creating prefabs, it is generally advisable to centre the objects at the origin (0,0,0) before finalising the prefab.
Please note that when creating prefabs, it is generally advisable to centre the objects at the origin (0,0,0) before finalising the prefab.


=Placing Prefabs=
== Placing Prefabs ==


Placing the objects you make is just as simple.
Placing the objects you make is just as simple.


In the New Objects toolbar, select the library from the Categories list, select the object from the Objects list, and press the Insert original prefab button. The object will be inserted in your map, centered in the 2D views. For more information on placing prefabs, see [[Creating_Brushes#Inserting_Prefabs|Inserting Prefabs in Creating Brushes]].
In the [[Hammer New Objects Toolbar|New Objects]] toolbar, select the library from the '''Categories''' list, select the object from the '''Objects''' list, and press the '''Insert original prefab''' button. The object will be inserted in your map, centered in the 2D views. For more information on placing prefabs, see [[Brush Creation#Inserting Prefabs|Brush Creation]].


=See Also=
== See Also ==
below are useful links to various sites that host custom made prefabs and models.
 
* [[Brush Creation]]
 
== External links ==
 
Useful links to various sites that host custom made prefabs and models.


* [http://www.sourceprefabs.com/ sourceprefabs]
* [http://www.sourceprefabs.com/ sourceprefabs]
* [http://www.snarkpit.net/editing.php?page=files&game=HL2&type=prefabs&subcat=examples snarkpit prefabs database]
* [http://www.snarkpit.net/editing.php?page=files&game=HL2&type=prefabs&subcat=examples snarkpit prefabs database]
* [http://halflife2.filefront.com/files/Half-Life_2/Prefabs;2654 file front prefabs database]
* [http://halflife2.filefront.com/files/Half-Life_2/Prefabs;2654 file front prefabs database]

Revision as of 14:46, 10 March 2006

Premade Fabrications or Prefabs are objects that have been made before that are more complicated than brushes that you can insert into your map. Prefab libraries allow you to easily store pieces from your levels that can be used over and over. Examples of useful prefabs include hallways, pillars, special entity setups, etc.

Creating Prefabs

Prefabs are simply small map (.VMF) files that contain only the prefab data. These prefab files are stored in a particular folder, the prefab folder, so that Hammer can find them and allow you to easily insert them into your levels.

Prefabs are created by selected the objects you wish to make into a prefab, and selecting the Create Prefab command from the Tools Menu. Hammer opens a Save As... dialog open in the Hammer prefabs directory. Type in a name and click the Save button to add the prefab to the library. The prefab will now show up in the New Objects toolbar, ready to placed into levels.

Please note that when creating prefabs, it is generally advisable to centre the objects at the origin (0,0,0) before finalising the prefab.

Placing Prefabs

Placing the objects you make is just as simple.

In the New Objects toolbar, select the library from the Categories list, select the object from the Objects list, and press the Insert original prefab button. The object will be inserted in your map, centered in the 2D views. For more information on placing prefabs, see Brush Creation.

See Also

External links

Useful links to various sites that host custom made prefabs and models.