Player
From Wherigo Foundation Wiki
Revision as of 13:22, 22 April 2018 by Ranger Fox (Talk | contribs) (Created page with "The Player object represents the person playing the game. == Properties == {| class="wikitable" |CompletionCode||String||Code, which is used to mark the cartridge as complet...")
The Player object represents the person playing the game.
Properties
CompletionCode | String | Code, which is used to mark the cartridge as completed on www.wherigo.com. |
Name | String | The player's name. Set when the cartridge is downloaded. For cartridges published locally to your own PC, always "Builder". |
Id | String | Is always "-1". |
InsideOfZones | Table | A table containing a reference to each zone object which currently contains the player. The player can be in more than one zone at a time if the zones overlap. |
Inventory | Table | A table containing a reference to each item object which is in the inventory of the player. |
LastLocationUpdate | Time | Time when the position of the player is last updated. |
ObjectLocation | ZonePoint | Read-only. ZonePoint which gives the current location of the Player. Contains latitude, longitude and altitude. |
ObjIndex | Number | Object index of player. Normally -21555. |
PositionAccuracy | Distance | Read-only. Distance which gives the current GPS position accuracy. |
Methods
GetActiveTimers(Player self) | Returns table | Table with all timers where property Running is true. |
GetActiveVisibleTasks(Player self) | Returns table | Table with all active and visible tasks. First all incomplete tasks sorted by SortOrder and than all completed tasks sorted by CompletedTime. |
GetActiveVisibleZones(Player self) | Returns table | Table with all active and visible zones. |
GetVisibleInventory(Player self) | Returns table | Table with all objects in the inventory that are visible. |
GetVisibleObjects(Player self) | Returns table | Table with all visible and active objects in all visible and active zones. |
InsideOf(obj) | Returns boolean | Checks if Player is inside of obj. |
IsObjectVisible(obj) Returns boolean. Checks, if the object obj is visible to Player. Object could be of type Zone, ZTask, ZItem or ZCharacter.