Author Topic: Henchmen questions  (Read 408 times)

Legacy_Bubba McThudd

  • Sr. Member
  • ****
  • Posts: 254
  • Karma: +0/-0
Henchmen questions
« on: November 12, 2010, 05:12:06 pm »


                Greetings all,

Two queries:
1) Which scripts need to be altered to allow more than one henchmen?

2) Is it possible to tinker with a henchman's script so that the henchman remains X levels lower than the PC?

Cheers!
               
               

               
            

Legacy_Mudeye

  • Full Member
  • ***
  • Posts: 238
  • Karma: +0/-0
Henchmen questions
« Reply #1 on: November 12, 2010, 09:51:10 pm »


               void SetMaxHenchmen(

   int nNumHenchmen

);
               
               

               
            

Legacy_Mudeye

  • Full Member
  • ***
  • Posts: 238
  • Karma: +0/-0
Henchmen questions
« Reply #2 on: November 12, 2010, 10:18:47 pm »


               To make a henchman that levels up with the PC.

You first make a level 1 henchman.  It must be level 1. You can give it any feats or anything you want.

In the conversation where you take the henchman on, you add a little code to the ActionsTake script where you get the henchman.  This will level up the henchman to your level (or below if you like).  the variable levelsBelowPC is the number of levels below the PC that you want the henchman to be.  The PC level needs to be at least (1+levelsBelowPC).


  object pc = GetPCSpeaker();
  int pcLev = GetHidDice(pc);
  int i;
  int levelsBelowPC = 1;
  int lev = GetHitDice(OBJECT_SELF);
  lev = lev + levelsBelowPC;
  for( i=lev; i<pcLev; i++ )
  {
    LevelUpHenchman( OBJECT_SELF );
  }
 
 
That will level the henchman up to the level of the PC-1  when you first get them.

Now to keep them leveled up you put some code in the Modules event script for the event OnPlayerLevelUp

    object pc = GetPCLevelingUp();
    int maxHenchmen = GetMaxHenchmen();
    int i;
    for( i=1; i<=maxHenchmen; i++ )
    {
        object hench = GetHenchman(pc, i );
        if( GetIsObjectValid(hench) )
        {
            LevelUpHenchman( hench );
        }
    }
   
Every time the PC levels up any henchmen will also level up.  If you drop a henchman and regain them later the first script will level them up to the right level and then when you level up again the second script will keep them at the right level.

   
               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Henchmen questions
« Reply #3 on: November 13, 2010, 03:58:36 am »


               

Bubba McThudd wrote...

1) Which scripts need to be altered to allow more than one henchmen?


Mudeye wrote...

void SetMaxHenchmen(
   int nNumHenchmen
);

This goes in the module's OnModuleLoad event.

-420
               
               

               
            

Legacy_Bubba McThudd

  • Sr. Member
  • ****
  • Posts: 254
  • Karma: +0/-0
Henchmen questions
« Reply #4 on: November 14, 2010, 06:22:24 am »


               Thanks!