Essentially what I think is happening is the code keeps retriggering before it has completed due to the NPC walking for some reason. I'd like to know if there is a way around this. One particular problem I've noticed is the NPC will fail to see my player even though I have positioned the player clearly in the peripheral line of sight.
Here's a snippet of the code. It may seem large and daunting but don't feel the need to read it all. The code is fairly repetitive and I think you'll get the idea after reading about 10 lines.
Code:
...
# Line of sight sweep for east-facing NPC
While (NPC direction (0) == east) do(
# Line of sight point east
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
#wait (1)
atxNPC := NPC X (0)
atyNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
#If ((xNPC == atxNPC) && (yNPC == atyNPC)) then(
If ((read zone (10, xNPC+1, yNPC) == true) || ((NPC at spot (xNPC+1, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+1, yNPC, west)
If ((read zone (11, xNPC+1, yNPC) == true) || ((xNPC+1 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+2, yNPC) == true) || ((NPC at spot (xNPC+2, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+2, yNPC, west)
If ((read zone (11, xNPC+2, yNPC) == true) || ((xNPC+2 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+3, yNPC) == true) || ((NPC at spot (xNPC+3, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+3, yNPC, west)
If ((read zone (11, xNPC+3, yNPC) == true) || ((xNPC+3 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+4, yNPC) == true) || ((NPC at spot (xNPC+4, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+4, yNPC, west)
If ((read zone (11, xNPC+4, yNPC) == true) || ((xNPC+4 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+5, yNPC) == true) || ((NPC at spot (xNPC+5, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+5, yNPC, west)
If ((read zone (11, xNPC+5, yNPC) == true) || ((xNPC+5 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+6, yNPC) == true) || ((NPC at spot (xNPC+6, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+6, yNPC, west)
If ((read zone (11, xNPC+6, yNPC) == true) || ((xNPC+6 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
# Line of sight sweep for east-facing NPC A
#
#
# xxx
# 0xxx
#
#
#
# Line of sight point east
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+1, yNPC) == true) || ((NPC at spot (xNPC+1, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+1, yNPC, west)
If ((read zone (11, xNPC+1, yNPC) == true) || ((xNPC+1 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+2, yNPC) == true) || ((NPC at spot (xNPC+2, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+2, yNPC, west)
If ((read zone (11, xNPC+2, yNPC) == true) || ((xNPC+2 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+3, yNPC) == true) || ((NPC at spot (xNPC+3, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+3, yNPC, west)
If ((read zone (11, xNPC+3, yNPC) == true) || ((xNPC+3 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+4, yNPC--1) == true) || ((NPC at spot (xNPC+4, yNPC--1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+4, yNPC--1, west)
If ((read zone (11, xNPC+4, yNPC--1) == true) || ((xNPC+4 == x) && (yNPC--1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+5, yNPC--1) == true) || ((NPC at spot (xNPC+5, yNPC--1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+5, yNPC--1, west)
If ((read zone (11, xNPC+5, yNPC--1) == true) || ((xNPC+5 == x) && (yNPC--1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+6, yNPC--1) == true) || ((NPC at spot (xNPC+6, yNPC--1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+6, yNPC, west)
If ((read zone (11, xNPC+6, yNPC--1) == true) || ((xNPC+6 == x) && (yNPC--1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#wait (1)
#)
# Line of sight sweep for east-facing NPC B
#
# xx
# xx
# 0x
#
#
#
# Line of sight point east
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+1, yNPC) == true) || ((NPC at spot (xNPC+1, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+1, yNPC, west)
If ((read zone (11, xNPC+1, yNPC) == true) || ((xNPC+1 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+2, yNPC--1) == true) || ((NPC at spot (xNPC+2, yNPC--1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+2, yNPC--1, west)
If ((read zone (11, xNPC+2, yNPC--1) == true) || ((xNPC+2 == x) && (yNPC--1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+3, yNPC--1) == true) || ((NPC at spot (xNPC+3, yNPC--1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+3, yNPC--1, west)
If ((read zone (11, xNPC+3, yNPC--1) == true) || ((xNPC+3 == x) && (yNPC--1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+4, yNPC--2) == true) || ((NPC at spot (xNPC+4, yNPC--2) <> 0))) then(
break
)
else (
create NPC (1, xNPC+4, yNPC--2, west)
If ((read zone (11, xNPC+4, yNPC--2) == true) || ((xNPC+4 == x) && (yNPC--2 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+5, yNPC--2) == true) || ((NPC at spot (xNPC+5, yNPC--2) <> 0))) then(
break
)
else (
create NPC (1, xNPC+5, yNPC--2, west)
If ((read zone (11, xNPC+5, yNPC--2) == true) || ((xNPC+5 == x) && (yNPC--2 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
# Line of sight sweep for east-facing NPC C
#
# x
# xx
# 0
#
#
#
# Line of sight point east
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+1, yNPC--1) == true) || ((NPC at spot (xNPC+1, yNPC--1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+1, yNPC--1, west)
If ((read zone (11, xNPC+1, yNPC--1) == true) || ((xNPC+1 == x) && (yNPC--1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+2, yNPC--1) == true) || ((NPC at spot (xNPC+2, yNPC--1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+2, yNPC--1, west)
If ((read zone (11, xNPC+2, yNPC--1) == true) || ((xNPC+2 == x) && (yNPC--1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+3, yNPC--2) == true) || ((NPC at spot (xNPC+3, yNPC--2) <> 0))) then(
break
)
else (
create NPC (1, xNPC+3, yNPC--2, west)
If ((read zone (11, xNPC+3, yNPC--2) == true) || ((xNPC+3 == x) && (yNPC--2 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
# Line of sight sweep for east-facing NPC D
#
#
#
# 0xxx
# xxx
#
#
# Line of sight point east
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+1, yNPC) == true) || ((NPC at spot (xNPC+1, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+1, yNPC, west)
If ((read zone (11, xNPC+1, yNPC) == true) || ((xNPC+1 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+2, yNPC) == true) || ((NPC at spot (xNPC+2, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+2, yNPC, west)
If ((read zone (11, xNPC+2, yNPC) == true) || ((xNPC+2 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+3, yNPC) == true) || ((NPC at spot (xNPC+3, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+3, yNPC, west)
If ((read zone (11, xNPC+3, yNPC) == true) || ((xNPC+3 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+4, yNPC+1) == true) || ((NPC at spot (xNPC+4, yNPC+1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+4, yNPC+1, west)
If ((read zone (11, xNPC+4, yNPC+1) == true) || ((xNPC+4 == x) && (yNPC+1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+5, yNPC+1) == true) || ((NPC at spot (xNPC+5, yNPC+1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+5, yNPC--1, west)
If ((read zone (11, xNPC+5, yNPC+1) == true) || ((xNPC+5 == x) && (yNPC+1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+6, yNPC+1) == true) || ((NPC at spot (xNPC+6, yNPC+1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+6, yNPC, west)
If ((read zone (11, xNPC+6, yNPC+1) == true) || ((xNPC+6 == x) && (yNPC+1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#wait (1)
#)
# Line of sight sweep for east-facing NPC E
#
#
#
# 0x
# xx
# xx
#
# Line of sight point east
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+1, yNPC) == true) || ((NPC at spot (xNPC+1, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+1, yNPC, west)
If ((read zone (11, xNPC+1, yNPC) == true) || ((xNPC+1 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+2, yNPC+1) == true) || ((NPC at spot (xNPC+2, yNPC+1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+2, yNPC+1, west)
If ((read zone (11, xNPC+2, yNPC+1) == true) || ((xNPC+2 == x) && (yNPC+1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+3, yNPC+1) == true) || ((NPC at spot (xNPC+3, yNPC+1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+3, yNPC+1, west)
If ((read zone (11, xNPC+3, yNPC+1) == true) || ((xNPC+3 == x) && (yNPC+1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+4, yNPC+2) == true) || ((NPC at spot (xNPC+4, yNPC+2) <> 0))) then(
break
)
else (
create NPC (1, xNPC+4, yNPC+2, west)
If ((read zone (11, xNPC+4, yNPC+2) == true) || ((xNPC+4 == x) && (yNPC+2 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+5, yNPC+2) == true) || ((NPC at spot (xNPC+5, yNPC+2) <> 0))) then(
break
)
else (
create NPC (1, xNPC+5, yNPC+2, west)
If ((read zone (11, xNPC+5, yNPC+2) == true) || ((xNPC+5 == x) && (yNPC+2 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
# Line of sight sweep for east-facing NPC F
#
#
#
# 0
# xx
# x
#
# Line of sight point east
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+1, yNPC+1) == true) || ((NPC at spot (xNPC+1, yNPC+1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+1, yNPC+1, west)
If ((read zone (11, xNPC+1, yNPC+1) == true) || ((xNPC+1 == x) && (yNPC+1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+2, yNPC+1) == true) || ((NPC at spot (xNPC+2, yNPC+1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+2, yNPC+1, west)
If ((read zone (11, xNPC+2, yNPC+1) == true) || ((xNPC+2 == x) && (yNPC+1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+3, yNPC+2) == true) || ((NPC at spot (xNPC+3, yNPC+2) <> 0))) then(
break
)
else (
create NPC (1, xNPC+3, yNPC+2, west)
If ((read zone (11, xNPC+3, yNPC+2) == true) || ((xNPC+3 == x) && (yNPC+2 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#wait (1)
#)
wait (1)
)
...
...
# Line of sight sweep for east-facing NPC
While (NPC direction (0) == east) do(
# Line of sight point east
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
#wait (1)
atxNPC := NPC X (0)
atyNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
#If ((xNPC == atxNPC) && (yNPC == atyNPC)) then(
If ((read zone (10, xNPC+1, yNPC) == true) || ((NPC at spot (xNPC+1, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+1, yNPC, west)
If ((read zone (11, xNPC+1, yNPC) == true) || ((xNPC+1 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+2, yNPC) == true) || ((NPC at spot (xNPC+2, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+2, yNPC, west)
If ((read zone (11, xNPC+2, yNPC) == true) || ((xNPC+2 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+3, yNPC) == true) || ((NPC at spot (xNPC+3, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+3, yNPC, west)
If ((read zone (11, xNPC+3, yNPC) == true) || ((xNPC+3 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+4, yNPC) == true) || ((NPC at spot (xNPC+4, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+4, yNPC, west)
If ((read zone (11, xNPC+4, yNPC) == true) || ((xNPC+4 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+5, yNPC) == true) || ((NPC at spot (xNPC+5, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+5, yNPC, west)
If ((read zone (11, xNPC+5, yNPC) == true) || ((xNPC+5 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+6, yNPC) == true) || ((NPC at spot (xNPC+6, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+6, yNPC, west)
If ((read zone (11, xNPC+6, yNPC) == true) || ((xNPC+6 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
# Line of sight sweep for east-facing NPC A
#
#
# xxx
# 0xxx
#
#
#
# Line of sight point east
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+1, yNPC) == true) || ((NPC at spot (xNPC+1, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+1, yNPC, west)
If ((read zone (11, xNPC+1, yNPC) == true) || ((xNPC+1 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+2, yNPC) == true) || ((NPC at spot (xNPC+2, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+2, yNPC, west)
If ((read zone (11, xNPC+2, yNPC) == true) || ((xNPC+2 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+3, yNPC) == true) || ((NPC at spot (xNPC+3, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+3, yNPC, west)
If ((read zone (11, xNPC+3, yNPC) == true) || ((xNPC+3 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+4, yNPC--1) == true) || ((NPC at spot (xNPC+4, yNPC--1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+4, yNPC--1, west)
If ((read zone (11, xNPC+4, yNPC--1) == true) || ((xNPC+4 == x) && (yNPC--1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+5, yNPC--1) == true) || ((NPC at spot (xNPC+5, yNPC--1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+5, yNPC--1, west)
If ((read zone (11, xNPC+5, yNPC--1) == true) || ((xNPC+5 == x) && (yNPC--1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+6, yNPC--1) == true) || ((NPC at spot (xNPC+6, yNPC--1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+6, yNPC, west)
If ((read zone (11, xNPC+6, yNPC--1) == true) || ((xNPC+6 == x) && (yNPC--1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#wait (1)
#)
# Line of sight sweep for east-facing NPC B
#
# xx
# xx
# 0x
#
#
#
# Line of sight point east
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+1, yNPC) == true) || ((NPC at spot (xNPC+1, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+1, yNPC, west)
If ((read zone (11, xNPC+1, yNPC) == true) || ((xNPC+1 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+2, yNPC--1) == true) || ((NPC at spot (xNPC+2, yNPC--1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+2, yNPC--1, west)
If ((read zone (11, xNPC+2, yNPC--1) == true) || ((xNPC+2 == x) && (yNPC--1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+3, yNPC--1) == true) || ((NPC at spot (xNPC+3, yNPC--1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+3, yNPC--1, west)
If ((read zone (11, xNPC+3, yNPC--1) == true) || ((xNPC+3 == x) && (yNPC--1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+4, yNPC--2) == true) || ((NPC at spot (xNPC+4, yNPC--2) <> 0))) then(
break
)
else (
create NPC (1, xNPC+4, yNPC--2, west)
If ((read zone (11, xNPC+4, yNPC--2) == true) || ((xNPC+4 == x) && (yNPC--2 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+5, yNPC--2) == true) || ((NPC at spot (xNPC+5, yNPC--2) <> 0))) then(
break
)
else (
create NPC (1, xNPC+5, yNPC--2, west)
If ((read zone (11, xNPC+5, yNPC--2) == true) || ((xNPC+5 == x) && (yNPC--2 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
# Line of sight sweep for east-facing NPC C
#
# x
# xx
# 0
#
#
#
# Line of sight point east
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+1, yNPC--1) == true) || ((NPC at spot (xNPC+1, yNPC--1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+1, yNPC--1, west)
If ((read zone (11, xNPC+1, yNPC--1) == true) || ((xNPC+1 == x) && (yNPC--1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+2, yNPC--1) == true) || ((NPC at spot (xNPC+2, yNPC--1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+2, yNPC--1, west)
If ((read zone (11, xNPC+2, yNPC--1) == true) || ((xNPC+2 == x) && (yNPC--1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+3, yNPC--2) == true) || ((NPC at spot (xNPC+3, yNPC--2) <> 0))) then(
break
)
else (
create NPC (1, xNPC+3, yNPC--2, west)
If ((read zone (11, xNPC+3, yNPC--2) == true) || ((xNPC+3 == x) && (yNPC--2 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
# Line of sight sweep for east-facing NPC D
#
#
#
# 0xxx
# xxx
#
#
# Line of sight point east
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+1, yNPC) == true) || ((NPC at spot (xNPC+1, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+1, yNPC, west)
If ((read zone (11, xNPC+1, yNPC) == true) || ((xNPC+1 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+2, yNPC) == true) || ((NPC at spot (xNPC+2, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+2, yNPC, west)
If ((read zone (11, xNPC+2, yNPC) == true) || ((xNPC+2 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+3, yNPC) == true) || ((NPC at spot (xNPC+3, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+3, yNPC, west)
If ((read zone (11, xNPC+3, yNPC) == true) || ((xNPC+3 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+4, yNPC+1) == true) || ((NPC at spot (xNPC+4, yNPC+1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+4, yNPC+1, west)
If ((read zone (11, xNPC+4, yNPC+1) == true) || ((xNPC+4 == x) && (yNPC+1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+5, yNPC+1) == true) || ((NPC at spot (xNPC+5, yNPC+1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+5, yNPC--1, west)
If ((read zone (11, xNPC+5, yNPC+1) == true) || ((xNPC+5 == x) && (yNPC+1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+6, yNPC+1) == true) || ((NPC at spot (xNPC+6, yNPC+1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+6, yNPC, west)
If ((read zone (11, xNPC+6, yNPC+1) == true) || ((xNPC+6 == x) && (yNPC+1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#wait (1)
#)
# Line of sight sweep for east-facing NPC E
#
#
#
# 0x
# xx
# xx
#
# Line of sight point east
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+1, yNPC) == true) || ((NPC at spot (xNPC+1, yNPC) <> 0))) then(
break
)
else (
create NPC (1, xNPC+1, yNPC, west)
If ((read zone (11, xNPC+1, yNPC) == true) || ((xNPC+1 == x) && (yNPC == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+2, yNPC+1) == true) || ((NPC at spot (xNPC+2, yNPC+1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+2, yNPC+1, west)
If ((read zone (11, xNPC+2, yNPC+1) == true) || ((xNPC+2 == x) && (yNPC+1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+3, yNPC+1) == true) || ((NPC at spot (xNPC+3, yNPC+1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+3, yNPC+1, west)
If ((read zone (11, xNPC+3, yNPC+1) == true) || ((xNPC+3 == x) && (yNPC+1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+4, yNPC+2) == true) || ((NPC at spot (xNPC+4, yNPC+2) <> 0))) then(
break
)
else (
create NPC (1, xNPC+4, yNPC+2, west)
If ((read zone (11, xNPC+4, yNPC+2) == true) || ((xNPC+4 == x) && (yNPC+2 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+5, yNPC+2) == true) || ((NPC at spot (xNPC+5, yNPC+2) <> 0))) then(
break
)
else (
create NPC (1, xNPC+5, yNPC+2, west)
If ((read zone (11, xNPC+5, yNPC+2) == true) || ((xNPC+5 == x) && (yNPC+2 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
# Line of sight sweep for east-facing NPC F
#
#
#
# 0
# xx
# x
#
# Line of sight point east
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+1, yNPC+1) == true) || ((NPC at spot (xNPC+1, yNPC+1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+1, yNPC+1, west)
If ((read zone (11, xNPC+1, yNPC+1) == true) || ((xNPC+1 == x) && (yNPC+1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+2, yNPC+1) == true) || ((NPC at spot (xNPC+2, yNPC+1) <> 0))) then(
break
)
else (
create NPC (1, xNPC+2, yNPC+1, west)
If ((read zone (11, xNPC+2, yNPC+1) == true) || ((xNPC+2 == x) && (yNPC+1 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#####
xNPC := NPC X (0)
yNPC := NPC Y (0)
x := hero x (find hero (0))
y := hero y (find hero (0))
If ((read zone (10, xNPC+3, yNPC+2) == true) || ((NPC at spot (xNPC+3, yNPC+2) <> 0))) then(
break
)
else (
create NPC (1, xNPC+3, yNPC+2, west)
If ((read zone (11, xNPC+3, yNPC+2) == true) || ((xNPC+3 == x) && (yNPC+2 == y))) then(
play sound (4, false, false)
)
#wait (1)
destroy NPC (1)
#wait (1)
)
#wait (1)
#)
wait (1)
)
...
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases



