Surface Classes - Nobonet/sm64-roblox GitHub Wiki

What's this?

This page lets you know how to define some surface classes for BaseParts. It's mainly the use of tags and attributes.

Click here to see the list of available surface classes.

Floor surface classes

The attribute "FloorSurfaceClass" takes the top-most priority.

SurfaceClass..._QUICKSAND

  • To define a quicksand surface it should either have a tag named "Quicksand", have "quicksand" mentioned in the instance's name (case insensitive), and define the quicksand type via an attribute named "QuicksandType".
  • The quicksand types can be:
    • INSTANT_QUICKSAND, INSTANT_MOVING_QUICKSAND (lethal, instant)
    • SHALLOW_QUICKSAND, SHALLOW_MOVING_QUICKSAND (depth of 10 units, 25 units if moving)
    • DEEP_QUICKSAND, DEEP_MOVING_QUICKSAND (lethal, slow, depth of 160 units)
    • QUICKSAND, MOVING_QUICKSAND (depth of 60 units)
  • if the surface is of MOVING type, you can add a number attribute named "Force" to set the angle, in world space. This number can go from 0 to 768 (256 * 3). If the force is 0 (or 256), it will move Mario on the +Z Axis (128 is -Z). If the force is 64, it will move Mario on the +X Axis (192, or 128+64, is -X). The speed gets slower the higher the number is, in increments of 256 (Speeds: 12, 8, 4, 0). (mario_step.c#L172)

DEEP_QUICKSAND quicksand properties

SurfaceClass.BURNING

  • To define a burning surface (or also called Lava), it should either have a tag named "Lava" or the part's material set to CrackedLava.

SurfaceClass.DEATH_PLANE

  • Currently only accessible via FloorSurfaceClass attribute
  • This class checks, if Mario is below (FloorHeight + 2048), then "kill" him.
  • This class must be handled manually by your own choices. If you either have a level warp system, or just setting Mario's health to 0.

SurfaceClass.VERTICAL_WIND

  • Currently only accessible via FloorSurfaceClass attribute
  • Mario only gets vertical propulsion from under a certain point of the world. offsetY = m.Position.Y - -1500.0, -3000.0 < offsetY and offsetY < 2000.0
  • This class has a death barrier check, like DEATH_PLANE. (Must be handled manually)

Wall surface classes

The attribute "WallSurfaceClass" takes the top-most priority.

SurfaceClass.BURNING

  • To define a burning surface (or also called Lava), it should either have a tag named "Lava" or the part's material set to CrackedLava.

Ceiling surface classes

The attribute "CeilSurfaceClass" takes the top-most priority.

SurfaceClass.HANGABLE

  • To define a Hangable ceiling (or also called monkey bars), it should either have a tag named "Hangable" or the part's material set to DiamondPlate.
  • Shoutouts to simpleflips

Surface planes

Surface planes only act when Mario's under a certain height of where the raycast hit them (example). They also cannot be overriden by floor/ceil detection, and extend downwards semi-infinitely.

You'd want to have CanCollide set to false for these planes.

Poison/toxic gas cloud plane

  • These planes make Mario start taking damage over time. To use this, add a tag to a BasePart named "PoisonGasCloud".

poisongascloud gas cloud properties

Water planes

  • Standard water plane, if you don't intend on using Roblox terrain water. To use this, add a tag to a BasePart named "Water".

ignore the hands water properties

Special

Squishing ceilings

  • You can define a part that can squish Mario (e.g. thwomps) by using the tag "SquishMario" or if the part is Unanchored.

Collision Ignores

  • The tags CollIgnoreWall, CollIgnoreFloor, CollIgnoreCeil make certain collision checks get ignored.
  • Example: You can use this for staircases which if you have intention for these to allow BLJs, using CollIgnoreWall
  • If you use CollIgnoreFloor, it may cause an exposed ceiling. (Semi-intentional behavior)