Custom Special Objects: Difference between revisions
New page: ''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 objec... |
|||
Line 15: | Line 15: | ||
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. | 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 == | == Grabables and Pushables == |
Revision as of 13:55, 29 March 2009
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 static loot. Take any similar static loot item and change its model to what you want. Adjust any other properties such as loot value and inventory icon if you can.
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
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.)