Custom Special Objects

From The DarkMod Wiki
(Redirected from Custom Moveables)
Jump to navigationJump to search

written by Fidcal

Introduction

New object entities can be defined by the advanced mapper and included with an FM for distribution.

An alternative is to take an existing object entity and give it a new model and modify other properties. This is appropriate in some cases but in others it creates difficulties. A good example is loot...

Creating a Custom Loot Object

To make any object into loot do the following:

  • Create some other loot, eg a goblet. If you want the item to be pushable then choose from the moveable loot otherwise static. I prefer to set critical items static so they don't get knocked down a drain or something by accident. If the item you eventually want has no collision model then you *have* to choose static else you will get an error so I recommend static generally.
  • In entity inspector click the check box at top left to show inherited properties.
  • Scroll down to model and select it.
  • At the bottom a button will appear 'Choose Model'
  • Click it and select the model you want eg, dagger
  • Select inv_loot_value and enter the value you want it to have. Look at the values of some other items if you need to get some idea of relative values. Click the green button or press Enter after entering the value to set it.
  • Select inv_icon. There is likely no icon for your item. There is a default loot icon available with the Dark Mod first release. To use this enter guis/assets/hud/inventory_icons/loot_icon_generic in its field. In Saint Lucia I don't think loot items showed in the inventory but in the future they will. Enter 'none' for now if you are using the Saint Lucia Assets. I think it doesn't show anything in your copy. Ideally, you can make an icon image but I won't go into that now.
  • You can now click 'show inherited properties' checkbox if you want to hide them.

Definitions: Grabables, Pushables, Inventoryables

grabables, pushables, inventoryables all need more care.

  • A grabable is an item that highlights and the player can pick up, manipulate, and move around and drop but it does not go in the inventory.
  • A pushable is an item that does not highlight but the player can push it around.
  • An inventoryable is an item that highlights and goes directly into the inventory. From there it can optionally be dropped via the grabber (when it can be carried, manipulated) and eventually dropped.

There are three entities especially defined to make it easier for mappers to set up a special object in the map editor without having to create a new external definition. All essential or common properties are presented ready to modify easily with info at the point of use.

Remember: There may already be a suitable entity defined for the model you want - always check first.

Grabables and Pushables

If you want to enable an existing static model to be grabable or pushable but not go in the inventory and there is no existing moveable entity for it then use:

atdm:grabable_custom_item

  • Create a atdm:grabable_custom_item (in darkmod/Items/Custom/)
  • Look at the properties and read the info there; use the mouse to get popup info.
  • Adjust the properties as needed.
  • In particular, you MUST:
    • enter a model name.
  • In addition look at snd_bounce to set an appropriate impact sound
  • Also consider mass, etc.
  • If you want it to be pushable only and not be grabable then just set frobable 0

Potentially the most difficult problem will be if the model has no collision model (cm.) To find out, create your above grabable in your map and try to play it in Dark Mod. If there is no cm then you will get an error in the console like this example:

ERROR: idMoveable 'atdm_grabable_custom_item_1': cannot load collision model models/darkmod/decorative/birdcage.lwo

You now have various options:

  • If you know how to model you can modify the model, give it a collision mesh and include this with your FM when distributed.
  • You can create an external cm file (see .Moveables#Create a Collision Model (CM))
  • You can use the clipmodel of a similar sized model that does have a cm. To do this:
    • Add the property clipmodel and give it any name eg, xxx
    • Select it in the list in entity inspector.
    • Click the Choose Model button at the bottom of entity inspector.
    • Select a suitable model. Note that this is trial and error unless you have prior information and the chances of finding a suitable model may not be great. Example:
      • Use the model models/darkmod/mechanical/gauges/gauge_round.ase
      • Give it clipmodel models/darkmod/kitchen/cheapbeermug.lwo and it does work but the beermug cm is a little large so the gauge floats slightly.


Inventoryables

These are of two types: Static Undroppables and Moveables or Droppables


Static Undroppables

If you just want a static object to be able to go in the inventory and never dropped (eg, an objective to steal a special object) then use:

atdm:static_custom_item

Then follow as for the following moveable type. The advantage of using this static version is you need not worry whether the model has a collision model. So, if the object does not need to be pushable and you don't need the object to be dropped then use this static version; it's easier.


Moveables or Droppables

If you want to enable an existing static model to be grabable or pushable AND go in the inventory and there is no existing moveable entity for it then use:

atdm:moveable_custom_item

  • Create a atdm:moveable_custom_item (in darkmod/Items/Custom/)
  • Look at the properties and read the info there; use the mouse to get popup info.
  • Adjust the properties as needed.
  • In particular, you MUST:
    • enter a model name.
    • enter a UNIQUE inventory name. If another object has the same inventory name then only one can go in the inventory at any one time.
  • Look at snd_bounce to set an appropriate impact sound
  • Also consider mass, etc.

The same collision model problem arises as for grabables (see #Grabables and Pushables for details and solutions.)