Another idiot question

For toolset tutorials as well as question and answers.
Locked
User avatar
Teric neDhalir
Githyanki
Posts: 1495
Joined: Mon Jan 05, 2004 10:04 pm
Location: Manchester UK

Another idiot question

Post 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
User avatar
Rotku
Iron Fist Tyrant
Posts: 6948
Joined: Tue Jan 06, 2004 1:09 am
Location: New Zealand (+13 GMT)

Post 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.
< Signature Free Zone >
User avatar
Rusty
Retired
Posts: 2847
Joined: Mon Feb 21, 2005 10:36 pm
Location: London
Contact:

Post by Rusty »

Just have the server tell the players that they have failed a check every d6 minutes. :P
Thangorn
Haste Bear
Posts: 2081
Joined: Fri Oct 01, 2004 1:00 pm
Location: Queenstown, New Zealand

Post 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?
On indefinite real life hiatus

[22:52] <Veilan> obviously something sinister must be afoot if a DM does not have his social security number in his avatar name!
User avatar
Rotku
Iron Fist Tyrant
Posts: 6948
Joined: Tue Jan 06, 2004 1:09 am
Location: New Zealand (+13 GMT)

Post 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!
< Signature Free Zone >
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post 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.
User avatar
Teric neDhalir
Githyanki
Posts: 1495
Joined: Mon Jan 05, 2004 10:04 pm
Location: Manchester UK

Post 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
User avatar
indio
Ancient Red Dragon
Posts: 2810
Joined: Sat Jan 03, 2004 10:40 am

Post by indio »

Good find.
User avatar
Wynna
Dungeon Master
Posts: 5734
Joined: Sat Jan 03, 2004 10:09 am
Location: Seattle, WA (PST)

Post 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?
Enjoy the game
Locked