Aller au contenu

Photo

Custom Skills + Feats


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
Ellychid32

Ellychid32
  • Members
  • 37 messages
I've edited the skills.2da, tlk and cls_skills to include a bunch of new skills for use in my game. They show correctly in the character sheet, however when I go to use them in checks they do not appear to work. The two scripts I am using with them are a custom_skills include, which lists the skills and assigns them numbers, and one for checking the skill (getskillrank >10 =true, for example).

Here is an example of my scripts:

custom_skills:

const int SKILL_SENSE_MOTIVE=28;
const int SKILL_DISGUISE=29;

check:

#include "custom_skills"
int StartingConditional()
{
    int nSkill = GetSkillRank(SKILL_SENSE_MOTIVE,GetPCSpeaker());
    if (nSkill > 10)
    return TRUE;
return FALSE;
}

The check does not work for the new skill. What is wrong here?

Thanks!

Modifié par Ellychid32, 19 mars 2013 - 05:47 .


#2
Surango

Surango
  • Members
  • 307 messages
Have you put a debugger message in to make sure it's checking your skills? Something like...

SendMessageToPC(OBJECT_SELF, "Your skill check: " + IntToString(nSkill) );

You're also not doing an else statement for return FALSE, so sometimes it won't know what to do. Try this:

#include "custom_skills"
int StartingConditional()
{
int nSkill = GetSkillRank(SKILL_SENSE_MOTIVE,GetPCSpeaker());

if (nSkill > 10)
{ return TRUE; }

else
{ return FALSE; }
}

You can add your debug message (if you want one) before the last closing bracket. Hope this helps.

Modifié par Surango, 21 mars 2013 - 02:23 .


#3
Dann-J

Dann-J
  • Members
  • 3 161 messages
There are all sorts of issues related to skills.2DA concerning line numbers:
http://social.biowar...3/index/5147508 

You could try using different line numbers. Perhaps using the reserved line numbers that others seem to have used:
http://nwn2.wikia.co...da_Reservations 

#4
Ellychid32

Ellychid32
  • Members
  • 37 messages
Thank you both for your answers.

I've created a smaller 2da with just one skill to test this. The skill is Sense Motive, which is currently on the line 39; a line indicated as being fine.

Surango,I tried a few scripts including yours, a few variations of my own, and even one from the Script Generator, all of which had an option to return false. However none but my original compliled correctly, is this an issue?

Also tried to add your debug line, but it cancels the conversation. The IntToString(nSkill) was not able to find a skill either (causing the game to crash).

Modifié par Ellychid32, 21 mars 2013 - 08:30 .


#5
Surango

Surango
  • Members
  • 307 messages
I didn't use your constants, just the skill number 39 you indicated. Compiled just fine for me using the advanced script compiler. You can find that here: nwvault.ign.com/View.php

Like Dan said, some of the 2das are a little wonky. You can add a note to your script if you need it to know what skills are which. Sometimes it likes numbers instead of constants.

Here's what was in the tool set:

int StartingConditional()
{
    int nSkill = GetSkillRank(39,GetPCSpeaker());
    SendMessageToPC(GetPCSpeaker(), "Your skill check: " + IntToString(nSkill) + " vs 10" );
    if (nSkill > 10)
    {return TRUE;}
    else
   {return FALSE;}
}

Modifié par Surango, 21 mars 2013 - 12:00 .


#6
Surango

Surango
  • Members
  • 307 messages
Just to note, it also compiled using your constant. Check your spelling in the 2da. It could be something that simple causing the game to freeze and crash.

#7
Ellychid32

Ellychid32
  • Members
  • 37 messages
I got it to work... (finally). Turns out it was an issue with my test 2da, which I suspect was an issue with my other one as well. Row numbers are very sensitive, if there is one where the row number and the actual position of the row do not match, it will not work.

Also, who invented gc_skill_dc, it is rubbish. Why on earth would you not match their numbers to their actual rows?

Ah well. Thank you Surango for seeing me through this.

#8
Surango

Surango
  • Members
  • 307 messages
Something I just thought of... skill focus feats. Are you doing them? I don't think the engine would know what to do with them as they are. You would just need to do another if statement for if they have the feat.

You can poke around in my pack if you like, get some ideas. Most of my functions are in sv_inc_spells

nwvault.ign.com/View.php

Modifié par Surango, 29 mars 2013 - 12:54 .