Closed Kln95130 closed 5 years ago
Replacing
const dest = w[npc.loc][exit].name;
by
const dest = exit.name;
does the trick.
Thanks. I did test the patrol worked, but must have later updated it and not then tested. I have added the correction to the code.
Hello again. Following your commit, there is another error message.
I think you need to replace
if (!w[dest]) errormsg("Location '" + exit.name + "' not recognised in the agenda of " + npc.name);
by
if (!w[exit.name]) errormsg("Location '" + exit.name + "' not recognised in the agenda of " + npc.name);
Good evening.
I am trying to build an agenda for a "zombi" NPC. I have an error when trying to implement the walkRandom function, and I think it might be a code problem.
TypeError: w[npc.loc][exit] is undefined
Here are my items:
Here is the current version of walkRandom on my project:
Thanks for all your work so far, by the way.