Difference between revisions of "Hpl2:Tutorials:model editor:tutorial 1"

From Frictional Wiki
Jump to navigation Jump to search
(Upload from wiki)
 
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
= Model Editor - Basic Tutorial *WIP* =
+
=Model Editor - Basic Tutorial *WIP*=
  
  
Line 5: Line 5:
  
  
To get a model into the [[:hpl2:tools:editors:level_editor|Level Editor]] we need to use the [[:hpl2:tools:editors:model_editor|Model Editor]] (I recommend that you read this before going any further) to make a entity file (.ent).
+
To get a model into the [[HPL2/Tools/Level Editor|Level Editor]] we need to use the [[HPL2/Tools/Model Editor|Model Editor]] (I recommend that you read this before going any further) to make a entity file (.ent).
  
  

Latest revision as of 21:52, 8 August 2020

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.