Hpl3:Community:other:setting up an item

From Frictional Wiki
Jump to navigation Jump to search

Setting up a Basic Item

Items in SOMA work quite a bit differently, this tutorial will show how to do a basic item. this guide is written minutes after I made my first item so it will be updated by me or others in the future.

STEP 1 Open the model editor

STEP 2 import your item's .dae 3d model as you would when setting up any other kind of entity. give it a body, and set up physics and such if you want to.

STEP 3 Go to Entity Settings → Class

STEP 4 Set the class as prop_tool

STEP 5 Expand the tool tab and configure the following:

HudObjectEntity: Not sure if this is needed for item to work, but type in the name of your item, and add _hud.ent at the end of its name. fx if I had an item named lighter_item.ent, I would type in lighter_item_hud.ent. we will create this file later

InventoryIcon write the name including the filetype of your inventory icon. I have only confirmed .tga files to be supported so far, and they should have a size of 128×128 with alpha(transparancy) around the object icon unless it fill all 128×128 pixels. the standard SOMA inventory only uses black white and alpha, but you can use colors if you want to as well.

STEP 6 (possibly optional, will have to test it) Save your file as an entity in mods/mymodfolder/assets. After saving you click SAVE AS again, and save a copy of your item in the same place, but name it with _hud.ent after its name this time.

STEP 7 Delete bodies and other interactive stuff from you entity, leave only the things that are visual which will usually only be the model itself.

STEP 8 Go to Entity setting → Class and change the class to Prop_HudObject and make sure to save.

STEP 9

Method 1: Open your level editor. Place a standard SOMA entity in your map where you want your item to be. Click on entity file and using the file broswer locate your item. Note this method will only work if your item is located in "mods"/mymodfolder/"assets"/

Method 2: Go to SOMA/entities and add a folder just for your own entities. Open your level editor and locate the entity from your folder, then place it where you want it. This method has the risk of causing conflicts with where the map points to the files, and is not recommended, unless you have a lot of items and cannot afford to repeat method 1 many times.

STEP 10 voula! you now have an item you can place in your mod. When you pick it up the generic hand animation should play with your item in the hand, though it will probably be a little misplaced and floating. Should be a way to set the item to fit the hand though. As well if you press tab your inventory icon should appear.

here is some pictures of "my" first item, which is the lighter from urban/ornament. 2015-10-08 00002.jpg2015-10-08 00003.jpg2015-10-08 00004.jpgits possible to give items specific icon for interactions, so if we figure out how to do a custom icon we could do stuff like a flame if you were going to light something with the lighter, or whatever suits your tastes.