| Classnames: | env_* |
| Purpose: | Decoration, Vandalism, Utility |
| code: | g_obj.c (mostly) |
|
There are a very large numbers of `objects' (buckets, barrels, statues,
trees, corpses, instruments of torture, ...) that can be placed in
Heretic II levels for decoration, the enjoyment of vandalism, and
occasionally a useful purpose. Although there are many, fortunately
their behavior is fairly simple and uniform. In the first place most objects should have an angle or angles key, which specifies the direction they point (of course for round objects this may not matter). The value of angle is a number, indicating the 2d orientation of the object in degrees counterclockwise from East (.e.g. 90 means north, -90 or 270 South). The value of angles is a triple of numbers Y Z X, which orients the object in three dimensions, by rotating the direction it points in succession around the Y, Z and X axes. So for example if you have a corpse whose head would point east with no angle or angles key, you can make the head tilt up by having 15 as the first number, and then spin it around so the head points north by putting 90 as the second number. If you want to mess with this stuff, you'll probably have to experiment, unless you have a good math background. But one simple point is that the angle key overrides the angles key, so there's no point in having both. Another useful key as abslight, whose value is also a triple of numbers, giving the Red, Green and Blue components of an inherent glow given of by the object. Next comes scale, which can be used to adjust the object's size. Its useful values seem to be from about .1 to 2.5 (larger produces wierd effects). Objects are subdivided by a number significant properties. Some can be broken by bashing, others can't. The hurtable objects can take a health key that specifies how much damage they take before breaking; this will of course do nothing for the non-bashable ones. When you hit a non-hurtable object in the map with the staff, it makes a clanging sound, rather than one that suggests that the staff is biting in and doing something. Some objects can be animated, while others can be pushed around (if they're tall enough), and in any event fall to the ground when spawned, unlike the non-pushable ones, which float in midair. So the hanging pots are non-pushable (so you can stick them against the wall & they look like they're hanging), while the flat pots are pushable (so they'll always appear sitting in the table), even though they're too flat to actually push anywhere. There are also a number of spawnflags that recur with objects, and help to control their behavior. Spawnflag 1 INVULERABLE will make a hurtable object non-hurtable, while spawnflag 2 ANIMATED will animate an animatable object; the flag to flutter, the cauldron to bubble, the firepot to have a fire, etc. Finally spawnflag 8 NOPUSH will cause a pushable object to become nonpushable. In the original code comments most of these spawnflags are specified for all objects, regardless of whether they're applicable, with or without comment as to whether they work. I've tried to sort all this out for the Quark and Qoole entity help, but have surely made some errors-tell me of any you find. BSP, QERadiant and other editors that use the original game code as the basis for their help will probably the original info. Beyond this, some objects have additional keys and spawnflags, as detailed in the entity sets for the various editors, Jon Zuk's entity liset, etc. And there is finally the matter of `object targetting'. First, all objects can take a targetname key. Some objects do something interesting when their targetname is triggered (for example the obj_hivepriestessssymbol [yes indeed all four s's are really part of its name) appears in the map), but all, even the unhurtable ones or ones with the INVULERABLE spawnflag checked, will be destroyed if an entity that `killtargets' them fires. Killtargetting is when an entity has a key killtarget, whose value is a name; if the entity fires then all of the entities with that name as their targetname value are destroyed. Suppose for example you make a table with an obj_caulron on it, with the table made out of breakable_brushes so that it can be destroyed. It would look very stupid to have the table smashed with the cauldron floating in its original position, so you should have the top of table killtarget the cauldron. Now when the table breaks, the cauldron explodes as well. Objects can themselves take target and killtarget fields, so you could have a door open when a cauldron is destroyed. They can also take a delay field, which specifies an interval (in seconds) between when the object is destroyed and when it actually fires its targets and killtargets. So you could make a line of bottles, so that breaking one would make the next break after three seconds, and so on (not that I can think of any reason why you want to do that, but who knows). So that's what I know at this point, below is a summary of the keys, spawnflags and their uses. |
| angle | value is a number, direction the object points, expressed as counterclockwise rotation from East. Overrides angles. |
| angles | value is a triple of numbers, a 3d angle expressed as rotations around the Y Z X axes in succession. If you want to use this, don't use an angle field, because it will override it. |
| scale | value is a number, adjusting size of object. Useful values are between .1 and 2.5. More useful that scale in Hexen II, because bounding boxes seem to be handled correction. |
| abslight | value is a triple of numbers 0-255, inherent glow of object in RGB components. The code comments say that a fourth number A for alpha (transparency) is also possible, but this seems to do nothing for me (it's also disrecommended as a bad performance hit). |
| health | value is a number, hit points to destroy object. Only works for some objects, and not at all if spawnflag 1 INVLNERABLE is checked. |
| targetname | value is a name, shared by target or killtarget key of some entity that activates or destroys the object. If it's killtarget, the object is destroyed when the entity fires; it it's target, the object is activated, if it's one of the few that do anything. Unlike in Hexen II, objects are not destroyed by being targetted, they must be killtargetted (and always disappear by breaking, not silent vanishing). |
| target | value is a name, shared by targetname key of an entity that is triggered when the object is destroyed. So a door might be made to open when a statue is destroyed. |
| killtarget | value is a name, shared by targetname key of an entity that is itself destroyed when the object is destroyed. |
| delay | value is a number, time interval between when the object is destroyed and when it fires its targets and killtargets. |
| spawnflags |
|