Moveables
Originally written by SneaksieDave & Ishtvan on http://forums.thedarkmod.com/topic/3968
Physics fans rejoice! If you want an object to be moveable (pick up and carry, push, float, shoot, etc.), even though it wasn't designed to be used that way, there is a way to do it anyway, and all within the editor.
Create a Collision Model (CM)
In DoomEd:
- Create a brush, convert it to moveable_base, and assign it the model you want to use.
- Drag a new brush over the model, roughly covering it. This will be the collision hull, so get it as close as you can. Convert that brush to func_clipmodel. Texture it with common/collision.
- With that brush still selected, do Selected->Export->To CM. Locate the model for which it will stand as a clipmodel, and save with the same name. The path and name are vital. Don't worry, DoomEd will automatically name it .cm instead by of your model's extension, so it shouldn't overwrite anything.
In DarkRadiant it is even easier:
- Create a model (, select "Create Model").
- In the model selector, click under Advanced the checkbox "Surround with MonsterClip brush"
- Click
- Press H to hide the newly created model
- Select the remaining MonsterClip brush
- Use the Edit -> Create CollisionModel from selection menu entry:
That's it. If you're working in the same map, delete the collision model and continue. There's no need to restart, if you named your file as described in step 3. The new object will exist in the world as a moveable item, and you'll only have to tweak its properties.
Addendum: Make sure the origin of the model and the origin of the CM coincide, or you may get undesirable results (objects falling out of the world, etc.). The form of the brush created in step 2 does not need to be rectangular. If the model is simple enough (like a 6-face crate), you don't have to create a collision model, the visual model will automatically be used for the moveable collision model.
Complete List of Key/Values
"Moveable object. Will drop to the floor and rest untill activated." "The visual model set with the 'model' key can also be used for" "collision detection. However the model may not be too complex." "max vertices = 32" "max edges = 32" "max polygons = 16" ""max edges per polygon = 16" "The collision model must be an enclosed hull. Dangling polygons or" "edges are not allowed. If the visual model is too complex or does" "not meet these requirements it can be contained in a less complex" "model for collision detection. Such a collision model is specified with the" "'clipmodel' key." "editor_var density" "Volume of the object times the density is the mass." "editor_var friction" "Friction with contacting surfaces in the range [0-1] where 0 is no friction." "editor_var bouncyness" "How much the object bounces in the range [0-1] where 0 is no bounce." "editor_var mass" "Mass of the object (overrides density)." "editor_model clipmodel" "Model to be used for collision detection." "editor_var clipshrink" "Shrink the visual model with an epsilon and use it as a clip model." "editor_var allowStep" "Set to 0 to prevent monsters from ever walking over this object." "editor_var nonsolid" "Make the object non-solid." "editor_bool nodrop" "Do not drop to the floor." "editor_bool noimpact" "Do not activate by the impact of other objects." "editor_bool notpushable" "Do not allow to be pushed." "editor_bool unbindondeath" "Unbind entity when health drops down to or below zero." "editor_var health" "If set the visual model changes to 'broken' when the health drops down to or below zero." "editor_model broken" "Visual model to be used when the health drops down to or below zero." "editor_bool explode" "If set to 1 the moveable explodes and is removed when the health drops down to or below zero." "editor_var init_velocity" "Initial linear velocity set when activated." "editor_var init_avelocity" "Initial angular velocity set when activated." "editor_var init_velocityDelay" "Delay in seconds before the initial linear velocity is set after being activated." "editor_var init_avelocityDelay" "Delay in seconds before the initial angular velocity is set after being activated." "editor_var initialSplineTime" "Number of milliseconds the moveable should follow the initial spline path." "editor_var damage" "Damage definition if it damages things it collides with" "editor_var damageWhenActive" "Only damage when active ( currently for the vagary and influence stuff )" "editor_var fx_collide" "FX system to start at impact position when object collides."
Default Settings
"density" "0.5" "friction" "0.05" "bouncyness" "0.6" "explode" "0" "unbindondeath" "0" "health" "0" "nodrop" "0" "noimpact" "0" "notPushable" "0" "clipshrink" "0" "allowStep" "1" "snd_bounce" "smallpanel_impact "