Explanation for the items:
Each hex has got a few corresponding variables -- p_x_y_s_n, p_x_y_s_n_name, p_x_y_s_n_file, p_x_y_s_n_type
where x,y are the coordinates of the hex and n means the nth item slot on the hex. 
Each hex can contain 5 items thus they have 5 slots. 
The variable with the n_file ending stores the name of the image file that represents the item. 
The variable with the n_type ending stores the type of the item, e.g. weapon, unknown
The variable with the n_name ending stores the name of the item to be displayed to the users.
The variable with the n ending stores the identifier of the item

Each unit has a few extra variables stored in their variables tag: isholdingitem, theitem, theitemname, theitemtype, theitemfile
isholdingitem stores 0 or 1 with 1 meaning that the unit is carrying an item. Weapons are excluded.
theitem stores the identifier of the item
theitemname stores the name of the item to be displayed to the users
theitemfile stores the name of the file with the image of the item
theitemtype stores the type of the item, e.g. weapon, unknown

# wire
# Wire
# items/wire.png
# unknown

# straw_bale1
# Straw bale
# items/straw-bale1.png
# burnable

# straw_bale2
# Straw bale
# items/straw-bale2.png
# burnable

# grain_sheaf
# Grain sheaf
# items/grain-sheaf.png
# burnable

# key
# Key
# items/key.png
# unknown

# scimitar
# Scimitar
# items/scimitar.png
# weapon

# torch
# Torch
# items/torch.png
# weapon

# rock2
# Rock
# scenery/rock2.png
# rock

# rock4
# Rock
# scenery/rock4.png
# rock

Explanation for backdrops:
Each hex has got a corresponding variable p_x_y_b_n.
p_x_y_b_0 stores the number of backdrop images at (x,y)
p_x_y_b_i for i>0 stores the image file for each backdrop.
When an item is picked up from the floor, all items and backdrops are removed. Then the backdrops are placed back, and finally the unremoved items are placed back.

Explanation for the Prison doors:
Each door is made of a special terrain with string=xx, and an image of the rusty gate
Beware that sometimes the door's location is referred to using the position from which the door could be opened.
The doors are placed at defined positions and there are defined locations where each individual door can be opened
Each door's opening location has a corresponding variable door_closed_x_y which is yes if door's closed and no if door's open
door_closed_x_y is used for storing if the door is closed.
The use item menu item can be triggered at each door's opening location if a unit possess the correct items, e.g. wire, key.
Unlocking door would change the variable door_closed_x_y and the terrain
When the incidents associated with the opening of the door has occured, closed_door_x_y is set to 'done'

Explanation for the weapons system:
Initially each trainee/Carac has only the fist attack
Their unit type id are Trainee/Carac
Weapons are dropped onto the floor by the enemies, which then can be picked up by the units as items
Weapons have the 'weapon' type in the item variables
Each unit can equip a weapon once it has been picked up
Each unit can only equip 1 weapon, and the equipment is persistent
Equiping an item changes the unit type of Trainee/Carac into Trainee_weapon/Carac_weapon and the fist attack is lost

Macro - Enter:
Sets the menu items for entering through a door and exiting
Parameters- SCEN FROMX FROMY TOX TOY PORTAL VAR COND IS_EN_EV IS_EX_EV
Scen--- scenario
Portal--- literal description of what is being entered/exited or how, e.g. through trap door
Var--- a variable which is tested with CONDidtion to determine if the menu items should be set
Cond--- as above
Is_en_ev--- boolean, should we trigger an event on entering?  Enter event named Enter_{FROMX}_{FROMY}
Is_ex_ev--- boolean, should we trigger an event on exiting?  Exit event named Exit_{FROMX}_{FROMY} 