Difference between revisions of "My first: Item - Lootable items"

From Divinity Engine Wiki
Jump to: navigation, search
(Created page with "Creating a lootable asset is relatively easy compared to the other assets we have. The asset usually exist out of 3D mesh and a single physics mesh.<br /> This guide will expl...")
 
m (Protected "My first: Item - Lootable items" ([Edit=⧼protect-level-larianeditonly⧽] (indefinite) [Move=⧼protect-level-larianeditonly⧽] (indefinite)))
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
Creating a lootable asset is relatively easy compared to the other assets we have. The asset usually exist out of 3D mesh and a single physics mesh.<br />
 
Creating a lootable asset is relatively easy compared to the other assets we have. The asset usually exist out of 3D mesh and a single physics mesh.<br />
 
This guide will explain how we export these assets from 3DS Max and import them in the editor.
 
This guide will explain how we export these assets from 3DS Max and import them in the editor.
 +
 
<br />
 
<br />
 +
This article is part of a collection of guides, with a page for every type of item.
 +
 +
{| class="wikitable"
 +
|-
 +
| [[My first: Item | General]]
 +
|-
 +
| [[My first: Item - Scenery | Scenery]] (Rocks, plants, trees, shelves, etc.)
 +
|-
 +
| [[My first: Item - Lootable items | Lootable items]] (Shells, plates, food, gems, etc.)
 +
|-
 +
| [[My first: Item - Interactable animated items | Interactable animated items]] (Levers, doors, etc.)
 +
|-
 +
| [[My first: Item - Interactable socket items | Interactable socket items]] (Chairs, beds, etc.)
 +
|-
 +
| [[My first: Item - Weapons | Weapons]] (The sharp stuff)
 +
|-
 +
|}
 +
 
<br />
 
<br />
<big>''' Setup '''</big>
+
=Setup=
 +
==Layer==
 +
 
 +
The name of your layer will be the name of your visual, so it is best to pick something logical. <br />
 +
Inside this layer you could/should only have the following:
 +
* Your '''visual mesh'''
 +
*:Named '''<LayerName>'''
 +
* Your '''physics mesh'''
 +
*:Named '''<LayerName>_phys'''
 +
Always try to follow the Larian naming conventions.
 +
 
 
<br />
 
<br />
 +
==Physics==
 +
 +
Lootable items always ''need'' a physics mesh, this mesh ''needs'' to be '''convex''' and '''kinematic'''. <br />
 +
You can create this physics mesh from any convex mesh, however it should not be to complicated and thus a box is usually advised.<br />
 +
#Select your mesh.
 +
#Go to the '''Utilities''' tab.
 +
#Scroll down until you find '''LarianPhysics'''.
 +
#Press '''MakeRigidBody'''.
 +
#Pick '''Kinematic''' from the drop down menu.
 +
 
<br />
 
<br />
'''Layer'''
+
= Exporting =
<br />
+
 
<br />
+
Exporting the visual is straight forward. <br />
The name of your layer will be the name of your visual, so pick something logical. Inside this layer you could/should only have the following:<br />
+
Just make sure your mesh and physics mesh are in the same layer.<br />  
<br />
 
* Your mesh, which is named '''<LayerName>'''
 
* Your physics mesh, which is named '''<LayerName>_phys'''
 
<br />
 
Even though it is not always needed, it would be best to follow the Larian naming conventions.
 
<br />
 
<br />
 
'''Physics'''
 
<br />
 
<br />
 
Lootable items always ''need'' a physics mesh, this mesh ''needs'' to be '''convex''' and '''kinematic'''. You can create this physics mesh from any convex mesh, however it should not be to complicated and thus a box is usually advised.
 
Start by selecting your mesh, go to the '''Utilities''' tab, scroll down until you find '''LarianPhysics''' and press '''MakeRigidBody'''.<br />
 
Now pick '''Kinematic''' from the drop down menu.
 
<br />
 
<br />
 
<big>''' Exporting '''</big>
 
<br />
 
<br />
 
Exporting the visual is straight forward. Make sure your mesh and physics mesh are in the same layer.<br />  
 
 
You do '''not''' have to export anything other then the visuals and physics.<br />
 
You do '''not''' have to export anything other then the visuals and physics.<br />
 +
 
<br />
 
<br />
 +
= Importing =
 +
==Importing your visuals==
 +
 +
# Open the [[Content browser]].
 +
# Select the proper package you want to add your visual to.
 +
# Add the resource by pressing the '''Add Resource''' button.
 +
# Choose to add your model or physics.
 +
Once you added your files you can find them in your content browser either by selecting the proper package and finding it or using the search bar at the top.
 +
 
<br />
 
<br />
<big>''' Importing '''</big>
+
==Adding resources==
 +
 
 +
After importing all you resources it is time to add all of them together:
 +
# Open the [[Content browser]].
 +
# Find your visual, double click it and a new window will open.
 +
# You will start on the '''Materials''' tab, here you will see each of your meshes inside the exported visual.
 +
# Select the mesh you want to add the texture to, now ''find'' and ''select'' your texture in the [[Content browser]].
 +
# Add your texture by clicking the '''<-''' button.
 +
 
 
<br />
 
<br />
<br />
+
==Creating a root template==
'''Importing your visuals'''
+
 
<br />
+
With all your resources imported and setup properly we can now add it all to a root template. <br />
<br />
+
The template is the combination of all your resources and is what you will actually place in-game.<br />
Start by opening your '''Content Browser''', now select the proper package you want to add your visual to.<br />
 
Once selected add the resource by pressing the '''Add Resource''' button. Now you can choose to add your model or physics.<br />
 
Once you added your files you can now find it in your content browser either by selecting the proper package and finding it or using the search bar at the top.
 
<br />
 
<br />
 
<br />
 
'''Adding resources'''
 
<br />
 
<br />
 
After importing all you resources it is time to add all of them together. To start, open your '''Content Browser'''.<br />
 
Find your visual, double click it and a new window will open. You will start on the '''Materials''' tab, here you will see each of your meshes inside the exported visual.<br />
 
Select the mesh you want to add the texture to, now ''find'' and ''select'' your texture in the '''Content Browser'''. Now you can add your texture by clicking the '''<-''' button.
 
<br />
 
<br />
 
<br />
 
'''Creating a root template'''
 
<br />
 
<br />
 
With all your resources imported and setup properly we can now add it all to a root template. The template is what you will actually use to place all of your combined visuals.<br />
 
 
To make things easy whenever you want to create your template find something similar in the '''Root Template''' browser, right click it and select '''create new from selected'''.<br />
 
To make things easy whenever you want to create your template find something similar in the '''Root Template''' browser, right click it and select '''create new from selected'''.<br />
 
This will prevent any extra work in the form of scripting, naming or checking any of the important features.<br />
 
This will prevent any extra work in the form of scripting, naming or checking any of the important features.<br />
 
<br />
 
<br />
Once you '''create new from selected''' a new window will open called '''createObjectWizard''' here you can add the new '''Physics Resource ID''' and '''Visual Resource ID'''.<br />
+
#Press right-click > '''create new from selected''' a new window will open called [[Create object wizard]].
First select the resource in your '''Content Browser''', now select the resource slot in the '''createObjectWizard'''. A '''...''' button should appear on the right.<br />
+
#Add the new '''Physics Resource ID''' and '''Visual Resource ID'''.
Now simply press the '''green arrow''' button and you are done. You might have noticed the naming of the template changed automatically to the name of the visual resource. You are allowed to change this if you want.
+
#:Select the resource in your '''Content Browser''', now select the resource slot in the [[Create object wizard]]. A '''...''' button should appear on the right.
 +
#:Press the '''arrow''' button for the appropriate field in the [[Create object wizard]] and you are done.  
 +
You might have noticed the naming of the template changed automatically to the name of the visual resource. You are allowed to change this if you want.
 +
 
 +
<br />
 +
 
 +
= See also =
 +
 
 +
{| class="wikitable"
 +
|-
 +
| [[My first: Item | General]]
 +
|-
 +
| [[My first: Item - Scenery | Scenery]] (Rocks, plants, trees, shelves, etc.)
 +
|-
 +
| [[My first: Item - Lootable items | Lootable items]] (Shells, plates, food, gems, etc.)
 +
|-
 +
| [[My first: Item - Interactable animated items | Interactable animated items]] (Levers, doors, etc.)
 +
|-
 +
| [[My first: Item - Interactable socket items | Interactable socket items]] (Chairs, beds, etc.)
 +
|-
 +
| [[My first: Item - Weapons | Weapons]] (The sharp stuff)
 +
|-
 +
|}

Latest revision as of 10:41, 2 October 2017

Creating a lootable asset is relatively easy compared to the other assets we have. The asset usually exist out of 3D mesh and a single physics mesh.
This guide will explain how we export these assets from 3DS Max and import them in the editor.


This article is part of a collection of guides, with a page for every type of item.

General
Scenery (Rocks, plants, trees, shelves, etc.)
Lootable items (Shells, plates, food, gems, etc.)
Interactable animated items (Levers, doors, etc.)
Interactable socket items (Chairs, beds, etc.)
Weapons (The sharp stuff)


Setup

Layer

The name of your layer will be the name of your visual, so it is best to pick something logical.
Inside this layer you could/should only have the following:

  • Your visual mesh
    Named <LayerName>
  • Your physics mesh
    Named <LayerName>_phys

Always try to follow the Larian naming conventions.


Physics

Lootable items always need a physics mesh, this mesh needs to be convex and kinematic.
You can create this physics mesh from any convex mesh, however it should not be to complicated and thus a box is usually advised.

  1. Select your mesh.
  2. Go to the Utilities tab.
  3. Scroll down until you find LarianPhysics.
  4. Press MakeRigidBody.
  5. Pick Kinematic from the drop down menu.


Exporting

Exporting the visual is straight forward.
Just make sure your mesh and physics mesh are in the same layer.
You do not have to export anything other then the visuals and physics.


Importing

Importing your visuals

  1. Open the Content browser.
  2. Select the proper package you want to add your visual to.
  3. Add the resource by pressing the Add Resource button.
  4. Choose to add your model or physics.

Once you added your files you can find them in your content browser either by selecting the proper package and finding it or using the search bar at the top.


Adding resources

After importing all you resources it is time to add all of them together:

  1. Open the Content browser.
  2. Find your visual, double click it and a new window will open.
  3. You will start on the Materials tab, here you will see each of your meshes inside the exported visual.
  4. Select the mesh you want to add the texture to, now find and select your texture in the Content browser.
  5. Add your texture by clicking the <- button.


Creating a root template

With all your resources imported and setup properly we can now add it all to a root template.
The template is the combination of all your resources and is what you will actually place in-game.
To make things easy whenever you want to create your template find something similar in the Root Template browser, right click it and select create new from selected.
This will prevent any extra work in the form of scripting, naming or checking any of the important features.

  1. Press right-click > create new from selected a new window will open called Create object wizard.
  2. Add the new Physics Resource ID and Visual Resource ID.
    Select the resource in your Content Browser, now select the resource slot in the Create object wizard. A ... button should appear on the right.
    Press the arrow button for the appropriate field in the Create object wizard and you are done.

You might have noticed the naming of the template changed automatically to the name of the visual resource. You are allowed to change this if you want.


See also

General
Scenery (Rocks, plants, trees, shelves, etc.)
Lootable items (Shells, plates, food, gems, etc.)
Interactable animated items (Levers, doors, etc.)
Interactable socket items (Chairs, beds, etc.)
Weapons (The sharp stuff)