User Tools

Site Tools


Sidebar

hpl2:tutorials:model_editor:tutorial_1

Model Editor - Basic Tutorial *WIP*

The Model Editor is where you make collision for your model, set specific object type settings(lever, door, wheel, lamp etc.) add joints, lights, particles, billboards and sounds.

To get a model into the Level Editor we need to use the Model Editor (I recommend that you read this before going any further) to make a entity file (.ent).

For this tutorial we will go through a very basic edit of a already existing box.


First open ModelEditor.exe located in the game redist folder and select import in the main menu. Locate entities\container\wood_box02 and load file wood_box02.dae (COLLADA format).
We will start with creating a shape that match the shape of the imported model. To do this select “shapes” in the EditMode sidebar to the left, and in the EditMode window to the right you can see that “box” is selected.
Place the object by simply left clicking on the viewport, select the object and change X and Z positions to 0 to make it centered.
By pressing R key you can scale the shape to match it with the imported model. Fortunately this model was made using even numbers of 0.1m so set the shape sizes and positions as this image shows:
modeleditor_boxshape01_640x480.jpg
Now when this shape is still selected click the shape tab to the right of the window and select “Create Body” to make this shape a body(You would use and select more shapes if this object was more detailed and make a body from that).

Now we need to connect this body to the box model. There is two ways to do this:
1.Select the body. If you cant select the body because the box model gets selected instead, uncheck “All” in “select object type” options in the top right corner and select one of the “Bo” (there is one for bones and one for bodies) boxes.
In the bodies tab attachments select “Attach” an then press on the box model in the viewport, then press “Done”.
2.In the main menu go to View→Outline. Here you can see the all the submeshes, shapes, joints, particle systems, bodies etc.
Select the Body you have created and click on the “Edit attachments” button, then select the submesh (pCube1 in this case).

Now that you have connected the body to the box model we need to set some properties to make the box physics behave realistically.
Set the options as this picture shows:
modeleditor_bodyproperties01_640x480.jpgNow that you have set the body properties try the physics by pressing the “Test” button(click again to get out of test mode) at the bottom of the window.
Testing physics like this always works in test mode if you have done the previous steps right.
To get it to work in the game go to main menu→Settings→User defined Variables.
Change “Type” to “Object” and then “Subtype” to “Grab”.
Press OK and save!

*notes*
-You dont need to make entities for static objects (like walls, floors, stairs etc.)
-Keep shapes as simple as possible, think performance.

hpl2/tutorials/model_editor/tutorial_1.txt · Last modified: 2011/04/24 12:52 by mrbigzy