![]() |
![]() |
|||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
Making Skill Checks Intended Audience: [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). 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: So you could have something like this: "Oh, I certainly couldn't tell you that. It's confidential." If I selected option B, the dialogue would proceed on two paths: | #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) int GetLevelByClass(int nClassType, object oCreature = OBJECT_SELF) int GetHitDice(object oCreature) int GetAbilityModifier(int nAbility, object oCreature=OBJECT_SELF) At any rate, here's an example of a quick home-made skill check, say using the Heal skill on a dialogue node: 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.
|
|||||||||||||||||||||||
|
|
||
|
Multiplayer Games at Neverwinter Connections
|
||
|
Buy Premium Modules
|
||
|
4,060,538 BioWare Users:
|
||