Page 1 of 1

Another idiot question

Posted: Tue Dec 11, 2007 1:02 am
by Teric neDhalir
Heh, me again.
So I've got some *spoiler* in the corner of the *spoiler* and a trigger so that if you go close enough and succeed in a search check you are told "You have found *spoiler*", and are given a cookie.

However, when you go in the trigger area and fail the search check you get floating text and text in the chat window saying "Search check:Failure". Bit of a give-away, that. Any way of stopping it?
Cheers,
Teric

Posted: Tue Dec 11, 2007 4:31 am
by Rotku
Try rolling a d20 and add the search check on, via the script, instead of using the function to roll the search skill straight off... if that makes sense.

Posted: Tue Dec 11, 2007 12:11 pm
by Rusty
Just have the server tell the players that they have failed a check every d6 minutes. :P

Posted: Tue Dec 11, 2007 1:43 pm
by Thangorn
Can't you just delete the SendMessageToPlayer part of the script? or make it report "" to the player? or is it a script that reports thats bundled in the ACR?

Posted: Tue Dec 11, 2007 8:03 pm
by Rotku
Rusty wrote:Just have the server tell the players that they have failed a check every d6 minutes. :P
Ha! That would be brilliant on the OAS!

Posted: Tue Dec 11, 2007 8:26 pm
by AcadiusLost
Basically, you want to code the script check manually, so it happens behind the scenes and unbeknownst to the PC(s) in question. From a trigger it would go something like this:

Code: Select all

void main() {

object oPC = GetEnteringObject();
int nDC = 25;   // Difficulty of the check

int nRoll = d20(1);  // pre-generates the d20 roll
int nSkill = GetSkillRank(SKILL_SEARCH, oPC);

if (nRoll+nSkill >= nDC) {
   // do whatever you want to do when they've found the thing
}

}
Note that NWN2 gives us an extra parameter we can pass to GetSkillRank() I believe, a TRUE/FALSE setting to set whether you're asking for their actual base ranks of a skill, or their adjusted totals (including attribute bonuses, auras, skill boosting items, etc). You'd want FALSE on that, but that is the default for the function I believe.

Also note that, as written, the script will not give any feedback about the roll or the DC to the PC. It's the builder's call on whether to show this on a successful check, in all cases, or not at all. I tend to display it (using SendMessageToPC calls) in all cases where it is the result of a PC initiated action (like activating a scroll), since I think the player is entitled to some sense of how far they missed by, etc. In this case though, it's hard to avoid metagaming a "failed check" report.

You may also want to make a persistent or local int counter on the number of checks made for any given trigger, for a given PC- otherwise even a low-skill PC may just walk through the trigger over and over again until they get lucky.

Posted: Thu Dec 13, 2007 9:33 pm
by Teric neDhalir
Look what I've found!
In the Misc props section of Blueprints>placeables is one called "Secret Object". This automatically does the search checks and spawning in of your hidden object. Set its variables as follows;
SecretObject_ResRef: The string in the "resref" column of the placeable (or item or creature) you want to reveal.
SearchDC: The DC to beat with your search roll.
Search Radius: Distance for spotting (in metres, I assume)
SearchDCDetectMode: If set to zero anyone in search mode and elves get to "Take 20" for the check roll. (Bah!)

Not so sure about the other variables, but I think they have to do with non-functioning scripting for secret doors. There are certainly fixes for this on the Vault.
TnD

Posted: Thu Dec 13, 2007 10:48 pm
by indio
Good find.

Posted: Mon Dec 17, 2007 10:51 pm
by Wynna
This is very useful. Using it now, as a matter of fact. What do you think should be plugged into the variable Time To Reset?