Map Location Data (6) Pads, Triggers & Holes - HoraceAndTheSpider/Bloodwych-68k GitHub Wiki

A Pad / Floor Trap or Trigger is identified within the map data, in the second byte within the location's map data word (AB CD), whereby the final digit (D) is equal to '6'.

To best understand the definition of each floor location, it is best to translate the two bytes (AB) and (CD) to binary, and consider which binary bits (right to left) contain defining information.

The Type of Floor Tile

Bits 0-1 of the (AB) byte are used to allocate the floor tile a number from 0-3. This number will define the type of floor tile in occurrence. 0 = Spell Fizzle 1 = Floor Hole / Pit 2 = Green Trigger Pad 3 = Invisible Trigger Pad

Ceiling Hole / Pit Above

All floor locations have the option of having a hole in the ceiling at the location. This is defined by bit 2 of the (AB) byte. If the bit is 'on' the hole in the ceiling will appear.

Spell Fizzle Zone

Where a location has been designated a Spell Fizzle area, there is only one parameter available, the appearance of a pit in the ceiling, as mentioned above.

All other values are redundant.

Floor Hole / Pit

Where a location has been designated a Floor Hole / Pit, there is only one parameter available, the appearance of a pit in the ceiling, as mentioned above.

All other values are redundant.

Trigger Pad

Where bit 1 of the (AB) byte is set, it is automatically designated a 'Trigger' pad, used to trigger some other in-game event, such as the removal of another wall, there are three parameters available.

By setting bit 0 of the (AB) byte, it will determine whether this 'Trigger' pad is visible (green) or invisible. The 'on' postion designates the pad as invisible.

The appearance of a pit in the ceiling can also be determined, as mentioned above, by setting bit 2 of the (AB) byte.

The remaining bits 3-7 of (AB) assigns the 'trigger' to a pre-defined function. These bits can be converted to a number, from 0-31, which will act as a reference to the action performed by the switch.

The action performed by a Trap / Trigger

The action performed by this reference number is defined in a separate data-block. For information on this see: Pad / Floor Traps & Triggers

Location Occupancy

The value of C determines the current occupancy of this location, as previously defined in: Map-Location Data - (0) Spaces