Unable to find module at runtime.

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.

Moderator: POL Developer

Post Reply
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Unable to find module at runtime.

Post 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.
User avatar
CWO
POL Expert
Posts: 1159
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Post by CWO »

Is that directly an AI script? I don't think you can "use npc" in anything but an npc.script.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Post by Yukiko »

It's in a spawner script actually.
User avatar
tekproxy
Forum Regular
Posts: 352
Joined: Thu Apr 06, 2006 5:11 pm
Location: Nederland, Texas

Post by tekproxy »

Does the file npc.em exist in the correct location? Has it been corrupted?
User avatar
CWO
POL Expert
Posts: 1159
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Post 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.
qrak
Grandmaster Poster
Posts: 198
Joined: Sun Feb 05, 2006 4:35 pm
Location: Poland

Post 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 ;)
Marilla

Post 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.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Post 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!!!'
Harley
Forum Regular
Posts: 360
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re:

Post 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..
DevGIB
Grandmaster Poster
Posts: 248
Joined: Mon Feb 06, 2006 6:12 am

Re: Unable to find module at runtime.

Post 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.
Post Reply