BioWare Atari
Informazioni BioWare Giochi BioWare Supporto Forum Visit the BioWare Store
Neverwinter Nights Home
Neverwinter Nights Home

Making Skill Checks

Intended Audience: For Builders
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)

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:

NWScript:

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:

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.

 

 

BioWare Twitter
Neverwinter Nights 2 Forums
Mostra/nascondi

English
Deutsch
Français
Español
Italiano

Mostra/nascondi

Vedi le immagini più recenti 

Vedi le immagini più recenti
Mostra/nascondi

Multiplayer Games at Neverwinter Connections

Today
Schedule a Game...



L'ora attuale è: (imposta ora)
sab, 21 novembre 2009 09:58

Mostra/nascondi

Download Modules

Top NWN: HotU Modules:
1. Good vs Evil III
2. More...

Top NWN: SoU Modules:
1. Good vs Evil III
2. More...

Top CEP Modules:
1. The Lord of Terror The Diablo Campa...
2. More...

Top Modules - NWVault:
1. Hall of Fame
2. More...

Total Modules: 4423

Mostra/nascondi

5,047,091 utenti BioWare:
  62 collegati
  3 nascosti
  228 ospiti

1557 Playing Online
  100% NWN
  100% NWN: SoU
  98% NWN: HotU

447 Registered Guilds

8,768,265 messaggi nei forum

Nuove discussioni:
1. Stupid MAKO!! (Mass Effect 1 General Discussion (No spoilers allowed))

2. An Idea Realized and Marquee Abi... (Mass Effect 2 General Discussion (No Spoilers Allowed))

3. I've never playe... (Baldur's Gate II: SoA and ToB General Discussion)

4. Why are you developers scared to... (Mass Effect 2 General Discussion (No Spoilers Allowed))

5. hidden trail (NWN2: Builders - NWN2 Toolset)