Making henchmen use wands and changing what spells they memorize/use

Looking for the scripts to edit to do these things. Is there any way to make ‘find in files’ in the toolset also search all scripts, not just those in my module?

Also looking for a way to delete the word ‘Dead’ from the corpses of Summons. I use SetName to erase the name (replace with single blank space) of corpses, so that only my invisible lootable corpse object name shows. Problem is, dead Summons are getting the prefix ‘Dead’ tacked onto their name somehow, and it’s not happening in my spawn system scripts (I use a customized version of NESS). Can’t find the bioware/x1/x2 script where it’s happening.

Guess I should note I’m just using 1.69 henchmen scripts - no Tony K, no OHS. Just my own tweaks here and there.

Simplest way is to export the official scripts into a folder, then search with any decent file manager e.g. Free Commander.

I made an export of 1.69:
https://neverwintervault.org/project/nwn1/script/bioware-169-scripts-2da-files

Not sure whether EE has changed any scripts yet, but you could export its scripts with NWN Explorer.

My 2da export is out of date - someone posted an EE version IIRC.

As for the word “dead”, NWN is hard-coded to tack a strref onto the name of dead creatures. I can find the talk table line if you like. You can change the talk table using the new script function, but that changes every dead creature, which sucks.

There is a whole library of corpse routines which might provide a neater method:
https://nwnlexicon.com/index.php?title=X0_i0_corpses

Modifying every dead creature would probably work for my needs. It’s a procedurally-spawned dungeon, and every creature corpse is supposed to be renamed anyway. My naming script generates a random adjective and a random noun for the corpses, as well as color coding them for fodder, champion, or boss creature types. It applies those to the lootable corpse object though, not the dead body object. The dead body object’s name is supposed to be blanked out. Which works fine for everything that actually spawns - but for summons it tacks on that word ‘Dead’ to the otherwise blank name, so when you push the key to highlight objects, only that word appears, in gray text (not the ri

I have never messed with .tlk or .2da files. My module uses an old version of CEP that was compatible with 1.69 at the time. Can I edit out the word ‘Dead’ without disrupting that?

You’ll need EE in order to use the SetTlkOverride function (see Lexicon).

Otherwise, CEP etc should work as before.

Unfortunately, since I decided not to use that method for corpses, I find that I no longer have the strref number that needs to be changed. However, I remember that I found it very easily by searching for “dead” in tlkedit. The entry you want is just that one word.

Ok, thanks Proleric for looking and for pointing me in the right direction. Will poke around. I do have EE (and every other version), so can use the function.

Any advice on where to look to determine caster spell selection, or the AI that controls what they choose to do each round?

Being able to tell them things like ‘Only use your offensive spells against Champions and Bosses’ or ‘Don’t use fire spells until I tell you otherwise’ or ‘Use your offensive wands until I tell you otherwise’ would help make them a lot more effective IMO.

‘Dead’ is line 6414.

1 Like

Npcs, including henchmen, should be able to use wands iirc (vanilla AI). Assuming they fulfill their class restrictions if any or have high enough UMD to bypass it. But they will use it as last resort, when nothing else is available. So if it is caster npc, you will not see it being used much in combat if at all.

Henchmen with vanilla AI do indeed use wands. Especially useful for low-level spellcasters who quickly run out of spells. Confiscate their melee weapons as belt-and-braces!

The heart of the combat AI is DetermineCombatRound(). It’s a complex beast to change - something like Tony K’s AI might illustrate just how complex (and that has compatibility issues with custom modules).

There are a few parameters you can tweak - for example
https://nwnlexicon.com/index.php?title=X2_inc_switches

Yeah, I’m aware they can use wands, but the fact that they only do so as a last resort is what I want the player to be able to modify in the ‘tactics’ branch of the conversation.

The fact that they can use them in combat makes me think it shouldn’t be too difficult. The function to do the action is already there - it’s just a matter of when it is called.

DetermineCombatRound() looks to be what I’m after. It’s in nw_i0_generic (along with DetermineClassToUse and DetermineSpecialBehavior and some other nifty functions). Thanks again, that’s 2 questions in 1 thread! :slight_smile: