Aller au contenu

Photo

HireHenchman or AddHenchman?


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Grymlorde

Grymlorde
  • Members
  • 224 messages

When hiring a henchman, should I use HireHenchman or AddHenchman? Looking through the Lexicon suggests that both functions are identical.

 

When should I use HireHenchman and when AddHenchman? Does it ever matter? Are there any situations where one is better than the other? Is one buggy and should be avoided? I can't imagine that they are functionally identical in all situations.

 

Thanks in advance!



#2
WhiZard

WhiZard
  • Members
  • 1 204 messages

HireHenchman() is a function within x0_i0_henchman that contains the AddHenchman command.  You should probably look at the scripted function to see if you desire to use it and its related functions (e.g. FireHenchman).  One thing to note is that HireHenchman enforces a limit of two henchmen regardless of the module setting.


  • Squatting Monk aime ceci

#3
Grymlorde

Grymlorde
  • Members
  • 224 messages

Thanks WhiZard. At first it seemed like AddHenchman followed the SetMaxHenchman setting but upon further testing it ignores it.

 

BTW, the Script Wizard defaults to AddHenchman rather than HireHenchman when adding henchmen. I wonder why it does that. . .


Modifié par Grymlorde, 03 août 2015 - 11:24 .


#4
Proleric

Proleric
  • Members
  • 2 349 messages

My understanding is that AddHenchman is the essential function.

 

HireHenchman is a wrapper for the OC, which includes rules you may not want (e.g. arbitrary firing of first henchman if limit is exceeded) and potentially redundant functions like SetPlayerHasHiredInCampaign, SetLastMaster, SetDidQuit etc which, while fairly harmless, interlock with OC subsystems that you may not be using.

 

It's a matter of cherry-picking the useful code, adding customisations.

 

For example, my own AddHenchman routine looks something like this:

SetAssociateListenPatterns();
SetLocalInt(oNPC,"NW_COM_MODE_COMBAT",  ASSOCIATE_COMMAND_ATTACKNEAREST);
SetLocalInt(oNPC,"NW_COM_MODE_MOVEMENT",ASSOCIATE_COMMAND_FOLLOWMASTER);
AddHenchman(oPC);
ExecuteScript("bh_levelup", oNPC);                      // Level up to PC
ExecuteScript("x1_hen_identify", oNPC);               // Identify items if I can
if (bNew) bhMakeKitDroppable(oNPC);                  // Make items droppable (unless plot or cursed) so that they can be pickpocketed by rogue NPCs
 
if (GetLevelByClass(CLASS_TYPE_ROGUE) > 0)
  {
   ExecuteScript("NW_CH_LOCK_ON", oNPC);
  }
else
  {
   ExecuteScript("NW_CH_LOCK_OFF", oNPC);  // By default, stop bashing
  }


#5
JediMindTrix

JediMindTrix
  • Members
  • 283 messages

Are there any Henchman tutorials floating about, perchance?