How to use custom skills in script ?
delolia
Member Posts: 9
Hello,
I try to add some custom skills on my module but I have an issue with it. Actually the skills.2da is on the hak file, I can create a character with that skill correctly etc... no problem with that.
But.. I cannot use this skill on my scripts. the "constant" of the new skill is not in the base list and if I try to create the constat by myself with an include (const int SKILL_XXX =28; for example), it's seems ok but commands like GetSkillRank is not working with my custom one. (I used the line 28 and if I put on chat the value of the skill with GetSkillRank, Always 0... but it's ok with the base skills)
Do you know what I can do to resolve that?
I try to add some custom skills on my module but I have an issue with it. Actually the skills.2da is on the hak file, I can create a character with that skill correctly etc... no problem with that.
But.. I cannot use this skill on my scripts. the "constant" of the new skill is not in the base list and if I try to create the constat by myself with an include (const int SKILL_XXX =28; for example), it's seems ok but commands like GetSkillRank is not working with my custom one. (I used the line 28 and if I put on chat the value of the skill with GetSkillRank, Always 0... but it's ok with the base skills)
Do you know what I can do to resolve that?
0
Comments
Otherwise I would suggest for you to create the simplest test situation with a barebones module and a hak with only skills.2da in it.
A script on the area's onenter event should be something like this.
void test(object oPC) { int nSkill = GetSkillRank(28, oPC); SendMessageToPC(oPC, IntToString(nSkill)); nSkill = GetSkillRank(28, oPC, TRUE); SendMessageToPC(oPC, IntToString(nSkill)); } void main() { object oPC = GetEnteringObject(); DelayCommand(6.0f, test(oPC)); }
Make a new character, put ranks into the skill, and once you enter the area wait a few seconds. If it still doesn't work then double check the hak has been added and there are no strange things in the 2da. As a sanity check you can use Get2DAString(string s2DA, string sColumn, int nRow) to check your 2da direction.