I created a Druid henchmen, and while she does not summon her animal companion by herself, in the conversation file that I copied from some module you can ask her to do so, but then she summon a nameless naked dwarf.
What did I do wrong? In the conversation file, the action taken is called “69_hench_crtrsmn”, and it was written “HenchSummonCreature69();”. I changed to “SummonAnimalCompanion();” but nothing changed.
Her level up package is set to Default Druid.
I searched but could not find any answer. Could someone help me out?
Unless something had recently changed in EE, NWN’s NPCs aren’t really meant to summon ACs or familiars. It works though, but is quirky.
If you make your druid call this script:
void main()
{
SummonAnimalCompanion();
}
and the druid has and can use the feat, it will always summon a unnamed badger (or a bat in case of SummonFamiliar()), which is the ResRef in row 0 from corresponding hen_*.2da table. Nothing is exposed in the toolset or in their blueprints to set the summon type.
It is trivial to set the missing name of AC summoned above (it also has the correct level), but if you want a total control over the process (i.e. choose AC type), you will have to use a workaround. I see two possibilities:
Use EffectSummonCreature(), which takes care of everything (unsummon on rest, etc), but may (will) conflict with “normal” summons.
Spawn AC as a henchman - no conflict, but you’ll have to do more scripting.
The problem was on the script, using only what you wrote solves the problem. It’s a pity it’s impossible to choose the animal without conflicting with summons. Thank you for enlightening me on the matter.
It is possible if you choose route #2 in my previous post.
You’ll just need to make sure you don’t duplicate the “companion”, manually decrease feat uses, show correct animation and VFX, and finally destroy the creature on rest. With all this you can pretty much replicate the vanilla AC/familiar system (except familiar possession, which makes no sense for NPCs anyway).
Small correction, but Animal Companions and Familiars persist through rests just like henchman do, so you wouldn’t have to destroy it upon resting unless the goal is to remove the “double use” the abilities have if you rest while they’re summoned. IMO it would make the most sense to add the request to unsummon them to their master’s conversation.
You’re right. That makes it even easier (and eliminates route #1). Invoking the summon feat again just unsummons current creature, like vanilla does.
Another way to do it - more direct, although a bit unorthodox (you have to right click and then choose talk to) - is to modify nw_g_animal and nw_g_familiar to allow the PC to ask the companion to unsummon itself (no need to track who follows who). Same with regular summons, but through nw_ch_ac4 override (no convo to mod).
NWScript function names are quite self-explanatory and most of the time explained enough in the toolset (double-click on any of them for help) or in the Lexicon if you need more info.
So, when in doubt, type the words in function search inside code editor (top right corner).
Play around those functions and see what you’ll get.
For example, beginning of SummonFakeAnimalCompanion() should look like this since there’s nothing to do without the feat.
// return if master has no feat (or already used it today)
if(!GetHasFeat(FEAT_ANIMAL_COMPANION))
{
SendMessageToPC(GetFirstPC(), "Cannot use feat"); // debug
return;
}
The next step is to spawn (create) some creature and check if it is valid.
It should provide basic knowledge how to read & write code.
Also double-click on every function name (like CreateObject) so you can see its invocation and description in the help box at the bottom of the script editor.
Lexicon also contains explanation what every function in the game does and how it should be used, often with working examples. Just look them up through the search box on the left.
Try the script from that page (I modified it a bit and removed pointless comments).
void main()
{
// Object type to create
int nObjectType = OBJECT_TYPE_CREATURE;
// What to create - a "standard" chicken
string sChicken = "nw_chicken";
// Where to make the chicken appear
location lTarget = GetLocation(OBJECT_SELF);
// Actually create the object
object oChicken = CreateObject(nObjectType, sChicken, lTarget);
}
Observe how to properly call CreateObject (and the other two functions), then combine this with your current script. Make oChicken (the just-spawned NPC) a henchman of OBJECT_SELF (caller of the script).
Here is what I’ve done but it’s not working. I did just what the toolset help and the lexicon said on top of the page, but the AddHenchman is wrong. I don’t know what I did wrong. Here it is:
void main()
{
if(!GetHasFeat(FEAT_ANIMAL_COMPANION))
{
SendMessageToPC(GetFirstPC(), "Cannot use feat");
return;
}
// Object type to create
int nObjectType = OBJECT_TYPE_CREATURE;
// What to create - a "standard" chicken
string sChicken = "nw_chicken";
// Where to make the chicken appear
location lTarget = GetLocation(OBJECT_SELF);
// Actually create the object
object oChicken = CreateObject(nObjectType, sChicken, lTarget);
object oMaster = Isiovien;
object oHenchman = oChicken;
void AddHenchman(oMaster, oHenchman=OBJECT_SELF);
{void DecrementRemainingFeatUses(object oMaster, int FEAT_ANIMAL_COMPANION);
}
}