Nw_o2_coninclude & npc dialogue issues

Just registered here. I’ve got 2 issues with my mod that I’ve been trying to solve for a long time, off and on. I’m moving on to other games at the moment, after playing NWN for about a year straight, and I want to get the current version of my mod uploaded before I do. But I’d like to fix at least one of these issues first.

  1. I’ve created a modified version of the nw_o2_coninclude script in my mod, adding a bunch of gear to the treasure generation functions, changing the chances for scrolls to spawn in bookshelves, and increasing the number of arrows etc that can drop. I copied the modified script to every chapter of the main campaign and expansions (my mod replaces the main game modules), and recompiled every script that references nw_o2_coninclude (manually, one at a time, in case doing it in bulk was the problem). I’ve gone back and made sure that the modified script is the one that loads when editing the modules.

Yet none of the changes appear to be active. It seems to be using some hidden copy of the default version of the script somewhere. How can I get this to work?

  1. I’ve added an NPC shop, selling a few unique items. The NPC has a dialogue script, but whenever I attach the dialogue to the NPC, it completely breaks the NPC so the player can’t even interact with it. I then have to delete the NPC and recreate it from scratch, as removing the dialogue doesn’t fix it. I’ve tried multiple methods of creating the NPC (using the shop wizard, not using it), and the same thing happens every time. The NPC isn’t a quest-giver, per se; it has a quest, sort of, but the quest is in line with the main story quest, and the only reward is being able to access its shop upon acceptance. So the dialogue isn’t strictly necessary, but there for flavour. Still, is there something simple I’m missing, or any way to make it work?

Odd, because you’re definitely on the right lines.

As you clearly understand, nw_o2_coninclude is not an executable script, but rather a chunk of code that’s referenced in multiple scripts. Recompiling those scripts, and saving them in a module, should mean that the changes work in that module (only).

I wonder whether you found all the references? If you use the script editor to find references in “all files in module” it doesn’t include the base game scripts, which aren’t regarded as module scripts. You can export those scripts to a folder with NWN Explorer, then use a decent text editor to find all the hidden references. (I think someone already posted those scripts to the Vault, but if so I can’t find it).

One way that could happen is if the first TRUE line of the dialogue is blank, or all lines of the dialogue are FALSE.

In that case, though, you would be able to use the NPC’s radial menu to attack or otherwise interact. If that isn’t possible, it’s likely that some script in the conversation has rendered them uncommandable or similar.

I fear you need to overwrite and recompile any script, that uses coninclude, especially the NWN-standardscripts for spawn (don’t know the exact name, but it ends with “default9”) (Older Versions have different name, “nw*” something)

The NPC has a dialogue script, but whenever I attach the dialogue to the NPC, it completely breaks the NPC so the player can’t even interact with it.

Most commonly this happens, if you put something into “appears when”, which should be in “action taken”.

Tried to check that, but don’t really understand (been too long since I created the NPC, so I’ve forgotten anything I might have known about the subject).

I used a copy of Gruul’s conversation for this NPC, editing the dialogue and cutting out the bits I didn’t need. The NPC, like Gruul, appears in chapter 3 of HotU. So there are only 2 instances of “text appears when”, from Gruul’s script:

  1. First line, description of the NPC, text appears when script: c_false;
  2. Reaper’s true name; script: h2c_reaper_name (returns TRUE if the reaper’s true name is not yet known).

You might be better off using Gruul’s original conversation and then putting in a StartingConditional script that always returns FALSE for each of the lines you wish to omit.

Do each line you omit one at a time and see if the NPC breaks. If the line already has a StartingConditional script, add this at the top of it within the Void Main ():

return FALSE;

(I think someone already posted those scripts to the Vault, but if so I can’t find it).

For reference:

Oof, that’ll be a lot of work. I’ll try to give it a try.