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!
Henchmen questions
Débuté par
Bubba McThudd
, nov. 12 2010 05:12
#1
Posté 12 novembre 2010 - 05:12
#2
Posté 12 novembre 2010 - 09:51
void SetMaxHenchmen(
int nNumHenchmen
);
int nNumHenchmen
);
#3
Posté 12 novembre 2010 - 10:18
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.
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.
#4
Posté 13 novembre 2010 - 03:58
Bubba McThudd wrote...
1) Which scripts need to be altered to allow more than one henchmen?
This goes in the module's OnModuleLoad event.Mudeye wrote...
void SetMaxHenchmen(
int nNumHenchmen
);
-420
#5
Posté 14 novembre 2010 - 06:22
Thanks!





Retour en haut






