True Sight Aura?

Hi there, I’m trying to make a replacement for the “blind sense” ability of Dragon Disciples since in my mod I can’t give them standard nwn true sight.

So I had a few ideas, but don’t know if they are doable inside the engine. (Maybe using a combination of:

  • GetStealthMode
  • SetCanSeePC
  • AutoDC (to set to always pass listen checks?)
  • OnEnter (of a stealthed or invisible, unit? inside an invisible “circle” around the PC)

1.- An aura that shows the player and ONLY the player every creature inside of it (so I can change it from 30’ to 60’ depending on levels)

2.- Give a circumstance listen bonus to the player based on his level. Say…40 points, that way they will be able to “sense” nearby hidden creatures and the decrease in the range would not make it so that they can “sense” them further than 30’ (thanks to the +1 CD every 3 feet). But this bonus can not show on the character sheet or add up to the dice rolls.

3.- Same as the 1 version, but instead of showing you the hidden / invisible creatures it will just send you an alert via combat log when something hidden or invisible enters the area.

what do you guys think? any help is more than welcome.

wow, this is a tough one…
before launching into some possibilities that came to mind, let’s take your suggestions in turn.
1- an aura. this would require a game client hack. i don’t know if beamdog’s efforts in NWN:EE have already addressed this because i don’t use NWN:EE, but maybe someone on this forum could inform you. you might also want to take a look at nwncx, community-developed software that extends the game client to allow for more visual effects, to see if that gets your creative juices flowing. be aware that anything you develop along these lines would require players of your module to use nwncx as well.
2- a circumstance bonus. i’d normally say this would be the way to go, but your constraint that the bonus not show up on the skills list [in other words it wouldn’t even be used in the general case] complicates things. that would imply a change to the game engine code.
3- alert via combat log. i think this is probably your best bet. although it seems less elegant, it’s the most feasible given your constraints.

if we assume that you don’t want to hack the game and this solution should work w/nwn out of the box, then given your constraints we’re looking at a solution based on nwscript. there are two things you’ll need to take into account : what to reveal and when to reveal them.

answering the first question is actually pretty simple in scripting ; for example, the routine could cycle through all nearby creatures within range, check if the creature is within line-of-sight, perform discreet listen and spot checks with your desired bonus, and report the findings to the player chat window.

the second consideration is more of a hassle. you could fire your script on demand, hooking it to one of the 10 player tool feats, which would be the most economical way to do it – but that leaves the burden to the player of executing the check, when the idea behind blindsense is that the character should sense the creatures automatically. alternatively you could hook it to the module heartbeat script, but there the drawback is the same as with secret doors in nwn ; the character may have to spend a fair amount of time ‘waiting around’ for blindsense to kick in.

please post again if you’d like to explore some of these possibilities further or want help actually scripting one of them.

1 Like

Hi there, thanks for taking the time!

Yeah was thinking about the 1st and 2nd one would be pretty hard to implement. But the 3rd one with the discreet listen and spot check sounds good. The only downside is that the player won’t be able to attack or defend themselves from the hidden/invisible enemy.

Regarding the waiting time on the heartbeat, was thinking maybe it’s possible to make it work like active search mode?

Because the main functionality of the script is to allow the player to know or (hear), when anything hidden or invisible is inside its 30’/60’ area. That’s why I thought about the listen bonus since by engine it increases the DC by 1 for every 3 feet, it wouldn’t work on the whole screen like true sight does. And reading this: Creature Line of Sight and Perception - Neverwinter Nights 1: EE - nwn.wiki

the max “perception” range for a player for listen is 20mts in game (a little bit more than 60’ feet).

What about making the player auto-succeed the listen checks when something hidden or invisible enters the “area-circle” around the PC. that’s for the 30’ and for the 60’ one just let the PC auto win all the checks.

What do you think?

Also…what ideas did you have in mind?

most of what you want to do can be done, but really only through nwnx ; i.e., you’re asking for fundamental changes to game engine behaviour. if you’re developing for a pw, this might be an option to consider [for that matter, are you?], but if this is for a single-player / single-adventure module, an nwnx-based solution would most likely be more complicated than it’s worth, both for you and for the player.

however, if you are developing for a non-persistant module, there is a solution that might work for you, although it’s definitely a kludge and it’s not very effecient. the inefficiency here probably won’t be an issue w/modern pc’s for a single-player module, but it could become a resource hog if you’re developing for a pw w/potentialy several dragon disciples online at once.

so for the kludge, you could design a mobile area-of-effect w/an on-enter script to run a simple test and the skill checks, and place it on your dragon disciple in your area on-enter scripts. you’d want to put it in the area on-enter scripts because mobile aoe’s are notoriously finicky and you’d need to verify periodically that it’s still working as it should. in addition, there’s a well-known bug on mobile aoe’s you’d have to code around [it’s possible for the creature to exit its own AOE, thus ending it], but there’s already code for this on the vault. so the basic steps would be :

  • write your aoe on-enter script to do the skill checks
  • write your aoe on-exit script to re-establish the aoe if the exiting creature is the pc
  • create an entry for your aoe in vfx_persistent.2da using the scripts you’ve just written
  • write/update a general area on-enter script that will verify that the entering pc has the mobile aoe on it if it’s a dragon disciple. if you’ve already got per-area on-enter scripts, you could execute the new script from them.

i just realised i might be getting ahead of myself here. more questions -

  • what is your coding level ? does what i’m writing here provide you w/enough info, or is it gobbledygook ?
  • these dragon disciples you’ve mentioned, i’ve been assuming they’re your players, but are they npc’s ? if so, there are other [better] solutions.
  • are you coding this for a pw or for a single-adventure module ?

you could give them the ‘blind fight’ feat for that if you wanted to, no ?

also, final caveat - again, i’m speaking regarding nwn diamond, not ee. there may be a better way to do what you want in ee that i’m not aware of.

Hi there!.

  • Yes its for a PW, with about…60+ or so players, so it cant be that inefficient because we have a few DD (about 5-10).
  • Coding level, about…mid? but mostly web and some C++
  • Yeah the server uses NWNX

ah, ok, great. w/nwnx, a much cleaner approach might be possible. for example, you could hook a call to your own subroutine within CNWSCreature::DoPerceptionUpdateOnCreature() and do your dragon disciple checks there. i think you’d want to do this fairly early on, before the calls to check for use of FEAT_HIDE_IN_PLAIN_SIGHT and the calls to CNWSCreature::GetSpotCheckDistance() and CNWSCreature::GetListenCheckDistance(). that should allow you to set things up so the target creature is ‘seen’ even when it ordinarily wouldn’t be. however, programming this may take a bit of effort.

is your server 1.69 or nwn:ee ?
linux or windows ?

1 Like

Wouldnt that be a resource hog for the server?

It’s NWN: EE, on linux.

i don’t think so, no. skill checks are trivial. what would be more cpu-intensive is the line-of-sight calculation [handled later in DoPerceptionUpdateOnCreature()]. if you’re not concerned about line-of-sight [my assumption after reading the description of blind sense] you could do your skill checks early on and, if the result is true, add the target to the subject’s visible list and force return from DoPerceptionUpdateOnCreature() early, before any of the other checks are handled. this would actually end up being less cpu-intensive than running through the whole routine.

you could also hook your routine after the various other checks [including line-of-sight] nearer the end of DoPerceptionUpdateOnCreature(), which also shouldn’t really be any more cpu-intensive, but looking at the dump i’ve got, i think that could be more difficult.

ah. the ee engine is somewhat different to the 1.69 engine, and i have neither nwn:ee resources, nor the experience hacking it. the approach above might still work, but i’m not sure if the code in DoPerceptionUpdateOnCreature() is the same, or even if it’s called in the same way. nwn:ee might even have new nwscript routines that would better support what you’re trying to do. check w/@niv, i think he’d be a better resource than i. not only does he have more experience w/nwn:ee, he also has access to the source code. :wink:

Gonna try that and check with @niv! Thanks a lot mate! you helped me a lot with this!