*** This script assigns a random picnum with the same dimensions to each object in the map excluding some active sprites and walls.
!!! It may take long time to execute.

mov r00 -1
for each nonignored sprite r00
  getsprite r00 lotag r01
  getsprite r00 hitag r02
  or r01 r02
  if r01 == 0 // Sprite has no tags
    getsprite r00 picnum r01 // Get sprite picnum
    if r01 > 10 // Sprite is not an effector
      include 0 // Call subfunction
      setsprite r00 picnum r01 // Return sprite picnum
    endif
  endif
continue

mov r00 -1
for each nonignored sector r00
  getsector r00 floorpicnum r01 // Get picnum
  include 0 // Call subfunction
  setsector r00 floorpicnum r01 // Return picnum
  getsector r00 ceilingpicnum r01 // Get picnum
  include 0 // Call subfunction
  setsector r00 ceilingpicnum r01 // Return picnum
continue

mov r00 -1
for each nonignored wall r00
  getwall r00 lotag r01
  getwall r00 hitag r02
  or r01 r02
  if r01 == 0 // Wall has no tags
    getwall r00 picnum r01 // Get picnum
    include 0 // Call subfunction
    setwall r00 picnum r01 // Return picnum
    getwall r00 overpicnum r01 // Get picnum
    include 0 // Call subfunction
    setwall r00 overpicnum r01 // Return picnum
  endif
continue