TERRAIN

From ZDoom Wiki

Jump to: navigation, search

Overview

The TERRAIN lump is used to add sounds, liquid splashes and damaging effects to certain flats. The most common use is to create splashing sounds (ala Hexen's and Heretic's water, lava and so on), but it can also be used to give the player a custom landing sound when dropping onto a particular flat. For instance, if the player lands on a wood flat you may want to hear a heavy 'clunk' sound, and on a metal flat you'll want a metal 'clang' sort of sound. That's in the very simple sense, and not always altogether effective (since it's not footstep sounds, they only occur when the player lands on the flat for the first time).

If you don't want to actually learn anything you can just download the example wad from Enjay's site ( http://members.lycos.co.uk/Enjay001/ , it's the second file down) and be done with it. You'll need those sprites anyway as I believe they all have reserved names, though the sounds can be defined in SNDINFO and thus can have any name you wish.

You create entries in the TERRAIN lump using Splash and Terrain blocks. You then apply the effects of these blocks to certain flats using the Floor command.

Splash blocks

Splash blocks are defined as follows:

    splash <unique name>
    {
    	smallclass		<small class>
    	smallclip		<clipping of small chunks?>
    	smallsound		<sound (defined in [[SNDINFO]])
    
    	baseclass		<base class>
    	chunkclass		<chunk class>
    	chunkxvelshift		<x velocity of chunks>
    	chunkyvelshift		<y velocity of chunks>
    	chunkzvelshift		<z velocity of chunks>
    	chunkbasezvel		<z velocity of base>
    	sound			<sound (defined in [[SNDINFO]])
    }
    

The first set of definitions is for small splashes (based on the mass of the thing hitting the flat) and the second set (starting with 'baseclass') is for normal splashes. The classes for each are as follows:

WaterSplash - small water splashes
WaterSplashBase - normal water splashes
BloodSplash - small blood splashes
BloodSplashBase - normal blood splash
SlimeChunk - small nukage chunks
SlimeSplash - normal nukage splash
LavaSmoke - smoke (for lava or 'hot' rocks)
LavaSplash - splash of lava (normal sized)
SludgeChunk - small sludge (brown slime) chunks
SludgeSplash - normal sized sludge splash

Next are the sounds for each splash type which are defined in SNDINFO. Thus they can be anything, so if you'd like you can make water splashes sound like the Cyberdemon awaken sound (though this is not recommended). I'm not entirely sure what the velocity shift or clipping values are, but a value of 12 for smallclip, and 8 for the first three velocities and 1 for the final one seem to be in the norm. Hopefully someone else can fill this part out.

Terrain blocks

Terrain blocks are defined as follows:

    terrain <unique name>
    {
    	splash			<splash block name>
    	footclip		<pixels>
    	liquid
    
    	friction		<float value>
    
            damagetype              <type>
            damageamount            <value>
            damagetimemask          <value>
    }
    

Once again <unique name> must be unique to all the other terrain blocks, however you may have a splash block with the same name (so splash water and terrain water can co-exist just fine). <splash block name> defines the splash type to take place for this terrain definition, which was previously defined in a splash block. footclip is a integer value which shows the number of pixels (relative to the height of the player, so scaled sprites need not worry) that will be clipped off things that are placed (or walk onto) the flat which is linked to this terrain definition. Note there is a flag in DeHackEd which will allow you to prevent a thing from being clipped which is (I believe) nofloorclipping regardless of the terrain it stands on. I'm not sure what the final line in there 'liquid' is for, but it seems to be necessary ;)

The friction line is optional, it takes a float value (1.0 normal friction, bigger than 1.0 -> icy, smaller -> muddy)

The damage* lines are also optional, and have the effect of applying automatic damage to any sector with the specified flat placed on the floor. DamageType is the type of damage to apply. This correlates directly to damage types defined in Decorate. DamageAmount specifies how much the player is damaged each time damage is applied. DamageTimeMask determines how often damage is applied, based on the current gametic. A value of 35 would apply damage once per second, since there are 35 tics in one second. Higher values mean more time between damage events, and lower values mean damage is applied more often. Doom uses a value of 31 for its standard sector damage specials.

Floor command

Finally we use the floor command to define the actual flats that get the terrain treatment. This is simply:

    floor <flatname> <terrain name>
    

Where <flatname> is the name of the flat (if a flat is animated it's best to define each frame here) and <terrain name> is the name of the terrain block (defined above) which you want to correspond to <flatname>.

Personal tools