If so, and you want to still let players detect it, then use a “fake” version (another trigger) for them to detect, but leave the real trap undetectable.
Those “Lens of Detection” spoil my whole fun (… to kill a PC … )
@Lance_Botelle : the code of the impact script of the spell “Find Trap” seems to ignore everything, it will disable even “undetectable” or “undisarmable” traps.
This is my solution so far (in case, somebody is interested). It’s the original script with two additional lines: if the DC is greater than 35, the spell will not disable it anymore. So only a rogue with proper skills can disable it …
My bad … I meant that I am not familiar with the spells (not that they were not there) and that the differences in detection/disarm may have been different between NWNs.
if all you want to do is literally find traps and not disarm them, you just need to comment-out that line in the spell’s impact script nw_s0_findtrap.nss :
//DelayCommand(2.0, SetTrapDisabled(oTrap));
this will also change the behaviour for the loupe item that calls the spell.
“Find traps” is a common spell for clerics and wizards, but the “detection lens” item makes it available for everybody. No good.
There are differences for sure. Seemingly NWN2 uses a script with the very same name, but it doesn’t disable the trap. Instead there seems to be a function to highlight the trap. Ah, and it’s buggy.
By now I guess, overwriting the original bio script is the best solution as shown above. It’s easy to add additional checks within the loop.
Every spell has an “Impact script” where you’ll find, what the spell actually does to the target. In this script are checks for restrictions, immunities and saving throws too. The script can be opened with the toolset, even if it’s an original bio script.
Seemingly there is no “Open Script” function in the NWN2 toolset. So I used a placeable and could find the impact script in question.
I once updated one of my own detection scripts to place the red glow on a target (because it did not apply it on a door in question), but other than that was there anything else?
Here is a snippet (with comments) from one of my own trap scripts … perhaps this is the issue you are alluding to? i.e. You want detection red glow without needing to set the trap as “trapped”?
if (iDetectRoll >= nDC)
{
// USING SetTrapDetectedBy FUNCTION TURNS THIS RED
// UPDATE: DOES *NOT* WORK UNLESS "TRAPPED" IS SET TRUE, WHICH WE DO
// NOT WANT TO SET ON MY OWN TRAPS. THEREFORE, WE NEED THIS AFTER ALL
effect eGlow = EffectVisualEffect(VFX_DUR_GLOW_RED);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGlow, oTrap);
oTrapSourceDestroy = OBJECT_SELF;
}
The last condition in line 44 will abort the loop on the first trap which is non detectable, omitting all the traps in vicinity, which would be found if the loop weren’t aborted.
A very rare situation I guess, but nevertheless it’s wrong.
Good catch - I’ll edit the script for my own campaign now, just in case such a rare situation should ever arise.
Traps (OC) is an area I have not done too much with. (I did some work for some homebrew traps, but that’s all.) I guess it’s an area I may have to add to my todo list and look at more closely at some point in the future.