Companions

Here's some helpful resources for working with companions... (more cominig soon)

Companion Influence

The companion influence system used in the OC is not available by default in new modules. To get them, copy all of the kr_influence* scripts from "C:\Program Files\Atari\Neverwinter Nights 2\Campaigns\Neverwinter Nights 2 Campaign." You can then paste them into your own campaign. Note that you will need to edit the constants and companion names across all scripts to match your own companions.

FRW: suggestions for dealing with companions

In a conversation between Wayne and Lord Niah over in the FRW forums Lord Niah had some good suggestions for working with companions.

Here are some rules of thumb for dealing with companions and the roster. I don't recall some the exact names for commands and do not have acces to the toolset at the moment.

#1 You should only have one instance of a companion placed within your campaign and you should never spawn that companion using CreateObject.
#2 If you want to destroy a companion, then use the despawn command (not the DestroyObject command)
#3 If you want to spawn your companion back in, use the spawn command instead of CreateObject
#4 If you want to add your companion to the roster, but don't want players to see them in the GUI selection screen, then just mark them as Campaign NPCs. Don't waste time adding/removing the companion from the roster every time they join or leave the party. Once they are in the roster, you just have to add/remove them from the party.

Check out the forum here:
http://nwcitadel.com/forums/showthread.php?t=873

Henchmen

Henchmen are companions who the player cannot directly control or adjust inventory for. Thanks to sgt_why for this explanation on how to set them up.

Here's his post from http://nwn2forums.bioware.com/forums/viewtopic.html?topic=545390&forum=1...

for this example;
string sTag = "c_human"

// is this a henchmen ? TRUE or FALSE
gc_henchman(sTag)

// this adds them to your party as henchmen, not companion
ga_henchman_add(sTag);
/*
note: this has (4) actual parameters ... the last flag can be very useful.
sTag - tag of the creature you want to add
bForce - if set to 1, sTarget will be added even if player already has maximum henchman
sMaster - The Creature you are adding the henchman to (default is PC Speaker)
bOverrideBehavior - if set to 1, sTarget's event handlers (scripts) will be replaced with henchman ones.
*/

// removes the henchmen from the party
ga_henchman_remove(sTag);

- - - - -
I put all of these into the conversations and seems to work great. In fact, think if the henchman dies .. they are removed from the group as well.

And you cant click on them and change thier inventory .. although I did notice there appear to be scripts out there to make the henchman show you his inventory and such, like a companion. But it would need to be during a conversation or such. (I think?)

I wanted to add a couple "friendly"(s) in my areas .. that if the PCs save them, will offer to help out for a short time .. as well as award 50xp for not letting the mobs kill them off.

Following his directions, I was able to create a few henchmen and get them to work with very little setup. Some quick things I noticed:

  • A "guard this area and I'll come back for you" dialog option with the ga_henchman_remove script on it worked great to when you want to temporarily ditch them.
  • Use unique tags for each creature. If, in his example, you have a set of friendlies standing around, each one needs it's own conversation and tag. It helps to write the conversation first, then duplicate it. This will lead you to creating more distinctive NPCs anyway.
  • Set the bOverrideBehavior = TRUE if you didn't do anything with the scripts on your henchmen, or they won't follow the PC.
  • Commoner NPCs won't attack, which worked just how I wanted. I was able to create a lost little girl that the party could escort home. Thankfully, she didn't run up and try to punch people in the groin.

Kudos to OE on making such an easy to use system, and thanks again to sgt_why