Page 1 of 1

Unable to find module at runtime.

Posted: Sat Jan 27, 2007 5:51 pm
by Yukiko
I have a script that is giving me the following error on tho console.

WARNING: pkg/systems/stuff/junk.ecl: Unable to find module npc

The script compiles but when the script runs I get that error. Any ideas why?

Thanks for the help.

Posted: Sat Jan 27, 2007 6:05 pm
by CWO
Is that directly an AI script? I don't think you can "use npc" in anything but an npc.script.

Posted: Sat Jan 27, 2007 6:30 pm
by Yukiko
It's in a spawner script actually.

Posted: Sat Jan 27, 2007 7:10 pm
by tekproxy
Does the file npc.em exist in the correct location? Has it been corrupted?

Posted: Sat Jan 27, 2007 11:43 pm
by CWO
I think its the "use npc" out of an AI script. I did somewhat the same thing before and it would give the same type of error.

Posted: Sun Jan 28, 2007 12:43 am
by qrak
i've had similar problem here:
http://forums.polserver.com/viewtopic.php?t=1116

mobile.setwarmode(0) was causing that and/or vital functions but i'm not sure cuz it was long time ago ;)

Posted: Sun Jan 28, 2007 4:19 am
by Marilla
Yukiko wrote:It's in a spawner script actually.
You -cannot- use npc.em functions in anything but an AI script. Compile this as a dot-command:

Code: Select all

use uo;
use npc;

program Testing(who)
	say("hi");
endprogram
It will compile fine, but it won't run, and I'm fairly sure you'll get exactly the console error you have seen. In fact, as an interesting side-effect - if you compile this as a dot-command, POL will tell you in-game that the dot-command actually does not even exist.

Anyway... you just plain cannot use npc.em functions in anything except an npc AI.

Posted: Sun Jan 28, 2007 5:47 pm
by Yukiko
Yes. It was a "use npc" problem. One of my includes that I had added a new function to was apparently intended to be used only in AI scripts and wasn't commented to indicate this.

Thanks CWO for the help.

I think the error message that POL issues could have been clearer.
Perhaps something like '<scriptname> is using npc.em but it isn't an AI script!!!'

Re:

Posted: Thu Mar 21, 2019 5:13 pm
by Harley
Yukiko wrote: Sun Jan 28, 2007 5:47 pm I think the error message that POL issues could have been clearer.
Perhaps something like '<scriptname> is using npc.em but it isn't an AI script!!!'
I support you, Yukiko, more detail information will not be superfluous!
I have come across not in the first time with this problem, and POL 099 didn't give out that error in my scripts instead of POL 100. Now, I have to find some 'use npc;' in some script or include..

Re: Unable to find module at runtime.

Posted: Thu Mar 21, 2019 5:58 pm
by DevGIB
In an effort of consistency shouldn't all the NPC functions also require an NPC reference?
I know this would lead to a lack of backwards compatibility if you changed Say(string) to Say(npcref, string).
But it would also mean that things like say could be dropped and the PrintAbove could be used in lieu?

I'm just wondering if there is a specific reason that NPC's scripts and functions have been designed to be automatically self referencing, not other script types seem to be that way.