Code:
While (NPC direction (0) == north) do(
xNPC := NPC X (0)
yNPC := NPC Y (0)
If ((read zone (10, xNPC, yNPC--1) == true) || ((NPC at spot (xNPC, yNPC--1) == true))) then(
break
)
else (
create NPC (1, xNPC, yNPC--1, north)
)
wait (1)
)
While (NPC direction (0) == north) do(
xNPC := NPC X (0)
yNPC := NPC Y (0)
If ((read zone (10, xNPC, yNPC--1) == true) || ((NPC at spot (xNPC, yNPC--1) == true))) then(
break
)
else (
create NPC (1, xNPC, yNPC--1, north)
)
wait (1)
)
I want the code to do the following:
While NPC 0 is facing north, find NPC 0's x and y position. Now check to see if zone 10 exists one tile to the north or if any NPC exists at one tile to the north. If so break the loop, otherwise create NPC 1 one tile to the north.
Problem:
If zone 10 exists one tile to the north the loop will break, this is what I want. On the other hand if an NPC, lets say NPC 5, exists one tile to the north the code will NOT break...
Is this an improper use of the NPC at spot command? Is there some command I can alternatively use to check if any NPC's exist at a given (x,y) at a given time?
⊕ 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



