Warp (class)

From PGE Wiki
Jump to: navigation, search

This class provides fields/functions for managing Warps in the current level. (LunaLua ≥v0.7)

Warp class
Type Function/Field Return values/Value type Description
Constructor myWarp = Warp(int internalIndex) Warp Construct a new Warp-Object. Only use this constructor with caution. Use Warp.get() instead!
function Warp:mem(int offset, int fieldtype, object value) nil Sets a value of the Warp struct at a specific address-offset.
function Warp:mem(int offset, int fieldtype) object Returns a value of the Warp struct at a specific address-offset.
Field Warp.entranceX double The x coordinate of warp entrance.
Field Warp.entranceY double The y coordinate of warp entrance.
Field Warp.exitX double The x coordinate of warp exit.
Field Warp.exitY double The y coordinate of warp exit.
Field Warp.levelFilename string The level-filename of the warp.

Offsets

Warp Memory (0x90 bytes)
Name Memory address Memory type Description
Is locked 0x00 FIELD_WORD Whether the warp is locked (keyhole)
Allow carried NPCs 0x02 FIELD_WORD Whether carried NPCs can be brought through the warp
No Yoshi 0x04 FIELD_WORD Whether Yoshi is allowed
Unknown 0x06 FIELD_WORD Unknown
Layer name 0x08 VB6 String Pointer Entrance's layer name
Is hidden 0x0C FIELD_WORD Is hidden flag
Unknown 0x0E FIELD_WORD Unknown
Unknown 0x10 FIELD_WORD Unknown
Stars required 0x12 FIELD_WORD The number of stars required to use the warp
Entrance position 0x14 Momentum
Exit position 0x44 Momentum
Warp Type 0x74 FIELD_WORD 0 = instant, 1 = pipe, 2 = door
Unknown 0x76 FIELD_WORD Unknown
Level filename 0x78 VB6 String Pointer The filename of the level this warp loads
Warp number 0x7C FIELD_WORD The warp number
Is level entrance 0x7E FIELD_WORD Whether this warp takes the player to a different level
Entrance direction 0x80 FIELD_WORD 1 = up; 2 = left; 3 = down; 4 = right
Exit direction 0x82 FIELD_WORD 1 = down; 2 = right; 3 = up; 4 = left
Is level exit 0x84 FIELD_WORD Whether this warp ends the level
World map X 0x86 FIELD_WORD X coordinate on the map the player is moved to
World map Y 0x88 FIELD_WORD Y coordinate on the map the player is moved to
Unknown 0x8A FIELD_WORD Unknown
Unknown 0x8C FIELD_WORD Unknown
Unknown 0x8E FIELD_WORD Unknown