MrWakka
Joined: 09 Dec 2014 Posts: 1 Location: United States
|
Posted: Tue Dec 09, 2014 17:57 Post subject: NWNXFuncs_SetMaxHitPoints not working or user error? |
|
|
So I am trying to set the max HP of new characters to 10hp on enter, the code is as follows:
Code: | #include "nwnx_funcs"
void main()
{
object oPC=GetEnteringObject();
if (GetIsPC(oPC)&&!GetLocalInt(oPC, "UMBRAL_NEW"))
{
NWNXFuncs_SetAbilityScore(oPC, ABILITY_STRENGTH, 10, FALSE);
NWNXFuncs_SetAbilityScore(oPC, ABILITY_DEXTERITY, 10, FALSE);
NWNXFuncs_SetAbilityScore(oPC, ABILITY_CONSTITUTION, 10, TRUE);
NWNXFuncs_SetAbilityScore(oPC, ABILITY_INTELLIGENCE, 10, FALSE);
NWNXFuncs_SetAbilityScore(oPC, ABILITY_WISDOM, 10, FALSE);
NWNXFuncs_SetAbilityScore(oPC, ABILITY_CHARISMA, 10, FALSE);
NWNXFuncs_ModSavingThrowBonus(oPC, SAVING_THROW_ALL, 1);
NWNXFuncs_SetCurrentHitPoints(oPC, 10);
NWNXFuncs_SetMaxHitPoints(oPC, 10);
NWNXFuncs_RemoveAllFeats(oPC, TRUE);
NWNXFuncs_SetAllSkillsToZero(oPC);
NWNXFuncs_SetBaseAttackBonusOverride(oPC, 1);
SetLocalInt(oPC, "BAB", 1);
NWNXFuncs_RemoveAllSpells(oPC, CLASS_TYPE_SORCERER, 0, 9, FALSE);
SetLocalInt(oPC, "UMBRAL_NEW", 1);
}
else
{
int Current_BAB = GetLocalInt(oPC, "BAB");
NWNXFuncs_SetBaseAttackBonusOverride(oPC, Current_BAB);
}
} |
Everything seems to be working, except for the HP. A new character logging in for the first time will have a max of 3hp, a higher level one entering for the first time will have 50+. NWNXFuncs_SetCurrentHitPoints is working, setting the current hp to 10 even if its more than their max, though this is obviously lost on rest/damage.
Not sure if I am making a mistake somewhere, or perhaps the function isn't working right, and was hoping someone here might be able to help.
Long term goal is to basically have a skill based system, where characters level up statistics rather than gain levels. (Performing actions that are strength based for example would eventually raise your strength by one, etc.) But being able to mod HP is somewhat key to this.
I am using the windows version of nwnx functions plug-in if that makes a difference |
|