Jump to content

Sneak mechanics q. for mod.


csbx

Recommended Posts

I'd like to introduce a sneak option for one portion of a quest I'm working on, but the game doesn't really offer fine-grain control over how detection works. In short, I want to make npcs that are 'blinded' and so are far less likely to detect the player. After some research, it seems to me that Bethesda handles detection mainly by Game Settings associated with the player [something I won't touch] and so there isn't really a 'blind' factor to alter in NPCs and how they detect.

 

One approach would be to set these npcs to a neutral faction and add a script to them to run every 3 seconds. It would do something like:

if player is within 200 units, set faction to hostile faction.

 

This would be running on npcs in a new cell with limited npcs (10 ish).

 

Is this possible ? Is it dumb ? Can it be made non-script-heavy ? Could I do this with packages instead ?

Edited by csbx
Link to comment
Share on other sites

Okay--I think the package method might work. It's not ideal because I think the package owners don't re-evaluate very often--10 s. I think ?

 

Stuck here, though, because I'm terrible at scripting. How do I refer to the npc in the package script ? I'd like one script that can be used on a series of npcs, obviously, so how do I do that ?

 

Do I use myref ?

 

In short, I want:

 

1. patrol package runs

2. conditions on package check to see that aggro radius is not violated. when condition fails, package ends and:

3. OnChange script for package adds that npc running the package to a faction that is hostile.

Edited by csbx
Link to comment
Share on other sites

Looks like I've got a soliloquy going here. Or let's say: developer's diary.

 

Tried using conditions on the creatures' patrol packages (getdistance) - it never worked. Even giving it 10 seconds to re-evalutate its package.

 

Then tried a quest script running Gamemode in the following way:

scn csbxAComplexAttackScript

ref ghoul1
ref ghoul2
ref ghoul3
ref ghoul4
ref ghoul5
                 
begin gamemode

set ghoul1 to csbxAComplexGhoul01f     
set ghoul2 to csbxAComplexGhoul02f     
set ghoul3 to csbxAComplexGhoul3f      
set ghoul4 to csbxAComplexGhoul2       
set ghoul5 to csbxAComplexGhoul3

If ghoul1.getdead == 0
  If player.getdistance ghoul1 < 250
     ghoul1.startcombat player
  Endif
Endif

...
End

The really hilarious thing is that this worked beautifully.

 

And then it stopped working and I have no idea why.

 

I've:

1) guaranteed the quest is running

2) avoided coc'ing in starting from a clean save

3) kept proximity to creature to guarantee it wasn't a lag issue

 

And nothing. If the quest is running, and so the script is running, the getdistance check never seems to satisfy, but I can't figure out why.

 

Ideas ?

Edited by csbx
Link to comment
Share on other sites

I see one of two things I'd do differently: if csbxAComplexGhoul01f and the others are refIDs then skip declaring them in the script and just use their refIDs.... But I suspect this is not the case.

 

Assuming these are FormIDs, I'd wager this is where it's going wrong. In this case, you'd probably be better off just attaching the scripting directly to them instead of using a quest script because you'd pretty much need to add a script to each form that declares them as their ref in the quest script.

 

Edit: you'll also want to use a doOnce type variable and statement as well:

 

If doOnce == 0

 

Set (declared ref) to (refID)

Set doOnce to 1

 

End if

 

 

Otherwise it'll keep setting your refs every time the script is run. Which in a gamemode block with no if statement around it can be pretty often depending on the quest's script processing delay.

Edited by uhmattbravo
Link to comment
Share on other sites

Sounds like you're trying to make the ghouls do the same thing as using the aggro radius behavior option on their AI Data tab?

Except that the number you set is when they go into warn behavior ... and then half that distance is when they initiate combat absolutely. 250 is a pretty short distance , so setting their warn behavior for 500 ? Maybe little less ? May pull off what you want without any scripting ... and probably turn head tracking off on the patrol package to look better?

 

Quote from this page ... http://geck.bethsoft.com/index.php?title=AI_Data_Tab

 

Aggro Radius Behavior

Check to enable. When a Neutral/Enemy enters the Aggro radius, the actor stops whatever he was doing and goes into Warn behavior, until the target leaves the radius or the actor goes into combat against the target. If the target remains in the radius too long, the creature will initiate combat. If the target moves to within half the aggro radius, the creature initiates combat immediately.

Edited by Mktavish
Link to comment
Share on other sites

@uhmattbravo: that's just it--I couldn't figure out which ID I was supposed to use, and how to use it. I got so used to the CK properties window that I find this confusing. I just changed to using the refIDs in the script and it's working perfectly.

 

@Mktavish: I started with the simple aggro radius approach but it just wasn't reflecting the type of response I wanted from the creature. When detected I want combat to initiate.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...