You are here

Need help with PW - gui scripts stop working without reason

6 posts / 0 new
Last post
Artemis
Need help with PW - gui scripts stop working without reason

Hello everyone,

this is my first post on this forum, and I am kinda ashamed it had to be because I needed help :(

I manage a nwn2 pw hosted on a Windows Server 2012 VM, and recently we have started having issues.

We run the GOG version of the game, with NWNX4, and we also have a batch file that automatically reboots the server (stopping and starting the nwnx4 service) every morning around 6.

The problem is that after rebooting, sometimes the gui scripts do not work. The server starts up fine and does everything it needs that does not require GUIs (such as saving PCs, telling players the date, etc). You can drag and drop the GUIs, but all options that require a script do not work at all. 

Since I am using the client extension, I tried using the /guidebug and /guitracing commands and I managed to see that the scripts are called, but they are not executed (I know this is the case because I put extensive logging in the scripts themselves).

I do not recall any big changes to the scripts before this started happening. I added some new haks but it was just graphical stuff.

The thing that really baffles me is that this only happens *sometimes*, randomly. Meaning, I reboot the server and everything works, I reboot it once more and it doesn't work. Randomly. 

Did anything like this ever happen to you guys? Do you have any idea how to solve it?

Thank you in advance for your help.

 

 

  • up
    50%
  • down
    50%
kevL's

i have had issues with integer_constants in #include files. Example:

const int MATERIAL_NONE = 0;
const int MATERIAL_IRON = 1;
const int MATERIAL_GOLD = 2;

const int DEBUG_OFF = 0;
const int DEBUG_ON  = 1;


notice the integer literals overlap. I've seen gui-scripts fail because of that, and my policy now is to ensure that int_constants don't overlap their literals (in gui-scripts). Else, use the literals themselves.

A second issue I've seen with gui-scripts is that because they compile on-the-fly, they could be compiling against an out-of-date #include. This happened when someone put a backup #include in their mod (with the same filename) that wasn't the same as the primary #include that should have been used. Again gui-script fail: the internal compiler could be grabbing the wrong #include.

- other than that, i don't much about PWs, NWNx4, servers, etc ... just SP here. Clangeddin, i think, or someone would know more about what's going on

  • up
    50%
  • down
    50%
Clangeddin

By any chance, when you did the hak updates, did you modify the xml files that called those scripts and, accidentally, reverted them or removed the scriptloadable=true attribute in the UI Scene? Because that attribute is needed to make the gui_ scripts work.

  • up
    50%
  • down
    50%
Artemis

Thank you for your answers. The weird fact is that all GUIs stop working, not just one or two, and that rebooting the server fixes (sometimes) the problem. So I am pretty certain that the problem does not lie in one single xml or nss file.

I was thinking something about temporary files that get overwritten\can't write to disk, but I didn't find anything that could cause the problem.

Also, I have 2 nwnx4 services on my VM, with 2 modules. The second one only contains 1 area and the xp_craft system for modifying armor models, and does not present problems.

  • up
    50%
  • down
    50%
Clangeddin

Ok, I can I help you reach a definitive conclusion if you give me the following files:

1) The gui_ scripts that stop firing

2) The haks attached to the module(s) that include the xml files running those scripts.

If I see those files I can tell you why the scripts are (not) running.

It could also be that the module causing the problem does not have the xml included in those haks whereas the second one does. Or they have different versions.

Honestly, though, before seeing what's the problem, I'd really need to take a look at the files. Otherwise, all I'm left with is guessing.

You can contact me on discord chat (if you have it): My ID there is Clangeddin#9346

Or send me a private message here, if you prefer.

 

  • up
    50%
  • down
    50%
Artemis

Thank you so much, I sent you a friend request on Discord, my ID is sve#7649!

  • up
    50%
  • down
    50%