A tiny bit of script help

i am trying to set the PC’s stealth mode to off if they fail a skill Hide check. Not sure how to string them all together.
i found this in the script editor, int ASSOCIATE_COMMAND_TOGGLESTEALTH
not sure…

object oTarget;
/* Script generated by
Lilac Soul’s NWN Script Generator, v. 2.3

For download info, please visit:
http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */

//Put this script OnEnter
#include “nw_i0_tool”
void main()
{

object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));

if (DoOnce==TRUE) return;

SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);

if (GetIsSkillSuccessful(oPC, SKILL_HIDE, 24))
{
RewardPartyXP(775, oPC, FALSE);

oTarget = GetObjectByTag(“GAUTH_PROTECTOR”);

AdjustReputation(oPC, oTarget, 100);

}
else
{

oTarget = GetObjectByTag(“GAUTH_PROTECTOR”);

AdjustReputation(oPC, oTarget, -100);

SetIsTemporaryEnemy(oPC, oTarget);

AssignCommand(oTarget, ActionAttack(oPC));

}

}

You need to put your code like this:

[code]
code here
[/code]

to make it readable here.

Use SetActionMode:

if(!GetIsSkillSuccessful(oPC, SKILL_HIDE, 24))
{
    /* skill check failed - turn off stealth mode */
    SetActionMode(oPC, ACTION_MODE_STEALTH, FALSE);
}
1 Like

I knew the Code Monkeys were officially set loose. “Release the Kracken” :slight_smile:
Thank you.

I was going to reply but NWShacker beat me to it. I can confirm that SetActionMode(oPC, ACTION_MODE_STEALTH, FALSE); indeed works. I have a similar script I’m using when putting the PC into stealth mode and then exit stealth mode.