So I can't seem to get GetDetected to return true only when the calling actor detects the player. It returns true when any NPC can detect the player. Here's the most recent incarnation of the script:

CODE
begin fp_report2

short see

if ( MenuMode )
    Return
endif

set see to ( "fargoth"->GetDetected player )

if ( see == 1 )
    MessageBox "they sure see you"
endif


end


I get the messagebox when any NPC at all can detect me. This is a global script, as it has to be for me to make this work without MWSE. Has anybody else had issues with this?
I haven't used it myself, but SfD reckons it returns true if the actor is detected at all (by anyone). Is that how it's supposed to work? unsure.gif

Edit: Could you use something with GetTarget, instead?
Scripting for Dummies 8 page 168 has a script for determining if a character is looking in the players direction. Perhaps that in conjuntion with getdetected would work.
I certainly think I could work out something using facing, and I'll give it a try. I am quite skeptical if it will work for my purposes though since in this particular instance I am trying to determine if any one NPC from a particular list can detect you. Hmm...I'll figure something out though. shrug.gif
Theres the "GetLOS player" function.
Ok, so I've learned a few things. GetDetected calling an NPC's ID if there's more than one reference in the game will return nothing. For example:
CODE
GetDetected "fargoth"

Assuming the calling actor can detect Fargoth, this returns 1. But:
CODE
GetDetected "Imperial Guard"

doesn't return anything! Not 0, not 1...absolutely no return at all. There's only 1 Fargoth, but many guards. Now if I do:
CODE
GetDetected "Imperial Guard00000002"

I get a value returned.

GetLineofSight and GetLOS work in the same way.

Quite interesting to know really, and it certainly makes sense. But all of this info doesn't really help me. I'm trying to determine if the player can be detected by any guard NPC at a given time. I try to do this by using "Imperial Guard"->GetDetected Player, which doesn't seem to work either. That returns 1 if any NPC can detect the player. I'm quickly running out of options here, I'm trying not to resort to MWSE for this if I can help it. I'm saving that for the "deluxe" version of this mod. heee.gif
Um... well... How about starting a bunch of targeted scripts from hello voices?

Yes, I'm grasping at straws. tongue.gif
Here’s a thought inspired by Melian’s last:

If idle greetings only fire if the player is detected by the NPC, create an empty greeting filtered for your guards and Hello > 30 and Hello < maximum range (a value of your choosing, read on). Then SetHello for the guards to be a value corresponding to what you decide their maximum detection distance would be (if 30 is ‘normal’, then perhaps 300). Include some action in the results section of that ‘greeting’ that is detectable by your script. Certainly it will require some finesse to SetHello for the intended NPCs at the appropriate time, but I have every confidence in you. wink.gif
sorry about the post I had a question but will post that somewhere else!

Maria
Submit a Thread