Warp

From SM64Decomp Wiki
Jump to navigation Jump to search

Warps are used to teleport Mario from one location to another in the same area, a different area or different level. They can be connected to each other within a level, between different areas or levels.

Warps are defined per area by the following properties:

  • Warp type: one of Warp, Painting, Instant
  • Warp ID, also known as source ID: value from 0x00 to 0xFF unique per area
    • Commonly set to 0x0A for the area starting location
    • IDs 0xF0 - 0xF3, 0xF8, 0xF9 and 0xFA have special meanings
      • 0xF0 is used on level success (after Mario grabbed a star)
      • 0xF1 is used on level failure
  • Destination level
  • Destination area
  • Destination node: ID given to the warp object (param 2) that's placed in the target area.

In order to connect two places with each other, you would need to:

  1. Place a warps object in the destination area (e.g. "Warps 60 (Instant Active)").
    1. Give the warp object an ID (param 2) unique in the destination area, for example 0xB1.
  2. Define the warp node in the source area.
    1. Give it an ID unique to the current area and not reserved for special purposes (see above), for example 0xA1.
    2. For the destination node, select the warp object ID, for example 0xB1.
  3. Place a "Warp" object in the source area that shall trigger the warp.
    1. Set param 2 to the warp node to trigger (as defined in the source area), for example 0xA1.
    2. Optionally set param 1 to specify the radius of the warp (in 10 units). Default (0x00) is 50 units, 0xFF is 10,000 units. The height is always 50 units.

Using the example values above, a warp object may trigger the warp node 0xA1 in the source area, teleporting Mario to the warp object 0xB1 in the destination.

In order to create a warp to the other direction, simple follow the same steps again, with source and destination areas reversed.