This is the source code for the henchman inventory control system and battle AI. This version works ONLY with the toolset. See the hakpaks section for the version that works in the override (i.e., the binaries only). The README file now contains a script function reference. It works with the SoU and HotU expansion also.
Contains all of the henchman dialogs from the Henchman Inventory and Battle AI exe release for the original, SoU, and HotU official campaigns. It also contains the familiar and animal companion dialogs for non HotU modules.
CRT_Hero, Try this: Search for the HENCH_BLEED_NEGHPS in hench_o0_ai and try commenting out the second that starts with ?find dying creatures to finish off?. Or you could change the definition of HENCH_BLEED_NEGHPS in hench_i0_heal to be 0 or 1. You could also try running a ClearAllActions on nearby creatures.
Posted by CRT_Hero at 2006-01-0401:13:29
Question: I merged these scripts into a module I'm building that uses a "hovering over death" bleeding script which I wrote... With the basic HOTU A.I., the "SetIsTemporaryNeutral" command worked very well for stopping monsters from attacking a fallen PC... with this code package, it doesn't work at all... I tried switching to a less subtle method of putting a DC 100 sanctuary spell on fallen PCs, but any "late hits" on the PC will freeze/crash the game. Harumph. Any ideas on getting my old factional methods to work? I've tried monkeying around with "hench_i0_ai" a little to try to classify characters with less than 0 hp as dead. But that didn't work either. Help. Otherwise these scripts are splendid. Most definitely!
Posted by Tony_K at 2005-12-1516:41:42
rereng Mew, The AI does use parry if the skill rank is greater than the creature?s AC minus 10. Look for SKILL_PARRY in hench_i0_melee. The creature must be less than 35% hit points to use parry but you can easily tweak that. At this point I don?t think BioWare will change the GetTalent* functions to by default get spells from equip-able items since it would affect the official campaigns. However, they could add additional parameters (default off) or add new functions to get them. I have thought of using the copy item properties kludge to make the items work but couldn?t think of a good way for it to work for henchmen and you cannot name the wand correctly with scripts (No SetName or way to set the name on object creation). I would actually be much happier with an index parameter to GetCreatureTalentBest to get successive spells instead of the GetCreatureTalentRandom kludge I had to do.
Posted by Mew at 2005-12-1513:56:51
The ai uses Parry it's extremely ANNOYING In a good way :) It's pretty intelligent about the usage though it does seem to have a preference to kick in when stuff has been damaged - I haven't checked the code this is just from experience.
Posted by nereng at on08/17/05
@lovellin: It's worth a try to submit it as a bug report to Bioware, I think. @Tony K: I'm making myself some new skills-2das, and am wondering about the skill Parry. Does the AI ever put the henchman in Parry-mode if he has a lot of skill in that?
Posted by lovellin at 2005-11-2111:46:28
For non-henchman NPC, we could replicate the cast spell itemproperties by giving them a wand with the same properties. If the wand is not droppable, this workaround would be transparent for the PC. That the original items will not exhausted when the NPC is defeated, is a minor issue.
Posted by Tony_K at 2005-11-2010:08:53
lovellin, Your analysis is correct. Any item that can be equipped will not work with the GetTalent* functions. Trying to simulate the spells exactly by looking at the item properties is also difficult because the spell casting level of the spell can?t bet set using ActionCastSpellAtObject with bCheat true unless you override every spell and even then it will not be correct for some of the built in functions like spell resistance checks.
Posted by lovellin at 2005-11-1907:54:45
I did some tests whether NPC use items containing spells. As far as I could find out, scrolls, potions and wands are used, but no other kinds of baseitems (e.g. rings). I checked your script hench_i0_itemsp where spells are inventarized using the GetTalent... functions. Obviously, the Bioware engine returns only spells in scrolls, potions and wands. As you have more experience with this and I was not able to find enough details in the nwnlexicon, could you tell me if I have analyzed the problem correctly? If yes, I would enhance the scripts for my module by also scanning itemproperties of the item types not handled automatically by Bioware.
Posted by nereng at on08/17/05
Excellent work here. With all the bugs in the standard Bioware AI, this is a must-have for anyone who wants to use henchmen in their modules.
Posted by nereng at on08/17/05
Hmm... upgrading from 1.04 to 1.05 looks a bit more complicated than I had anticipated... Basically, what I did with 1.04 was to only keep the include files (hench_i0* and hench_o0*), while using my own conversation template which has features from all the major henchman packages + my own ideas. I think a detailedlist of all the changes from version 1.04 would be helpful, but it may be a little too much to ask perhaps? Maybe I'll just try to overwrite all the include files, keeping a backup of the quite nicely working version with 1.04! Cheers, and thanks for the great work you've done here!