Skip to content
Thomas Thurman edited this page Jun 6, 2013 · 4 revisions

A ped is an identified point on the screen, possibly with an associated direction. Each ped is part of a particular room, and has a number between 1 and 15 within that room.

They are used in any case where a position must be specified but coordinates should not be hardcoded, but are particularly useful for three purposes:

  • When a sprite is initialised on a screen, its coordinates are initialised from a ped. The coordinates are matched to the middle of its bottom line, not its top left corner; this is where the name "ped" comes from, because it's where the sprite's feet start. Also has the ability to chain doors and exits to peds to build arbitrarily complex maps without recourse to hardcoding: see magic opcodes.
  • When a character is drawn as scenery rather than as a sprite, the ped shows where their speech bubble comes from.
  • It's sometimes useful to know the bearing of a particular sprite from a particular ped-- for example, whether it's left or right or above a particular point.

(TT: How does it know what colour to make the speech bubble?)

The direction byte of a ped may range from 0 (north) to 7 (northwest) inclusive, travelling clockwise around the compass. It may also be 177 if the ped has no associated direction.

Peds are stored within Also. They do not appear onscreen within the game. If they need to be represented in an editor, they are displayed as a circle whose centre is their point, with an optional line pointing in their associated direction.

Clone this wiki locally