Linedef type 259

From SRB2 Wiki
Jump to navigation Jump to search
To do
The FF_ flags have been deprecated and now have their FOF_ equivalent.

They are essentially identical, but FOF_SHATTERBOTTOM, FOF_INTANGIBLEFLATS, FOF_SHATTER, FOF_SPINBUST and FOF_STRONGBUST do not exist, and FOF_BOUNCY and FOF_SPLAT have been added and need descriptions. See https://wiki.srb2.org/wiki/User:LJ_Sonik/List_of_outdated_Lua_stuff

An example of using custom FOF – invisible shatter block.

Linedef type 259, Custom FOF, is a special type of floor over floor block which can be configured to have any combination of the properties possessed by other types of FOFs, e.g., whether it casts a shadow, whether it crumbles, and so on. This is useful in circumstances where none of the other FOF linedef types have the specific combination of properties required in a given situation.

Setup

To use this effect, create a control sector outside of your map, set one of its linedefs to have linedef type 259, and tag it to the desired target sector(s) within the map. The control linedef must be double-sided, so you should also create another sector which shares the control linedef with the control sector.

The flats (if the flags are set to render floor and ceiling), floor height, and ceiling height of the FOF are determined by the flats, floor height, and ceiling height of the control sector, and the sidedefs of the FOF's walls (if the flags are set to render sides) are determined by the sidedef of the control linedef.

The light level of the control sector will determine the brightness of the shadow cast by the FOF (if the flags are set to cast a shadow). If the light level of the control sector is lower than that of the target sector, then it will cast a dark shadow. If the light level of the control sector is higher than that of the target sector, then the FOF will illuminate the area below it. If the light level of the control sector is equal to that of the target sector, then the FOF will not affect the light of the area below it.

The properties of FOFs created with this linedef type are specified by the value of the control linedef's upper texture on its back sidedef. Rather than specifying an actual texture, the value is a combination of one or more of the following flags:

Flag name Value (Hex) Description
FF_EXISTS 1 The FOF exists. Without this flag, the FOF will not appear in-game at all – it will not be visible or tangible, and any special effects associated with it will not appear either. The flag can be added or removed at runtime via linedef type 445, which can be used to make FOFs appear or disappear dynamically. Every FOF should have this flag, unless it is not meant to appear immediately at level load because it will later be brought into existence at runtime.
FF_BLOCKPLAYER 2 The FOF is solid to the player.
FF_BLOCKOTHERS 4 The FOF is solid to the camera and all Objects besides the player.
FF_SOLID 6 (FF_BLOCKPLAYER + FF_BLOCKOTHERS) The FOF is solid to the player, all other Objects and the camera. Setting Flag [5] / Slope Skew / Effect 1 on the control linedef will remove FF_BLOCKOTHERS, while setting Flag [7] / No Midtexture Skew / Effect 2 will remove FF_BLOCKPLAYER.
FF_RENDERSIDES 8 The FOF's walls are rendered.
FF_RENDERPLANES 10 The FOF's floor and ceiling are rendered.
FF_RENDERALL 18 (FF_RENDERSIDES + FF_RENDERPLANES) The FOF's walls, floor, and ceiling are all rendered.
FF_SWIMMABLE 20 The FOF is a water block.
FF_NOSHADE 40 The FOF does not cast a shadow. Normally, the light level and colormap of the control sector affect the inside of the FOF and the area below it in the target sector. This flag disables that behavior.
FF_CUTSOLIDS 80 Any "solid" walls that are directly adjacent to the FOF will not be drawn. A wall is considered "solid" for this purpose if it belongs to the upper or lower texture of a two-sided linedef, the middle texture of a two-sided linedef, or an FOF without FF_EXTRA. Middle textures of two-sided linedefs and PolyObject walls are not considered "solid".
FF_CUTEXTRA 100 Any walls belonging to an FOF with FF_EXTRA that are directly adjacent to this FOF will not be drawn. If this FOF also has FF_EXTRA, the following extra conditions apply: If one of the two FOFs has FF_SWIMMABLE, the other must also have it in order for the walls to be cut. Similarly, if one has FF_FOG, the other must also have it. This flag is commonly used to remove walls between adjacent fog or water FOFs.
FF_CUTLEVEL 180 (FF_CUTSOLIDS + FF_CUTEXTRAS) Any walls that are directly adjacent to the FOF will not be drawn. Middle textures of two-sided linedefs and PolyObject walls are exempt from this. This flag should be set if the adjacent walls will never be visible anyway, to reduce the rendering effort. This is usually the case if the FOF is opaque and solid.
FF_CUTSPRITES 200 If a sprite is only partially inside the area illuminated by the FOF, the sprite is split vertically so that the light level and colormap are only applied to the affected part. This should generally be set for intangible or water FOFs that cast a shadow.
FF_BOTHPLANES 400 Both the inner and outer sides of the FOF's floor and ceiling are rendered. Without this flag, only the outer sides are rendered.
FF_EXTRA 800 The FOF can be obscured by other FOFs with the FF_CUTEXTRA flag set.
FF_TRANSLUCENT 1000 The FOF is translucent. Its alpha value is set in the front upper texture as a value between #000 (invisible) and #255 (opaque). If this value is omitted, it defaults to #128.
FF_FOG 2000 The FOF acts like a fog block.
FF_INVERTPLANES 4000 Only the inner sides of the FOF's floor and ceiling are rendered.
FF_ALLSIDES 8000 Both the inner and outer sides of the FOF's walls are rendered. Without this flag, only the outer sides are rendered.
FF_INVERTSIDES 10000 Only the inner sides of the FOF's walls are rendered.
FF_DOUBLESHADOW 20000 The light level and colormap of the FOF's control sector only affect the inside of the FOF, but not the area below it.
FF_FLOATBOB 40000 The FOF floats on water and bobs when stepped on.
FF_NORETURN 80000 Used with FF_CRUMBLE to prevent the FOF from reappearing in its original location once it has crumbled.
FF_CRUMBLE 100000 The FOF will fall one second after being stepped on. Unless FF_NORETURN is set, it will reappear in its original location after 15 seconds.
FF_SHATTERBOTTOM

FF_GOOWATER

200000 If combined with FF_BUSTUP, the FOF will only shatter when hit from below. If combined with FF_SWIMMABLE, the FOF acts like goo water.
FF_MARIO 400000 The FOF behaves like a Mario item block.
FF_BUSTUP 800000 The FOF behaves like a bustable block. It will shatter when touched in specific ways, such as being spindashed into from the side, being touched by Knuckles, being bounced on by Fang, or being hit by Amy's hammer. Flag [9] / Solid Midtexture / Effect 4 allows the FOF to be shattered by a pushable Object. Flag [10] / Repeat Midtexture / Effect 5 makes the FOF activate a linedef executor when it is shattered, using the control linedef's length to determine the tag of the linedef executor to activate.
FF_QUICKSAND 1000000 The FOF behaves like a quicksand block. The player's sinking speed and movement reduction are determined by the linedef's X distance and Y distance, respectively.
FF_PLATFORM 2000000 The FOF is intangible from below.
FF_REVERSEPLATFORM 4000000 The FOF is intangible from above.
FF_INTANGIBLEFLATS 6000000 (FF_PLATFORM + FF_REVERSEPLATFORM) The FOF's floor and ceiling are intangible, but its walls are still solid (provided that FF_SOLID is set).
FF_SHATTER 8000000 Used with FF_BUSTUP. The FOF will shatter upon contact.
FF_SPINBUST 10000000 Used with FF_BUSTUP. In addition to the usual conditions, the FOF will shatter when being touched by a player in their spinning frames, either from jumping or from spindashing.
FF_STRONGBUST 20000000 Used with FF_BUSTUP. The FOF will shatter only when a "strong" ability is used on it. This includes a character with CA_GLIDEANDCLIMB touching it from the side, the CA_BOUNCE ability being used on it from the top, and the CA_TWINSPIN or CA_MELEE abilities being used on it from anywhere. FF_SHATTER takes precedence over this.
FF_RIPPLE 40000000 The FOF's floor and ceiling will have a "ripple" effect, distorting both their flats and – if visible – the view displayed behind them. Note that this visual effect is exclusive to the Software renderer; this flag does nothing in OpenGL.
FF_COLORMAPONLY 80000000 The inside of the FOF and the area below it in the target sector are affected by the colormap of the FOF's control sector, but not the light level.

In most (but not all) cases, a typical custom FOF should at least have FF_EXISTS, FF_RENDERALL, and FF_CUTLEVEL.

The flags can be combined by performing a bitwise OR operation. The Windows Calculator applet can do this in its "programmer" mode (or "scientific" mode, for Windows XP and older). For example, to calculate the value required to set the FF_EXISTS and FF_FOG flags, switch into hexadecimal mode using the radio buttons at the top-left, enter 1, click Or, enter 2000 and click =. The result in this case will be 2001.

Sample

Example file: ex_ld259_customfof.wad (MAP01) 
  • This sample contains multiple custom FOFs, each of which demonstrates unique combinations of properties that cannot be achieved with standard FOFs.
  • The leftmost FOF is a quicksand water FOF.
  • The second FOF from the left is a spin-bustable Mario block that is intangible from above.
  • The third FOF from the left is invisible and tangible from the sides, but only for the player. Note that the fences are middle textures added to the target sector; they are not part of the FOF.
  • The rightmost FOF is an invisible shatter block.
How to use
  • You may load this file into your favorite map editor, such as Zone Builder. Select MAP01 as the map to load.
  • You may also load this file in the game:
    1. Save ex_ld259_customfof.wad into the addons folder of your SRB2 directory.
    2. Start SRB2, go to the Addons menu, and then select ex_ld259_customfof.wad.
    3. Start the game in Single Player mode.
    4. Press the Console button (~), and type in the command MAP MAP01 to access the example map.
  • When you load this file in the game, it replaces Greenflower Zone Act 1.
  Linedef typesFloor over floor [view]
Solid:
Solid, Opaque, ShadowcastingSolid, Opaque, Non-ShadowcastingSolid, TranslucentSolid, Sides OnlySolid, No SidesSolid, InvisibleIntangible from Bottom, OpaqueIntangible from Bottom, TranslucentIntangible from Bottom, Translucent, No SidesIntangible from Top, OpaqueIntangible from Top, TranslucentIntangible from Top, Translucent, No SidesOnly Tangible from Sides
Intangible:
Water, OpaqueWater, TranslucentWater, Opaque, No SidesWater, Translucent, No SidesGoo Water, TranslucentGoo Water, Translucent, No SidesIntangible, OpaqueIntangible, TranslucentIntangible, Sides OnlyIntangible, Invisible
Moving:
Air BobbingAir Bobbing (Adjustable)Reverse Air Bobbing (Adjustable)Dynamically Sinking PlatformWater BobbingRising Platform, Solid, Opaque, ShadowcastingRising Platform, Solid, Opaque, Non-ShadowcastingRising Platform, Solid, TranslucentRising Platform, Solid, InvisibleRising Platform, Intangible from Bottom, OpaqueRising Platform, Intangible from Bottom, Translucent
Crumbling:
Crumbling, RespawnCrumbling, No RespawnCrumbling, Respawn, Intangible from BottomCrumbling, No Respawn, Intangible from BottomCrumbling, Respawn, Intangible from Bottom, TranslucentCrumbling, No Respawn, Intangible from Bottom, TranslucentCrumbling, Respawn, Floating, BobbingCrumbling, No Respawn, Floating, BobbingCrumbling, Respawn, FloatingCrumbling, No Respawn, FloatingCrumbling, Respawn, Air Bobbing
Special:
Light BlockHalf Light BlockFog BlockMario BlockThwomp BlockShatter BlockShatter Block, TranslucentBustable BlockSpin-Bustable BlockSpin-Bustable Block, TranslucentQuicksandLaserCustom FOF