Author Topic: HireHenchman or AddHenchman?  (Read 380 times)

Legacy_Grymlorde

  • Sr. Member
  • ****
  • Posts: 362
  • Karma: +0/-0
HireHenchman or AddHenchman?
« on: July 31, 2015, 06:19:00 pm »


               

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!



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
HireHenchman or AddHenchman?
« Reply #1 on: July 31, 2015, 10:02:12 pm »


               

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.



               
               

               
            

Legacy_Grymlorde

  • Sr. Member
  • ****
  • Posts: 362
  • Karma: +0/-0
HireHenchman or AddHenchman?
« Reply #2 on: August 03, 2015, 06:03:48 pm »


               

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 .
                     
                  


            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
HireHenchman or AddHenchman?
« Reply #3 on: August 04, 2015, 08:29:49 am »


               

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
  }


               
               

               
            

Legacy_JediMindTrix

  • Sr. Member
  • ****
  • Posts: 383
  • Karma: +0/-0
HireHenchman or AddHenchman?
« Reply #4 on: August 04, 2015, 09:36:38 am »


               

Are there any Henchman tutorials floating about, perchance?