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
Another idiot question
- Teric neDhalir
- Githyanki
- Posts: 1495
- Joined: Mon Jan 05, 2004 10:04 pm
- Location: Manchester UK
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!
[22:52] <Veilan> obviously something sinister must be afoot if a DM does not have his social security number in his avatar name!
- AcadiusLost
- Chosen of Forumamus, God of Forums
- Posts: 5061
- Joined: Tue Oct 19, 2004 8:38 am
- Location: Montara, CA [GMT -8]
- Contact:
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:
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.
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
}
}
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.
- Teric neDhalir
- Githyanki
- Posts: 1495
- Joined: Mon Jan 05, 2004 10:04 pm
- Location: Manchester UK
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
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