Linedef type 1
Linedef type 1, Per-Sector Gravity, is a type of linedef special which sets the gravity of any tagged sector. It can be used to decrease or increase the gravity of a sector or even flip it to reverse gravity. In SRB2, this effect is used most prominently used in Egg Rock Zone. Note that this linedef type only modifies the gravity of a specific sector. If the player leaves the sector, gravity will change back to normal. To flip the player's gravity regardless of their position, use linedef type 433 instead. To change the gravity for the whole level, use the level header parameter Gravity
.
This linedef type is only available in the binary map format. In UDMF, a sector's gravity can be set directly as a sector property.
Setup
The gravity's strength is determined by the floor height of the control sector. It is measured in relation to the global gravity of the level, so if the global gravity is modified with the Gravity
level header parameter, this affects per-sector gravity as well. If the floor height is 1000, then the target sector will have 100% of the global gravity. If the floor height is 500, the target sector will have 50% of the global gravity.
Negative values result in negative gravity, which does not flip sprites or physics but merely pulls mid-air players and other Objects to the ceiling. Players who jump off the floor in this kind of gravity will therefore continue to rise up until they eventually become stuck under the ceiling, still in their jump animation (they are still able to move horizontally). To prevent this, give the control linedef Flag [6] / Not Climbable – this will instead give reverse gravity for negative gravity strength values, which will properly flip sprites and physics, allowing players and other Objects to land on the ceiling properly.
If Flag [13] / Effect 6 is set in addition to Flag [6] / Not Climbable, then the flag MF2_OBJECTFLIP
will be removed from any Object entering the sector. This effectively replaces the Object's permanent, sector-independent reverse gravity with temporary reverse gravity that will be lost upon leaving the sector.
UDMF
Removed in UDMF in favor of the gravity sector field and the gravityflip sector flag. They can be changed at runtime with linedef type 469.
|
Sample
- Example file: ex_ld001_persectorgravity.wad (MAP01)
- The effect is applied to four sectors in this level. The yellow sector has normal gravity, the red sector has low (50%) gravity, the blue sector has reverse gravity, and the green sector is split in half with the use of an intangible, invisible FOF: The lower half of the sector has normal gravity, but the upper half has reverse gravity. The player can switch to reverse gravity by jumping and back to normal gravity by jumping again.
How to use |
---|
|