Работа со сборными объектами

Материал из CryWiki Russia

(Различия между версиями)
Перейти к: навигация, поиск
Строка 1: Строка 1:
-
== Working With Prefabs==
+
{{В_процессе_перевода}}<br>
-
=== Overview===
+
== Working With Prefabs ==
-
Prefabs are groups of objects which can be placed in your level as instances.  An instance is an object which is an exact copy of every other object of the same type.  When you edit one instance of an object, every other instance that exists in your game will change, either instantly or when the instance is reloaded.
+
-
=== Index===
+
=== Overview ===
 +
Prefabs are groups of objects which can be placed in your level as instances. An instance is an object which is an exact copy of every other object of the same type. When you edit one instance of an object, every other instance that exists in your game will change, either instantly or when the instance is reloaded.
-
=== What are prefabs?===
+
=== Index ===
-
A prefab is a predefined group of objects.  Every time you place down a prefab, each instance is precisely the same in every way.  Altering a prefab will make it change everywhere it has been placed.  Any alterations need to be saved to the prefab library to ensure they are correctly propagated across your entire game.
+
-
An example of a prefab <br> <br>
+
=== What are prefabs? ===
-
[[Image:Sandbox_WorkingWithPrefabs_image001.jpg]]
+
 +
A prefab is a predefined group of objects. Every time you place down a prefab, each instance is precisely the same in every way. Altering a prefab will make it change everywhere it has been placed. Any alterations need to be saved to the prefab library to ensure they are correctly propagated across your entire game.
-
=== The Prefabs Library===
+
An example of a prefab <br> <br> [[Image:Sandbox WorkingWithPrefabs image001.jpg]]
-
Open up the '''Database''' '''View''' by going to the main menu '''View > Open View Pane > Database View'''
+
-
Now, enter the Prefabs Library by left clicking its tab at the top of the window.
+
<br>
-
[[Image:Sandbox_WorkingWithPrefabs_image002.jpg]]
+
=== The Prefabs Library ===
 +
Open up the '''Database''' '''View''' by going to the main menu '''View &gt; Open View Pane &gt; Database View'''
-
==== Creating a new Library====
+
Now, enter the Prefabs Library by left clicking its tab at the top of the window.
-
To create a new library, click the '''Add Library''' button&#8230;
+
-
[[Image:Sandbox_WorkingWithPrefabs_image003.jpg]]  
+
[[Image:Sandbox WorkingWithPrefabs image002.jpg]]  
-
&#8230;and type in a new library name.
+
<br>
-
[[Image:Sandbox_WorkingWithPrefabs_image004.jpg]]
+
==== Creating a new Library ====
-
Make sure you click the Save Library, once you&#8217;re done.
+
To create a new library, click the '''Add Library''' button…
-
==== Loading a prefab library====
+
-
Next, lets load up an existing prefab library.  Go to the '''Load''' '''Library''' button.
+
-
[[Image:Sandbox_WorkingWithPrefabs_image005.jpg]]  
+
[[Image:Sandbox WorkingWithPrefabs image003.jpg]]  
-
Now, select a library, and press the open button. For the purposes of this tutorial, load '''buildings.xml'''
+
…and type in a new library name.  
-
[[Image:Sandbox_WorkingWithPrefabs_image006.jpg]]  
+
[[Image:Sandbox WorkingWithPrefabs image004.jpg]]  
-
Now, you can go into the prefabs library and find Village_House_1.  Left click, drag and drop the prefab into your level.
+
Make sure you click the Save Library, once you’re done.  
-
[[Image:Sandbox_WorkingWithPrefabs_image007.jpg]]
+
==== Loading a prefab library ====
-
=== Creating a new prefab===
+
Next, lets load up an existing prefab library. Go to the '''Load''' '''Library''' button.
-
Firstly, place the objects in your level that you wish to change into a prefab. Select all the objects you require
+
-
[[Image:Sandbox_WorkingWithPrefabs_image008.jpg]]  
+
[[Image:Sandbox WorkingWithPrefabs image005.jpg]]  
-
Next, go up to the Prefabs menu, and select '''Make From Selection''' <br>
+
Now, select a library, and press the open button. For the purposes of this tutorial, load '''buildings.xml'''  
-
[[Image:Sandbox_WorkingWithPrefabs_image009.jpg]]
+
-
Now, fill in a Group and Name for your new prefab.  The prefab will be created in your currently selected library.
+
[[Image:Sandbox WorkingWithPrefabs image006.jpg]]
-
[[Image:Sandbox_WorkingWithPrefabs_image010.jpg]]
+
Now, you can go into the prefabs library and find Village_House_1. Left click, drag and drop the prefab into your level.  
-
Now your prefab has been created and is ready to use in your level.
+
[[Image:Sandbox WorkingWithPrefabs image007.jpg]]
-
=== Prefab Object Properties===
+
=== Creating a new prefab ===
-
[[Image:Sandbox_WorkingWithPrefabs_image011.jpg]]
+
-
==== Prefab Params====
+
Firstly, place the objects in your level that you wish to change into a prefab. Select all the objects you require
-
'''Merge Static Geometry'''
+
-
Not used.
+
-
==== Prefab Parameters====
+
[[Image:Sandbox WorkingWithPrefabs image008.jpg]]
-
'''Prefab name'''  <br>
+
-
The name of the prefab, taken from the prefab library.
+
-
'''Object list''' <br>
+
Next, go up to the Prefabs menu, and select '''Make From Selection''' <br> [[Image:Sandbox WorkingWithPrefabs image009.jpg]]
-
A list of all objects within the prefab, alongside their object type.
+
-
'''Subobject info'''  <br>
+
Now, fill in a Group and Name for your new prefab. The prefab will be created in your currently selected library.
-
For the current object selected within the prefab:
+
-
Name: The name of the subobject <br>
+
[[Image:Sandbox WorkingWithPrefabs image010.jpg]]
-
Class: The main of the subobject (The main class type - for example, entity, brush, ambient volume, light) <br>
+
-
Type: The type of the subobject (The sub type - for example, destroyable object, constraint, AI grunt) <br>
+
-
'''Update Prefab'''  <br>
+
Now your prefab has been created and is ready to use in your level.  
-
Updates the selected prefab manually with any current edits.
+
-
'''Reload Prefab'''  <br>
+
=== Prefab Object Properties ===
-
Reloads the current prefab from the last saved version in the prefab library.
+
-
'''Pick and Attach'''  <br>
+
[[Image:Sandbox WorkingWithPrefabs image011.jpg]]  
-
Allows you to add an new object to the selected prefab, by clicking on it <br>
+
-
[[Image:Sandbox_WorkingWithPrefabs_image012.jpg]] <br> <br>
+
-
[[Image:Sandbox_WorkingWithPrefabs_image013.jpg]]  <br> <br>
+
-
'''Remove Object'''  <br>
+
==== Prefab Params ====
-
Allows you to remove an object from the selected prefab.  Select the object from the '''Objects List,''' then click the '''Remove''' '''Object''' button <br> <br>
+
-
[[Image:Sandbox_WorkingWithPrefabs_image014.jpg]]  <br> <br>
+
'''Merge Static Geometry''' Not used.  
 +
==== Prefab Parameters ====
-
'''Extract Object''' <br>
+
'''Prefab name''' <br> The name of the prefab, taken from the prefab library.  
-
Extracts a clone of a single object from the prefab without altering or removing anything from the prefab object itself.
+
-
[[Image:Sandbox_WorkingWithPrefabs_image015.jpg]]
+
'''Object list''' <br> A list of all objects within the prefab, alongside their object type.  
-
'''Extract All''' <br>
+
'''Subobject info''' <br> For the current object selected within the prefab:
-
Extracts all objects from the prefab without altering the prefab library
+
 +
Name: The name of the subobject <br> Class: The main of the subobject (The main class type - for example, entity, brush, ambient volume, light) <br> Type: The type of the subobject (The sub type - for example, destroyable object, constraint, AI grunt) <br>
-
'''Open''' <br>
+
'''Update Prefab''' <br> Updates the selected prefab manually with any current edits.  
-
Opens the prefab group, allowing you to edit and manipulate objects within it.
+
-
'''Close''' <br>
+
'''Reload Prefab''' <br> Reloads the current prefab from the last saved version in the prefab library.
-
Closes the prefab, so internal objects cannot be individually edited
+
-
[[Category:Official:Advanced - Environment Setup]]
+
'''Pick and Attach''' <br> Allows you to add an new object to the selected prefab, by clicking on it <br> [[Image:Sandbox WorkingWithPrefabs image012.jpg]] <br> <br> [[Image:Sandbox WorkingWithPrefabs image013.jpg]] <br> <br>
-
== See Also ==
+
'''Remove Object''' <br> Allows you to remove an object from the selected prefab. Select the object from the '''Objects List,''' then click the '''Remove''' '''Object''' button <br> <br>
 +
 
 +
[[Image:Sandbox WorkingWithPrefabs image014.jpg]] <br> <br>
 +
 
 +
<br> '''Extract Object''' <br> Extracts a clone of a single object from the prefab without altering or removing anything from the prefab object itself.
 +
 
 +
[[Image:Sandbox WorkingWithPrefabs image015.jpg]]
 +
 
 +
'''Extract All''' <br> Extracts all objects from the prefab without altering the prefab library
 +
 
 +
<br> '''Open''' <br> Opens the prefab group, allowing you to edit and manipulate objects within it.
 +
 
 +
'''Close''' <br> Closes the prefab, so internal objects cannot be individually edited
 +
 
 +
== See Also ==
 +
 
 +
[[Category:Official:Advanced_-_Environment_Setup]]

Версия 15:23, 23 мая 2011

Эта страница страница помечена как находящиеся в процессе перевода.


Содержание

Working With Prefabs

Overview

Prefabs are groups of objects which can be placed in your level as instances. An instance is an object which is an exact copy of every other object of the same type. When you edit one instance of an object, every other instance that exists in your game will change, either instantly or when the instance is reloaded.

Index

What are prefabs?

A prefab is a predefined group of objects. Every time you place down a prefab, each instance is precisely the same in every way. Altering a prefab will make it change everywhere it has been placed. Any alterations need to be saved to the prefab library to ensure they are correctly propagated across your entire game.

An example of a prefab

Sandbox WorkingWithPrefabs image001.jpg


The Prefabs Library

Open up the Database View by going to the main menu View > Open View Pane > Database View

Now, enter the Prefabs Library by left clicking its tab at the top of the window.

Sandbox WorkingWithPrefabs image002.jpg


Creating a new Library

To create a new library, click the Add Library button…

Sandbox WorkingWithPrefabs image003.jpg

…and type in a new library name.

Sandbox WorkingWithPrefabs image004.jpg

Make sure you click the Save Library, once you’re done.

Loading a prefab library

Next, lets load up an existing prefab library. Go to the Load Library button.

Sandbox WorkingWithPrefabs image005.jpg

Now, select a library, and press the open button. For the purposes of this tutorial, load buildings.xml

Sandbox WorkingWithPrefabs image006.jpg

Now, you can go into the prefabs library and find Village_House_1. Left click, drag and drop the prefab into your level.

Sandbox WorkingWithPrefabs image007.jpg

Creating a new prefab

Firstly, place the objects in your level that you wish to change into a prefab. Select all the objects you require

Sandbox WorkingWithPrefabs image008.jpg

Next, go up to the Prefabs menu, and select Make From Selection
Sandbox WorkingWithPrefabs image009.jpg

Now, fill in a Group and Name for your new prefab. The prefab will be created in your currently selected library.

Sandbox WorkingWithPrefabs image010.jpg

Now your prefab has been created and is ready to use in your level.

Prefab Object Properties

Sandbox WorkingWithPrefabs image011.jpg

Prefab Params

Merge Static Geometry Not used.

Prefab Parameters

Prefab name
The name of the prefab, taken from the prefab library.

Object list
A list of all objects within the prefab, alongside their object type.

Subobject info
For the current object selected within the prefab:

Name: The name of the subobject
Class: The main of the subobject (The main class type - for example, entity, brush, ambient volume, light)
Type: The type of the subobject (The sub type - for example, destroyable object, constraint, AI grunt)

Update Prefab
Updates the selected prefab manually with any current edits.

Reload Prefab
Reloads the current prefab from the last saved version in the prefab library.

Pick and Attach
Allows you to add an new object to the selected prefab, by clicking on it
Sandbox WorkingWithPrefabs image012.jpg

Sandbox WorkingWithPrefabs image013.jpg

Remove Object
Allows you to remove an object from the selected prefab. Select the object from the Objects List, then click the Remove Object button

Sandbox WorkingWithPrefabs image014.jpg


Extract Object
Extracts a clone of a single object from the prefab without altering or removing anything from the prefab object itself.

Sandbox WorkingWithPrefabs image015.jpg

Extract All
Extracts all objects from the prefab without altering the prefab library


Open
Opens the prefab group, allowing you to edit and manipulate objects within it.

Close
Closes the prefab, so internal objects cannot be individually edited

See Also