Remain in stealth mode after setting a trap - is it possible?

I find it especially annoying that after setting a trap,my character exits stealth mode automatically,especially when I’m within the enemies’ line of sight. Sure, I can press F1 immediately after setting the trap, but it quickly becomes tiring.

So, is there a way to remain stealthy? Can it be done or is it hard-coded into the engine? I’ ve already searched the Vault for a hak or something, but I couldn’t find anything of this sort.

Any help would be greatly appreciated!

PS. I’m using the Diamond Edition.

This isn’t quite what you’re asking for, but - if the modules you’re playing have tagbased scripting activated, you could set up scripts named to match the trap kit tags, in which you make the PC reenter stealth mode when the trap kit is unacquired and no longer exists.

Or there’s the option of making a stealth-reactivating script with a recursive function that keeps checking whether the caller is currently stealthed and re-stealths them if they aren’t. You’d turn that on and off via console commands, as needed. Could make it speed up while enemies are in range, slow down when there are none. :thinking:

1 Like

t is hardcoded into engine, however i know how to change that behavior with nwnx, might include in next version of my plugin

1 Like

Since it’s hard-coded, for single player a workaround is to set traps out of sight, then lure the enemy into chasing you over the traps.

I did once encounter a module (forget which) where the author had implemented a stricter rule, that prevented the PC from running over their own traps without setting them off, but it normally works.

One of the few ways that rogues can kill badass bosses without hours of tedious hit-and-run.

1 Like

Yeah, that’s how I usually play my rogue. Unfortunately, that’s not always doable, especially when I’m in a relatively confined space and without any cover.

That’s great, Shadooow! I’ d really welcome such a feature.

Thanks for the help, everyone! I really appreciate it.

In Nwn2 I believe you do not exit stealth when setting traps, but it feels like a bit of an exploit. You can set traps over and over while literally standing next to an enemy so that they are triggered immediately. The way Proleric described it is exactly how the trap system should work, for me.

I’ve tested the restealthing pseudoheartbeat thing a bit, and it seems to do the trick - or, at least it spares you having to manually re-stealth yourself.

https://neverwintervault.org/project/nwn1/script/restealth-console-command

If you’re gonna try it, I’d really appreciate bug reports or mentions of any troubles or snags at all. I’ve got some other stuff going on with pseudoheartbeats on players; if any problems with this arise, that would be of major interest to me. ^^’ Pls gief bugtesting.

1 Like

Wow, that was fast!

I’m sure gonna try it and I’ll report anything unusual or bug-like.

Many thanks, TheBarbarian!

1 Like

Well, so far, I haven’t noticed anything unusual. The only problem is that the re-stealthing is constant, irrespective of whether there are enemies around or whether i set a trap.

Is there a way to make the re-stealthing kick in only whenever i set a trap?

The only way I can think of straight off is the tagbased route, setting up scripts to trigger when the trap kits are unacquired. It’d only work in modules in which tagbased scripting is activated, though, and only for the trap kits for which a script has been set up. :thinking: So if a module has custom trap kits, then it wouldn’t work for them, and it wouldn’t work for all modules. Shadooow’s NWNX route is more likely to work, there.

I can alter the restealth loop to only make the caller go into stealth mode if there’s an enemy in range, if you like, though. Hold up a sec.

edit: v2 uploaded, should no longer attempt to restealth when no enemies are nearby. Range increased to 40f.

1 Like

Ah, yes, much better now!

Still not ideal, but a great effort nonetheless, given the engine’s limitations.

Loads of thanks, TheBarbarian! I’m really grateful for your efforts. :hugs:

1 Like