From SkyCorp Global
|Note - this entity is a modification for The Underworld. You can put it in-game by visiting the Debug Mod Control Panel in the debug rooms. The debug rooms are accessed via the Debug Box, an item available to all Private Build Backers which is located in the first room you spawn in (Ex's Apartment).|
This entity is intended for example purposes to demonstrate an object that can check its location and the player's location. It could also be useful for finding the RoomID of various in-game rooms.
Entity JSON Code
LUA Source Code
function description() -- 'this' is a predefined keyword that refers to this entity (in this case, -- the GPS) location = this.getLocation(); -- All text will be added to 'descriptionText' string, and returned. descriptionText = "The GPS blinks, displaying black text on a lime green " .. "LCD screen: '"; -- Check if GPS item is in inventory or in world if location == null then -- Item's Location is null, which means GPS is in player inventory. -- Because of this, this script must check player location instead of -- item location. location = Player.getInstance().getLocation(); descriptionText = descriptionText .. "In player's inventory @ "; else descriptionText = descriptionText .. "In the world @ "; end -- Add RoomID & Map Name to description text descriptionText = descriptionText .. "RoomID " .. location.roomID .. ", Map " .. location.getMap().getName() .. "'"; -- Return text to be displayed by game return descriptionText; end