GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • WaspLib documentation

This view

  • Original page
  • New address

GeezerVison is showing docs.waspscripts.com — Map Objects

Map Objects¶

The game objects of the loaded map, read straight out of the game cache: where each one stands, what it’s called, what it can be clicked for, and what it looks like.

Everything comes from the same cache the map itself is drawn from, so it’s always in step with the game, and the objects of a region are only read once that region is part of the map.

Example:

{$I WaspLib/main.simba}
var
  booths: TObjectArray;
begin
  Map.Setup([EChunk.VARROCK]);
  booths := TObjectArray.Create(Map.Walker, MapObjects.GetByAction('Bank'));
end.

TMapObjectData¶

One kind of object and every place it stands on the loaded map.

  • ID, Name, Category and Actions come from the object’s definition. Actions are the ones its right-click menu shows, in menu order.

  • Typ is the shape it’s placed as: 10 is an ordinary object, 0 to 3 walls, 4 to 8 wall decorations and 22 ground decorations.

  • Coordinates and Rotations are where it stands, as Global Points, and which way each of those copies is turned, 0 to 3.

  • Size is its footprint in tiles and Height how tall it is, in the game’s units: a tile is 128.

  • Colors are the colours it is drawn in, most common first.

Height and Colors come from the object’s models, which are only built when the object is asked for - see MapObjects.Build.


TMapObjects¶

Record holding the TMapObjectData of every object on the loaded map.

  • Definitions are the definitions of Data, in the same order, for building their models.

  • Lookup turns an object id into its place in Data, stored one higher so 0 means none.

  • Loaded holds the chunks already read, as x, y with the plane packed in with them.


MapObjects.Coordinate¶

function TMapObjects.Coordinate(tile: TPoint; size: TPoint; plane: Integer): TPoint; static;

The Global point an object whose south west tile is tile, and which covers size tiles once turned, is stored at.

Vertically it is the middle of the object. Horizontally it is half a tile west of the middle, which is where the object data WaspLib used to download put it. It is kept that way so objects line up exactly where they always have.


MapObjects.Resolve¶

function TMapObjects.Resolve(constref objects: TObjectDefinitionArray; id: Integer; out def: TObjectDefinition): Boolean; static;

The definition object id is shown as, if it’s one a script can interact with.

Some objects change with the player’s progress and are placed as a stand-in whose definition only lists what it can turn into. Those are shown as the first of their forms that has a name. Objects without a name, or that can’t be interacted with, like most decorations, are left out.


MapObjects.Actions¶

function TMapObjects.Actions(constref def: TObjectDefinition): TStringArray; static;

The actions def’s right-click menu shows, in the order it shows them.


MapObjects.Add¶

procedure TMapObjects.Add(constref def: TObjectDefinition; locType, rotation: Integer; coordinate: TPoint);

Internal method that records one placement of def, adding the object if it’s the first one.


MapObjects.DrawnPlane¶

function TMapObjects.DrawnPlane(constref region: TRegion; constref loc: TWorldLocation): Integer; static;

The plane loc is drawn on, and so the one it’s seen and clicked on, which isn’t always the one it’s stored on. The same rule the client uses: under a bridge, what’s stored on a plane is drawn on the plane below it.

A tile flagged with 8 doesn’t move what’s on it. The flag only lets the tile be seen from the planes below it, like a rooftop seen from the street.


MapObjects.Load¶

procedure TMapObjects.Load(var loader: TMapLoader);
procedure TMapObjects.Load(); overload;

Reads the objects of every chunk loader has loaded that hasn’t been read yet. Without a loader it reads Map’s. The getters below call this, so it rarely needs calling directly.

An object belongs to the plane it’s drawn on - see MapObjects.DrawnPlane.


MapObjects.Build¶

procedure TMapObjects.Build(idx: Integer);

Internal method that builds the models of Data[idx] with TObjectModel to fill in its Height and Colors.

Only the colours that cover most of the object make it into Colors: the most common ones, until COVERAGE of its faces are accounted for. The rest are slivers and rarely lit corners that would only widen what a colour finder looks for.


MapObjects.GetByName¶

function TMapObjects.GetByName(name: String; amount: Integer = 0): TMapObjectDataArray;

Every object called name. Pass amount to stop after that many objects.

Example:

WriteLn MapObjects.GetByName('Bank booth');

MapObjects.GetByID¶

function TMapObjects.GetByID(id: Integer): TMapObjectData;

The object with the id id. It has no Coordinates if there is no such object on the map.


MapObjects.GetByAction¶

function TMapObjects.GetByAction(action: String; amount: Integer = 0): TMapObjectDataArray;

Every object with action in its right-click menu. Pass amount to stop after that many objects.

Example:

WriteLn MapObjects.GetByAction('Bank');

MapObjects.GetByAllActions¶

function TMapObjects.GetByAllActions(actions: TStringArray; amount: Integer = 0): TMapObjectDataArray;

Every object with all of actions in its right-click menu. Pass amount to stop after that many objects.


MapObjects.Clear¶

procedure TMapObjects.Clear();

Forgets every object read so far, so the next getter reads the map again from scratch.


MapObjects variable¶

Global TMapObjects variable, holding the objects of Map.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.