squattingmonk/nasher

Unable to open the include file "nw_inc_nui"

Closed this issue · 16 comments

We currently run into the following error when trying to include nw_inc_nui in our scripts (recent nasher version installed inside docker):

Error: nui_test.nss(1)
... NSC1085
... Unable to open the include file "nw_inc_nui"
Warning: Errors encountered during compilation (see above)
Prompt: Do you want to continue packing? (y/N)
Answer: 
Answer: no

This is likely because that file hasn't been fully incorporated into the game. You can trick the system by including it specifically in your build if you'd like, until the file is fully integrated. Keep in mind, though, it might never be fully integrated as it's a helper file and not really part of the game.

<steam/windows example follows>

include = "C:\program files (x86)\steam\steamapp\common\neverwinter night\ovr\nw_*.nss"

This will exclude the nwscript.nss in that folder, but include the rest of niv's example files.

Thanks for the quick reply. That gives me:

Error: nw_inc_nui.nss(50)
... NSC1040
... Syntax error at "json"

I tried it with native installed nasher, nim and nwnsc as well, so the problem is not only with docker i assume. It's a root server without nwn installed (we run nwn inside docker).

Does nwnsc work with the json keyword yet?

On my local machine (with a steam installation of nwn:ee) it does work so i guess yes?

Does nwnsc work with the json keyword yet?

To the best of my knowledge, the types are not hard coded in nwnsc, but likely taken from the nwscript.nss list in addition to the standard primitives. I haven't updated my nwnsc in months, but it works fine.

Thanks for the quick reply. That gives me:

Error: nw_inc_nui.nss(50)
... NSC1040
... Syntax error at "json"

I tried it with native installed nasher, nim and nwnsc as well, so the problem is not only with docker i assume. It's a root server without nwn installed (we run nwn inside docker).

Edit: just saw that you said the game was not installed ... that means it doesn't have access to nwscript.nss, and it may not compile without it. You might be able to get away with putting just that file in a specific directory, but not sure if that'd work or not. I'll look into other options as I have also set up a server to compile a module on its own, without the game installed. I just don't remember how I did it. I'll take a look later today.

My best guess is that you're using an outdated nwscript.nss (?). Sometimes old versions are hidden in haks and override/development folders. Have you checked to ensure you're using the most current nwscript?

Don't include nw_inc_nui and add the following function to any of your currently working scripts that don't include json; then run it to see if it errors out: int n = NuiGetEventWindow(); If it errors out, you don't have the most recent nwscript.nss.

Thanks for the quick reply. That gives me:

Error: nw_inc_nui.nss(50)
... NSC1040
... Syntax error at "json"

I tried it with native installed nasher, nim and nwnsc as well, so the problem is not only with docker i assume. It's a root server without nwn installed (we run nwn inside docker).

If you're using nasher docker to compile, it could be that the nasher image hasn't been updated recently enough to include the new game data?

I built the docker image myself with custom userids and tested it with native tools as well. I guess it has something to do with the game not being installed.

Including the new nwscript.nss with include = "nwscript.nss" throws a lot of errors.

Weirdly enough after i remove it and nwscript.nss is still cached it packs without a problem.

When i rm -rf .nasher/ i get the same errors again.

Maybe the beamdog/nwserver:latest does not ship a new nwscript.nss which is used by nwnsc here: https://github.com/nwneetools/nwnsc/blob/master/Dockerfile#L1? It seems they load a nwscipt.nss at some point https://github.com/nwneetools/nwnsc/blob/d0dcccaf33b1787e150a3d86a5b77f7a74975b11/_NscLib/NscCompiler.cpp#L151.

Never include nwscript.nss. If the latest beamdog server didn't include it, I'd imagine there'd be a lot of problems. I've build modules without the game being installed on our server. I'll try to take a look when I get a chance and see what the different might be.

Are you still having this issue?

Yes, but i can not update to a newer nasher version at the moment due to #92. Will check once this is resolved.

Error: nui_test.nss(1)
... NSC1085
... Unable to open the include file "nw_inc_nui"
Warning: Errors encountered during compilation (see above)
Prompt: Do you want to continue packing? -> [forced no]

I get this warning:
Warning: Could not locate NWN root. Try setting the NWN_ROOT environment
As i run nwn inside docker i have no install directory.

If i run

docker run --rm -it -v "$(pwd):/tmp" nwneetools/nwnsc 

in mintarn/src/nss i still get the error

nui_test.nss(1): Error: NSC1085: Unable to open the include file "nw_inc_nui"

So i would assume that i have to take that to nwnsc.

Edit: Created an issue here nwneetools/nwnsc#30

I get this warning: Warning: Could not locate NWN root. Try setting the NWN_ROOT environment As i run nwn inside docker i have no install directory.

Does it work if you set NWN_ROOT? You can pass it to docker with -e NWN_ROOT='/path/to/nwn/root'.

@Kaikas, did rebuilding the nwnsc image locally as mentioned in nwneetools/nwnsc#30 fix your issue?

Closing for now. Can re-open later if this is still happening.