ID:142988
 
Code:
var/Time = 2100
proc
Time()
Timez
Time += 1
sleep(25)
goto Timez
world/New()
Time()
mob
var
Moving
NPC
icon = 'NPC.dmi'
icon_state = "NPC"
New()
src.NPC_Walk()

proc
NPC_Walk()
start
if(!Moving)
if(Time >= 2100 && Time <=2105)
var/M = locate(/obj/Test)
var/E = locate(/mob/NPC)
walk_to(E,M,0,5)
Moving = 1
goto start
return
if(Time >= 2106 && Time <= 2110)
var/M = locate(/obj/Test3)
var/E = locate(/mob/NPC)
walk_to(E,M,0,5)
Moving = 1
goto start
return
else
if(Time >= 2100 && Time <=2105)
var/M = locate(/obj/Test)
var/E = locate(/mob/NPC)
var/F = get_dist(M,E)
if(F==0)
Moving = 0
goto start
return
else
world << "Else"
sleep(2)
goto start
return
if(Time >= 2106 && Time <=2110)
var/M = locate(/obj/Test3)
var/E = locate(/mob/NPC)
var/F = get_dist(M,E)
if(F==0)
Moving = 0
goto start
return
else
sleep(2)
goto start
return
sleep(5)
goto start
return


Problem description:

Well, I'm attempting to make a (large bulky code) small and easy code that will allow NPC's to travel around a town without running into those pesky walls and looking like fools. I decided to try it via using areas at each turn, and simply use walk_to() to make them walk to that area at a certain point during the day.

All was fine and well until I ran the game. Upon running it, I got spammed with the message "Else" until 21:06 came around. I understand that the code acted as it should, excluding the part where the NPC didn't move the slightest attempt. I figure I messed up somewhere along my walk_to() proc, but I can't figure out what I did wrong.