Adding a party member and keeping feats
#1
Posté 04 mai 2011 - 02:56
In order to add a party member you include 'ga_reset_level'
The problem is this removes all the feats i've given that party member and restores default ones.
I have a barbarian with weapon focus: warhammer ( i didn't want the same old boring greataxe), but when he joins the PC everything resets and he gets weapon focus: greataxe.
Is there any way to avoid this?
Cheers - M
#2
Posté 04 mai 2011 - 04:52
maglalosus wrote...
The title says it all really...
In order to add a party member you include 'ga_reset_level'
The problem is this removes all the feats i've given that party member and restores default ones.
I have a barbarian with weapon focus: warhammer ( i didn't want the same old boring greataxe), but when he joins the PC everything resets and he gets weapon focus: greataxe.
Is there any way to avoid this?
Cheers - M
I'm not sure why you would use ga_reset_level to add a party member. The reason that ga_reset_level resets to default is that it takes a creature back to 0 XP and then re-levels it to current XP with the level-up package it has.
// ga_reset_level( string sCreature, int bUseXPMods )
/*
Resets creature to PCs average experience level using its current level-up package.
Creature is also force rested ( full heal, spells refreshed ).
Parameters:
string sCreature = Tag of creature
int bUseXPMods = If TRUE, XP modifiers will be applied before the experience is awarded
*/
// BMA-OEI 5/08/06
// BMA-OEI 8/09/06 -- Added GetPCAverageXP(), ForceRest()
#include "ginc_debug"
#include "ginc_misc"
void main( string sCreature, int bUseXPMods )
{
object oCreature = GetObjectByTag( sCreature );
if ( GetIsObjectValid( oCreature ) == FALSE )
{
PrettyError( "ga_reset_level: object '" + sCreature + "' is invalid!" );
}
int nXP = GetPCAverageXP();
ResetCreatureLevelForXP( oCreature, nXP, bUseXPMods );
ForceRest( oCreature );
}
You probably actually want to use ga_roster_add and then ga_party_add (someone who knows party scripting better than I do will probably be able to help you more with that). Is your goal for all party members to keep XP synced to the main PC (as opposed to campaigns where only current party mates gain XP)? If so, please let us know and someone will be able to help with a systematic approach to that.
#3
Posté 04 mai 2011 - 06:20
// ga_bb_set_xp_for_level
// by Brendan Bellina
// Aug, 2008
// Conversation action script to set the xp of a creature to the
// minimum needed for a level.
// Useful when first adding a companion or henchman to a party.
// Does not take into account existing levels of the creature.
// Does not take into account races that have an xp penalty.
// By default uses GiveXPToCreature
// Defaults to Level 1
// Pass 1 as useSet to use SetXP
#include "ginc_param_const"
void main(string sPC, int nLevel = 1, int useSet = 0)
{
// Calculate required xp:
int nXP = ((nLevel * (nLevel - 1)) / 2) * 1000;
if (nXP == 0)
nXP = 1; // force to 1 to avoid giving 0 xp
// Give nXP to creature with tag sPC, or if sPC is blank to conversation owner
object oPC = GetTarget(sPC, TARGET_OWNER);
if (GetIsObjectValid(oPC) == TRUE)
{
if (!useSet)
GiveXPToCreature( oPC, nXP );
else
SetXP( oPC, nXP );
}
else
{
ErrorMessage("ga_bb_set_xp_for_level: " + sPC + " not found");
}
}
Regards
#4
Posté 04 mai 2011 - 09:34
add object
roster selectable
party add
My goal is to avoid this:
I have a barbarian with weapon focus: warhammer ( i didn't want the same old boring greataxe), but when he joins the PC everything resets and he gets weapon focus: greataxe.
However, if i don't use 'reset level' he doesnt seem to gain any XP.
Modifié par maglalosus, 04 mai 2011 - 09:36 .
#5
Posté 04 mai 2011 - 09:46
maglalosus wrote...
I always use that to add party members along with...
add object
roster selectable
party add
My goal is to avoid this:
I have a barbarian with weapon focus: warhammer ( i didn't want the same old boring greataxe), but when he joins the PC everything resets and he gets weapon focus: greataxe.
However, if i don't use 'reset level' he doesnt seem to gain any XP.
When you add the party member, do you already know what level you want them to be, or do you want them to be at the same level (or total amount of XP) as the PC is currently?
If you know what level you want them to be, use Kaldor's method.
If you just want all party members to always have the same XP as the main PC, I'm pretty sure there's a different method to keep their XP synced. I'll look into it in a bit.
Modifié par MasterChanger, 04 mai 2011 - 09:46 .
#6
Posté 04 mai 2011 - 09:53
Where do i put this script of Kaldor's? and will it allow the new party member to keep all his feats that i've given him when i created him?
#7
Posté 04 mai 2011 - 10:20
I think in your case you should just set him to level 2 with my script and he will get the appropriate xp for that level.
#8
Posté 04 mai 2011 - 10:54
#9
Posté 05 mai 2011 - 01:14
You are welcome to it if you want.
#10
Posté 05 mai 2011 - 07:53





Retour en haut






