if(get NPC ID(NPC at spot(x tile, y tile)) == 1) then(
write zone (22, x tile, y tile)
)
Right now I have a loop that places zone #22 wherever NPC ID #1 is and if NPC #1 is not there then it erases the zone. The only problem is I have some non-obstruct NPCs that wander the map and anytime they occupy the same space as NPC #1 it causes zone #22 not to be written to NPC #1. Is there a way I can account for this? Keeping in mind there could be scenarios where up to 3 NPCs occupy the same space.
Last edited by sheamkennedy on Sat Dec 30, 2017 7:05 pm, edited 1 time in total.
variable(spoon)
spoon:=0
While (spoon<6) do,begin
if(getNPCID( NPCatspot(xtile,ytile,spoon) )==1)then(
write zone (22, x tile, y tile)
)
Increment(spoon)
End
Last edited by Spoonweaver on Sat Dec 30, 2017 11:42 pm, edited 1 time in total.
variable(which)
for (which, 0, NPC at spot(x tile, y tile, get count) -- 1) do (
if (get NPC ID(NPC at spot(x tile, y tile, which)) == 1) then(
write zone (22, x tile, y tile)
)
)
Or you can use a while loop until "NPC at spot" returns false.
Last edited by TMC on Fri Jan 12, 2018 1:28 pm, edited 1 time in total.