Prefab: Difference between revisions
(such a long article.. and it all can be said in four paragraphs) |
RabidMonkey (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
A Premade Fabrication or '''Prefab''' is a separately saved object, usually consisting of multiple parts. The prefab system allows you to easily store pieces from your levels that can be used | A Premade Fabrication or '''Prefab''' is a separately saved object, usually consisting of multiple parts, either brushes, props, or entity elements. The prefab system allows you to easily store pieces from your levels that can be used repeatedly. Examples of useful prefabs include hallways, pillars, special entity setups, etc. | ||
Prefabs are simply small map (.[[VMF]]) files that contain only your prefab. These files are stored in a particular folder, | Prefabs are simply small map (.[[VMF]]) files that contain only your prefab. These files are stored in a particular prefab folder, generally \sourcesdk\bin\prefabs, so that [[Valve Hammer Editor|Hammer]] can find them and allow you to easily insert them into your levels. Prefabs can be organized into their own heirarchy in the /prefabs directory - Using a folder of prefabs for each map, mod, etcetera, as determined by the user. | ||
To create a prefab, select the objects you wish | To create a prefab, select the objects you wish to create it from and select the '''Create Prefab''' command from the '''Tools Menu'''. Hammer opens a '''Save As...''' dialog open in the Hammer prefabs directory. Type in a filename and click the '''Save''' button. The prefab will now appear in the [[Hammer New Objects Toolbar|New Objects]] toolbar. | ||
{{note|When creating prefabs, it is generally advisable to centre the objects at the origin (0,0,0) before finalising the prefab.}} | {{note|When creating prefabs, it is generally advisable to centre the objects at the origin (0,0,0) before finalising the prefab.}} |
Revision as of 05:01, 2 April 2006
A Premade Fabrication or Prefab is a separately saved object, usually consisting of multiple parts, either brushes, props, or entity elements. The prefab system allows you to easily store pieces from your levels that can be used repeatedly. Examples of useful prefabs include hallways, pillars, special entity setups, etc.
Prefabs are simply small map (.VMF) files that contain only your prefab. These files are stored in a particular prefab folder, generally \sourcesdk\bin\prefabs, so that Hammer can find them and allow you to easily insert them into your levels. Prefabs can be organized into their own heirarchy in the /prefabs directory - Using a folder of prefabs for each map, mod, etcetera, as determined by the user.
To create a prefab, select the objects you wish to create it from and select the Create Prefab command from the Tools Menu. Hammer opens a Save As... dialog open in the Hammer prefabs directory. Type in a filename and click the Save button. The prefab will now appear in the New Objects toolbar.

For information on how to place prefabs in a map, see Inserting Prefabs.
External links
Various sites that host custom made prefabs and models: