Lootable items

From Divinity Engine Wiki
Revision as of 14:07, 27 September 2017 by RvdBerg (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.

Setup

Layer

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:

  • Your mesh, which is named <LayerName>
  • Your physics mesh, which is named <LayerName>_phys


Even though it is not always needed, it would be best 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. Start by selecting your mesh, go to the Utilities tab, scroll down until you find LarianPhysics and press MakeRigidBody.
Now pick Kinematic from the drop down menu.

Exporting

Exporting the visual is straight forward. 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

Start by opening your Content Browser, now select the proper package you want to add your visual to.
Once selected add the resource by pressing the Add Resource button. Now you can choose to add your model or physics.
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.


Adding resources

After importing all you resources it is time to add all of them together. To start, open your 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. Now you can 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 what you will actually use to place all of your combined visuals.
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.

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.
First select the resource in your Content Browser, now select the resource slot in the createObjectWizard. A ... button should appear on the right.
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.