Linedef type 254

From SRB2 Wiki
Jump to navigation Jump to search
Knuckles destroying a bustable block.

Linedef type 254, Bustable Block, is a type of floor over floor block that can be shattered by a variety of actions, including spindashing into it from the side, touching it from the side as Knuckles, bouncing into it from above as Fang, or breaking it with Amy's hammer. When shattered, it generates the bustable block sprites, produces crumbling ambience (sound sfx_crumbl), and hides inside the floor of the sector it is in. This allows it to be respawned after it is busted by raising it back up to its former height. When it is set to have a texture similar to that of surrounding sectors, it is useful for concealing secret items or paths in a level.

Busting conditions

There are two varieties of bustable blocks: strong and weak. Strong bustable blocks can be busted by the following actions:

  • Being touched by Knuckles (or any custom character with the CA_GLIDEANDCLIMB ability or SF_CANBUSTWALLS flag) from the side.
  • Being bounced on by Fang's tail bounce ability (CA_BOUNCE) from above and below.
  • Being smashed by Amy's hammer abilities (CA_TWINSPIN and CA2_MELEE) from any direction.

Weak bustable blocks can be busted by all of the above, and also the following:

By default, bustable blocks are weak. They can be made strong by setting Flag [6] / Not Climbable on the control linedef.

Setup

The flats, 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 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 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.

If Flag [6] / Not Climbable is checked, the FOF is turned into a strong bustable block. This is useful for creating character-exclusive paths in a level. If Flag [9] / Solid Midtexture / Effect 4 is checked, this block can be shattered by a pushable Object. If Flag [10] / Repeat Midtexture / Effect 5 is checked, a linedef executor will be activated when the block is shattered. In this situation, the tag of the trigger linedef of the linedef executor to activate is determined by the length of the control linedef.

Respawning

Because bustable blocks turn off FF_EXISTS when shattered, effectively making them disappear completely, they must be respawned by turning on this flag again. The most convenient way of doing this is using the Make FOF Disappear/Reappear (linedef type 445) linedef executor with Flag [6] / Not Climbable applied, which will immediately make the FOF reappear when executed. The Make FOF Disappear/Reappear linedef should have its front X texture offsets match the tag of the FOF's target sector in-level, and front Y texture offsets matching the tag of the FOF's control sector.

To create a timed respawning effect, the FOF's control linedef should be given Flag [10] / Repeat Midtexture / Effect 5 and given a length that corresponds with the tag of the trigger linedef (e.g., Continuous) to execute the Make FOF Disappear/Reappear linedef, as this then allows the FOF's destruction to execute the linedef. The Make FOF Disappear/Reappear linedef itself should then be given a delay using Flag [3] / Upper Unpegged – a back sector for the linedef is then needed to determine the delay in tics, which corresponds to the sector's ceiling height.

Alternatively, Lua is also capable of turning back on FF_EXISTS in the FOF's flags – this requires searching through all FOFs located in the FOF's target sector to find the one you want.

Example code using "sector" as a sector_t variable, and "rover" as a ffloor_t variable, and turning on FF_EXISTS for any FOF if it is not already applied:

for rover in sector.ffloors()
	if not (rover.flags & FF_EXISTS)
		rover.flags = $1 | FF_EXISTS
	end
end

Samples

Sample 1

Example file: ex_ld254_fofbustableblock.wad (MAP01)
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_ld254_fofbustableblock.wad into the addons folder of your SRB2 directory.
    2. Start SRB2, go to the Addons menu, and then select ex_ld254_fofbustableblock.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.

Sample 2

Example file: ex_ld254_fofbustableblock_knuckles.wad (MAP01) 
  • This bustable block can be only shattered by Knuckles or any skin with the ability 2.
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_ld254_fofbustableblock_knuckles.wad into the addons folder of your SRB2 directory.
    2. Start SRB2, go to the Addons menu, and then select ex_ld254_fofbustableblock_knuckles.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