Persuade, Intimidate, etc

Not sure if this is the right place to ask, but I;m having problems implementing the persuade. intimidate, etc functions. Can anyone offer any advice?

Thanks!

The topic possibly belongs in the Scripting section a little more than in General Natter, but that aside, sure. :slight_smile: Forum’s always a good place to ask scripting questions.

How are you currently going about it? There are a lot of different ways to customize the way you use a character’s skills. If you’re trying to set up dialogue options that only appear on a successful persuade/intimidate roll, you could put a script like this one into the “Text appears when…” option of that dialogue node:

int StartingConditional()
{
    object oPC = GetPCSpeaker();
    // Make the player roll for intimidate; if the result is 10 or higher...
    if (GetIsSkillSuccessful(oPC, SKILL_INTIMIDATE, 10))
        return TRUE; // ... abort the script at this point, and return TRUE (the node will be visible).

    return FALSE; // Otherwise, default to returning FALSE (the node will not be visible).
}

Pretty sure build-in script wizard in the dialogue editor has such basic functions.
You don’t even need to touch code for it.

Yes, well I’m not a complete noob, I used the built in script wizard in the conversation editor. They seem to work with my henchmen just fine, but ONLY with henchmen. regular NPC’s fail every time, I gave my testing PC uber stats in an effort to have sure success during testing, but she still fails every time when dealing with normal NPC’s

Have you tried the starting conditional scripts that are built into NWScript? I just checked and there are 6 different intimidate (easy, medium & hard) split between ordinary intimidate and strength based intimidate. Full list of the (somewhere in the 200-250 region) built-in starting conditional scripts here. That is a .doc document. If you’d prefer a pdf version I included one in this package.

Just to be thorough, I also tried the lstk for 1.69 and it produced this -

/* 
 *  Script generated by LS Script Generator, v.TK.0
 *
 *  For download info, please visit:
 *  https://neverwintervault.org/project/nwn1/other/tool/ls-tk-script-generator
 */
// Put this under "Text Appears When" in the conversation editor.


int StartingConditional()
{
    // Get the PC who is involved in this conversation
    object oPC = GetPCSpeaker();

    // The PC must pass a DC 15 intimidate check.
    if(!GetIsSkillSuccessful(oPC, SKILL_INTIMIDATE, 15))
        return FALSE;

    // If we make it this far, we have passed all tests.
    return TRUE;
}

Which is almost identical to the script that @TheBarbarian produced independently. If neither of those work then something mildly odd is going on. If you’ve got anything in your override folder try clearing it. If you are using some other script system try disabling it.

Of course that assumes that you are wanting the PC to be the one doing the intimidating, etc. If on the other hand you wanted the NPC to do the intimidating you would replace oPC with OBJECT_SELF.

TR

Just noticed that the code generated by lstk is overly complicated and could be reduced to

int StartingConditional()
{
    // Get the PC who is involved in this conversation
    object oPC = GetPCSpeaker();

    // The PC must pass a DC 15 intimidate check.
    return GetIsSkillSuccessful(oPC, SKILL_INTIMIDATE, 15);
}

TR

1 Like

Try this as an alternative -

int StartingConditional()
{
    object oPlayer = GetPCSpeaker();
    
    // Determine skill checks
    // Remove calls to d20() to remove random element
    // As used GetSkillRank() takes account of any bonuses as well as the base skill rank
    // Change default final parameter to TRUE in call to function GetSkillRank in order to just use base skill rank
    // e.g. change GetSkillRank(SKILL_INTIMIDATE, oPlayer) to GetSkillRank(SKILL_INTIMIDATE, oPlayer, TRUE)
    

    int iPCSkillCheck = d20() + GetSkillRank(SKILL_INTIMIDATE, oPlayer); //replace SKILL_INTIMIDATE with whatever SKILL_* you want
    int iNPCSkillCheck = d20() + GetSkillRank(SKILL_INTIMIDATE, OBJECT_SELF); //replace SKILL_INTIMIDATE with whatever SKILL_* you want

    // Compare the two skill checks
    
    return (iPCSkillCheck > iNPCSkillCheck);
}

Adapted from script in the lexicon.

TR

Thank you Tarot Redhand.I appreciate your efforts on this. I spent some time browsing the lexicon myself last night in an effort to better comprehend whats going on. I’m getting ready for work now, but will implement these scripys tonight and see what we get.

Ulo