Block event and flying object data
Data · Routines · Address index
Flying-object records, step counters, and the tables of throws, launches and party hits. The data page explains how the entries are written.
DS:0x5cff — Half-block steps
- Layout: 4 × 4 bytes, indexed by direction and position
- Role: The next position of a flying object in
the low two bits; bit
0x80means that it enters the next block, which receives a block event. For north, positions 0 and 1 go to 2 and 3 of the next block, positions 2 and 3 to 0 and 1 of the same block (bytes82 83 00 01 | 01 80 03 82 | 02 03 80 81 | 81 00 83 02): an object advances half a block per step. - Used by: On the floor and in the air › Throwing and launching items
DS:0xcc5c — Flying-object records
- Layout: 10 records of 18 bytes: +0 type (0 free, 1 item, 2 magic),
+2 launch word (1 until the object leaves its first block, cleared at
0x27eb3when the next step leads into another block), +4 block word, +6 position, +7 direction, +8 item word, +10 weapon type (items) or shape (magic), +11 signed launcher (the character's slot 0–5, −1 for a monster, a wall or a script; written at0x1d4d6and0x216f8, read by the hit test0x27d06–0x27d3a), +12 flags (0 for items), +13 range (12 for items), +14 far pointer to the magic hit routine; byte +1 is not written for items - Role: Objects in flight, created
(items), moved and
ended by the flying-object routines. Byte +10 is
read only for magic records, by the view's flying-object pass
(
0x3f204); for items it is written and cleared but never read: no instruction names it by its address, and neither the routines that address this table nor the routines they call read it. - Used by: On the floor and in the air › Throwing and launching items, Move the party, monsters or items › Moving items, Turn the party or flying objects › Behavior, Level records and level changes › Settling the level, Loading, failures and the end of the game
DS:0xdf4c — Record gate mask
- Layout: word
- Role: Gate applied by the record runner; set to
0xffff,0x40or0x10by its callers and cleared by the runner. - Used by: Block events › Wall activation and the 0xffff mask, Events that start scripts › Activating walls
DS:0x5a28 — Message scroll counter
- Layout: word, 0 in the image
- Role: Counts the party's moves; every fourth prints a
line end in the message window and resets it. The only accesses are at
0x24f58,0x24f5cand0x24f71. It lies outside the parts of a saved game (DS:0xe608,0x6dce,0x71ca,0x65fc,0x65fa,0xe4c5and0x979e; overlay code at file offsets0x498c5–0x49b32). - Used by: Move the party, Loading, failures and the end of the game
DS:0xe5c8 — Step counter
- Layout: word
- Role: Counts the party's steps; reset by the
step trigger and cleared by overlay routine
0x48ae7. - Used by: Events that start scripts, Timed scripts › Step-triggered script, Level data (INF)
DS:0xee1e — Steps until the step script
- Layout: word
- Role: Number of steps after which the
step trigger runs; written by overlay routine
0x48ae7. Character record 6, past the end of the characters, would start here, so its high byte is the status byte thatSCRIPT_MODIFY_CHARACTER_HPreads for slot 6. - Used by: Events that start scripts, Timed scripts › Step-triggered script, Change hit points › Edge cases, Level data (INF)
DS:0x3106 — Target order of a single-target object
- Layout: 64 bytes: 4 directions × 4 positions × 4 positions. Directions 0
and 2 hold
4 2 1 3,4 3 0 2,4 0 3 1,4 1 2 0; directions 1 and 3 hold4 1 2 3,4 0 3 2,4 3 0 1,4 2 1 0. - Role: For an object's direction and position, the positions of the block in the order in which the search prefers them: the centre (4), the quarter in line with the flight, the quarter beside the object, the opposite quarter.
- Used by:
DS:0x2352, DS:0x5530 — Quarter and character tables of a party hit
- Layout:
0x2352: 4 × 4 signed bytes, by party direction and absolute quarter;0x5530: 8 signed bytes - Role:
0x2352turns a quarter of the party's block (0 north-west, 1 north-east, 2 south-west, 3 south-east) into a quarter seen from the party (0 front left, 1 front right, 2 back left, 3 back right): rows0 1 2 3,2 0 3 1,3 2 1 0,1 3 0 2.0x5530gives two characters per relative quarter,0 −1,1 −1,2 4,3 5, read by a flying object hits the party. The launcher ammunition table starts one byte later. - Used by: Flying weapons › What a flying item hits, Formation › Who a projectile hits, Tools
DS:0x4714, DS:0x4750 — Throw buttons
- Layout: 2 button records at
DS:0x4714andDS:0x4750(entries 36 and 37 of the main button list); rectangles atDS:0x4732/0x476e, callbacks atDS:0x4744/0x4780, zone at+0x38 - Role: The left and right halves of the upper view, at (0, 8) and (88, 8), 88 wide and 48 high, calling the throw routine with zones 0 and 1.
- Used by:
DS:0x5a9d — Scripted launch positions
- Layout: 4 × 2 bytes, indexed by direction and side
- Role: For each direction, the two positions of the half of the block
behind the direction of travel: 2 3, 0 2, 1 0, 3 1; the first byte is the
left position, the second the right, relative to the direction of
travel. Used by
SCRIPT_LAUNCH_OBJECTwith its direction and offset bytes, for items and magic alike. - Used by: Launch an object › Behavior