logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
NWNXFuncs_SetMaxHitPoints not working or user error?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
MrWakka



Joined: 09 Dec 2014
Posts: 1
Location: United States

PostPosted: Tue Dec 09, 2014 17:57    Post subject: NWNXFuncs_SetMaxHitPoints not working or user error? Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group