mapobject_grill

This mapobject allows you to add some alpha masked textures to your quake maps. The most important caveat is that these sprites are one sided, if the player can see both sides of your mesh you need to place two entities. The supplied sprites provide a variety of grills and wire meshes, but the “model” key allows you to specify your own.

Spawnflag 1 makes the mesh a static entity, and if this is not set, spawnflag 2 makes the mesh solid. Making it solid like this will prevent players and shots passing through (to block players but not attack you should use clipping brushes instead). The solid bounding box is aligned to the world axes, and although the size of the box adjusts to accommodate rotation, it will probably block too much if the mesh is rotated more that a few degrees away from alignment with the axes. If you are trying to clip off a 45 degree mesh, you should use clipping brushes or a func_togglewall.

The classname mapobject_grill64 creates a mapobject_mesh with “model” set to “progs/grill64.spr”. mapobject_grill128 is similar, but with the default model “progs/grill128.spr”.

Cache errors

If you’ve been testing your map extremely thoroughly, you may have encountered a crash in winquake with the error Cache_Alloc: allready allocated” (sic). This is a known error which occurs when a sprite gets replaced by an alias model in the winquake cache. The mapobject_grill family is particularly liable to cause it; if you include one in a map, a new sprite will be cached. Next level you are gambling on the model which reuses that slot being a bsp model instead of a .mdl file (bsp models can be safely loaded in sprite slots).

It is not possible in general to work around this issue in Quoth, but luckily it is fixed in almost all engines. If you are making a series of maps, and are encountering this bug in the later maps, first try adding a dummy mapobject_grill in these later maps to keep the sprite in the cache. You may need to ensure that the dummy is high up the list of entities in the map to refresh the cache slot of the sprite before things start getting evicted.

If this still fails, your last resort is to insert a “cache-clearing” map between the map with the grill and the map that crashes. The cache-clearing map should contain as many brush-based models as limits allow, which ought to safely remove the sprite from the cache. You only need load it for an instant to clear the cache, so you can spawn the player in a changelevel trigger without intermission to go straight onto the next map. Of course, the down side of this trick is that you’ve cleared out the model cache so everything has to be reloaded, but at least it doesn’t crash.

<-Back to the tutorial

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s