You are on page 1of 4

Making Skill Checks

Intended Audience:
By David Gaider
[Printer Friendly / Syntax Highlight]
First off, if you don't know how D&D 3rd edition is set up for skill checks, here's the
basic of how it goes: whenever you're trying to perform an action using your skills, you
roll the d20 (20-sided die, getting a number from 1 to 20) and add to that both the rank in
the skill and the ability bonus for whatever ability is tied to that skill. Higher is always
better, and you are trying to equal or exceed the DC... the 'difficulty class' number which
is set by the DM.
So let's say a player wants to use his Disable Traps skill on a trap he's found. The DM
determines the DC to be 25 (a fairly hard task). The player has 8 ranks in Disable Traps
and a +3 modifier to his Dexterity (the ability tied to Disable Traps). He rolls the d20 and
adds +11 to his roll, needing a 14 or higher to succeed in the task.
For such things as Disable Traps and most other skills, the skill checks are handled by the
game engine and often all that is needed from the DM is the DC (if that).
There is no automatic command in NWScript that does these checks for you, however, if
you are using a skill check in a script (whether to check for success of Persuade in
dialogue or some other use of a skill that isn't automatically covered). If you want to use
them, you're going to have to either script it or use the function in the official campaign
that we've made.
The Official Campaign's function
The thing about the AutoDC command that's defined in the official campaign that some
might not like is that the DC is automatically generated... it is not specified each time.
When the scripter uses the command, they specify either DC_EASY, DC_MEDIUM or
DC_HARD and a DC is generated based on the level of the NPC.
The syntax of it is as follows:
int AutoDC(int DC, int nSkill, object oTarget) //didnt see this function in ScriptAssist in
NWN2 toolset
So if I wanted to make a persuade of an NPC that the PC is in dialogue with a hard test, I
could use this:
AutoDC(DC_HARD, SKILL_PERSUADE, GetPCSpeaker());

A note here that a skill check returns an integer (the 'int') because the command should
return either TRUE or FALSE. False (or a '0' integer) means that the check has failed.
True (or a '1' integer) means that the check has succeeded.
If you're using a skill check in the dialogue editor, you need to 'split' the conversation...
meaning that more than one dialogue stems from the same PC response. When the
dialogue is presented with choices like this, it looks to the scripts in 'Text Appears When',
starting with the top node and working its way down to the bottom. The first node that
has a script that returns TRUE (or has no script), it uses.
An example of a script with an easy Persuade check: //As far as i know, in NWN2
skillchecks in conversations are done with gc_skill_dc, or gc_skill_rank (somebody on
NWN2 forums said that in OC they used gc_skill_rank in conversations, and not
gc_skill_dc)
NWScript:
#include "NW_I0_PLOT"
int StartingConditional()
{
int iCheck = AutoDC(DC_HARD, SKILL_PERSUADE, GetPCSpeaker()) == TRUE;
return iCheck;
}

So you could have something like this:


"Oh, I certainly couldn't tell you that. It's confidential."
A. <Persuade> "Oh, I'm sure there's no harm in telling me."
B. <Threaten> "Tell me or suffer the consequences, wench."
C. "Let me ask you something else, then."
If I selected option B, the dialogue would proceed on two paths:
|
|
--> #1. (with persuade script in 'Text Appears When') "I suppose you're right. Ok, this is
how it is..."
|

|
--> #2. (with no script) "Forget it, I'm not telling you."
#1 above is the 'successful' path, #2 the 'failed' path. If the script in #1 returns TRUE then
that path is followed and the player was successful. No script is needed on the failed
path... if the successful path was FALSE, that meant the PC failed his skill check.
Writing Your Own Function
To write your own skill checks, you just follow the same logic that you would as if you
were about to do the check in pen-and-paper. You need the PC's bonus to the die roll, the
die roll and the DC (provided by the DM).
Some commands you might want to use:
int GetSkillRank(int nSkill, object oTarget=OBJECT_SELF)
This returns the rank + ability bonus of the oTarget's skill.
int GetLevelByClass(int nClassType, object oCreature = OBJECT_SELF)
This returns the creature's level in a particular class (such as CLASS_TYPE_FIGHTER).
int GetHitDice(object oCreature)
This is useful if you want the character level of the PC, regardless of their class(es).
int GetAbilityModifier(int nAbility, object oCreature=OBJECT_SELF)
Gets the modifier for a particular ability, useful if you want a strength check only, or
something similar.
At any rate, here's an example of a quick home-made skill check, say using the Heal skill
on a dialogue node:
NWScript:
int StartingConditional()
{
int iDC = 20; // or whatever the DM wishes to set it to
int iBonus = GetSkillRank(SKILL_HEAL, GetPCSpeaker());
if ((d20() + iBonus) >= iDC)
{
return TRUE;

}
return FALSE;
}

Of course this is just an example... there is a built-in method for using Heal normally
(with the ActionUseSkill command, actually)... this kind of scripting would be for custom
skill checks, which I know people will want to do.

You might also like