Jump to content

NPC Packages


kingtitan

Recommended Posts

Well the "use item at" command for the package technically works, but that leads to the NPC spamming the lever. I found that using the find package on the lever and then having a travel package to, say, a "xmarkerheading," works but they won't travel to a chair... Maybe naively assumed, but I figured if they were both persistent then the NPC could travel to either. Apparently I was mistaken! Oh well, I have it set up in an acceptable format now so I am not too worried.

 

However, I do have another question about vanilla animations (that ties in to packages). Did the game ever include a "writing" animation? I moved on to a different portion of my project, but since we are still talking about packaging, I thought it would be an apt time to discuss it. If not, then is there any mod out there that includes it? It may be a shot in the dark, but for the life of me I can't remember if there was or not.

 

Actually, literally as I sit here typing this I just thought of SI. How do I make a package that is similar to the one used by Relmyna Verenim when she takes notes about her victims? To be honest, I'll probably figure that out here in just a second, but would it be possible for that to be done while sitting for an NPC? Sorry for the scatterbrained response!

 

EDIT: Well, I looked through the CS to find any sort of leads, and I gotta say, it's a lot more complicated than telling the NPC to use a piece of bread! Any help would be greatly appreciated!

Edited by kingtitan
Link to comment
Share on other sites

I don't have SI installed on my gaming machine, and I'm away from home for two weeks, so I'll be of limited utility as far as research goes (unless the info is somewhere like the UESP Wiki or CS Wiki ... laptop doesn't have the game or CS installed). I can't recall anyone in the vanilla game (plus Battlehorn and Thieves Den DLCs) who writes. I know I had to do quite a bit of head scratching and searching to come up with someone who sits and reads when I was working out that one. If you do have a prospect from SI, that will make your mod SI reliant, unless the animation is also available in the non-SI game (a common problem with the sweeping animation from SI for instance).

 

If all you can recall seeing is a stand and write animation you could try a similar package arrangement as I made with the sit and drink to try and get a sitting version working. If it's there in the BSA but not used in the game it will work ... if not, well you've tried.

 

So you're saying that having the 'Use Item At' version of the lever (let's say do once at 22:00 hrs) and a travel package targeted at their chair immediately below the use item package and also set for 22:00 hrs, still results in them spamming the lever?

 

I had forgotten to mention that the chair (and likely the lever) needed to be persistent objects ... that wasn't an easy one for me to figure out either. At the time I'd have one girl who'd sit in her chair (a vanilla chair from the game that was already set to persistent) and another who wouldn't sit in the chair right beside the first (who's chair wasn't set to persistent).

 

Even though I may be limited as far as research goes (or seeing what I've done in the past), feel free to bounce stuff off me. Sometimes just thinking about a problem so you can type up a question helps you see things from a different angle.

Link to comment
Share on other sites

Well, I'm almost ashamed to say it, but I remembered the "Actors in Madness" mod and took the cheaters way out http://forums.nexusmods.com/public/style_emoticons/dark/thumbsup.gif. Plus, since I don't need the NPC to be writing at all times (and have no intention of developing his AI or personal schedule) it works out pretty well.

 

But basically yes, a "use item at" package resulted in the NPC spamming the lever (as i tried originally), while defining the same package under the "find" condition instead made the NPC use the lever only once & let him execute his next package immediately. I actually have it set up this way at present (which works):

-NPC activates lever

-NPC immediately fires travel package (to travel to another location in the cell)

-NPC immediately AFTER #2 starts his wander package at location defined in #2, but given a ~400ish~ radius from current location to wander in.

 

However, this is not the NPC that was originally told to sit after activating a lever. Honestly, all combinations I have tried have not worked to make the NPC activate the lever and then go SIT. The only thing that has vaguely worked so far is to tell the NPC to travel to the same general area via an xmarkerheading. And don't worry, the chair had been marked as persistent the entire time. In fact, isn't it impossible to select it in the package window if it is not?

 

Nonetheless, that did make me think of running a test (just like you said it might, haha imagine that!): I could keep all the packages I have right now for him; however I could possibly do two things to them that might work:

 

1) Change the duration of the current travel package (that is in use and works) to 0 (instead of having the NPC stand in the location for the duration of the time I need him to be there).

2) After that, introduce a second "travel" package immediately after for the same time but including the duration of the time I need him to be in that location. That way he would be close to the reference and not have to compute a path to reach his "location".

 

No idea if that would work until I run it in a test, but I wanted to run it by you to see if it sounds at least logical. The reason I put that together is that I already have certain NPC's who are told to sit in a chair with a travel package and time set to any, duration 0. This works flawlessly since they just sit there all day (like I want them to). However, this also means that they are placed close to the location of the chair, so it is easy to find. My theory is that the NPC is too far away to "see" his destination via a travel package if it is set to a chair (just a game "bug" of sorts). By being close to his ultimate location, the second travel package, hopefully, would tell him to sit there after traveling to near the location. Also, since a travel package is defined in the package editor as "near reference" under the location tab, I could see how a persistent chair would differ from a xmarkerheading in this respect.

Edited by kingtitan
Link to comment
Share on other sites

Ya, if memory serves the girls that go to the chapel and worship ('Use Item At' targeted on the altar, zero duration) then have a zero duration travel to where they're going to have breakfast or dinner. Those ones also never suffer from a warp like the sit to read girls. And you are correct that you can't 'Select Reference from Render Window' to a non-persistent object, which was how I eventually divined the solution at the time ... by comparing the chairs looking for differences.

 

Having a travel package to an xMarker (duration zero) and then another to his chair is what I'd try before throwing in the towel. It's similar to what I finally landed on for the sit and read girls, but I lived with their warping for a while before I went digging into it again. When you're working on a problem on your own you sometimes have to give things a little 'soak time' before you can look at the problem with a fresh set of eyes.

 

I recall reading in the CS Wiki about the differences between 'Near Reference' and 'Location'. I think they were advising against using near reference, but so many of the vanilla packages were using it and I just used them as a template. Can't say I've seen any problems from using it providing you're selecting the correct cell. I do use both methods though.

Link to comment
Share on other sites

I recall reading in the CS Wiki about the differences between 'Near Reference' and 'Location'. I think they were advising against using near reference, but so many of the vanilla packages were using it and I just used them as a template. Can't say I've seen any problems from using it providing you're selecting the correct cell. I do use both methods though.

 

Well, as I've hinted at before, I tried a lot of things that didn't work originally, splitting packages between two cells being one of them. I had to do a little bit of cosmetic work on the cell I'm using to keep everything in one cell, but it all worked out in the end.

 

Having a travel package to an xMarker (duration zero) and then another to his chair is what I'd try before throwing in the towel. It's similar to what I finally landed on for the sit and read girls, but I lived with their warping for a while before I went digging into it again. When you're working on a problem on your own you sometimes have to give things a little 'soak time' before you can look at the problem with a fresh set of eyes.

 

 

And that's exactly what I'm going to do. I had actually completely forgotten about the eating warp issue. I'm going to introduce another package like you suggested before the eat package so that the NPC will actually walk there. At present I have an idle package that fires directly before, and I think that is the whole cause of the "warp" issue. But, nothing that can't be fixed with a little bit of tinkering!

 

By the way, if you for some odd reason run across the "near ref" and "location" article on the wiki, please send me a link if you can :) always looking to include my knowledge about the inner workings of the AI!

 

EDIT: I also meant to include that instead of the fresh eyes, bouncing ideas around until they start poking holes seems to work pretty well too!

Edited by kingtitan
Link to comment
Share on other sites

LOL ... now you either have very pointy problems or you are into BOUNCING (i.e. big time bouncing).

 

Now that I've looked for it I see it was on the CS Wiki: AI Package page, hidden in plain sight. Here's a quote (emphasis added):

Location Tab: Defines the location for the package to occur. It is strongly recommended that you only use the Near Reference option. The In Cell option can produce unexpected behavior. If no location is selected then it defaults to the Near Current Location setting.

Near Reference: Select the reference from the render window or from the lists.

In Cell: Not recommended. It can produce unexpected behavior.

Near Current Location: Centers the package's location on where the NPC is when the package starts.

Near Editor Location: Centers the package's location on the default location of the NPC.

Radius: The distance from the package's center that is considered valid. The units are Inches.

Note: While in most cases the radius means from the actor outward, in the case of "Travel" packages, it means distance from the location.

Without having the CS to confirm, I believe what they are talking about is the 'In Cell' that is on the right side of the 'Location' tab (the side that also has the 'Near Editor/Current Location' options). So what I do is stick with 'Near Editor/Current Location' on the right side of the panel and freely use the 'Cell' and 'Near Reference' that are on the left side of that 'Location' tab. I looked at a lot of Bethesda AI Packages and followed their lead for which side to use for what type of packages (and fiddled around trying things on my own too, you learn more from mistakes than from doing things right after all).

 

Often an easily overlooked handful of words on a wiki page can make a big difference (for example I'm sure that somewhere on a wiki page there is mention of the persistent reference thing ... probably just says "Must be persistent object" ... four words that can easily get lost in an explanation of a related subject).

Link to comment
Share on other sites

Actually, those are the only three I ever use! I could see the "in cell" option being useful if for instance you had a wander package set inside a small cell, such as a waterfront shack. Beyond that, I can't see much use for it at all.

 

New question though, something I have been thinking about since I started this. How do saves affect an NPC's AI? It seems like half the time when I use one particular save (I did not save in the cell as the NPC's) the one with the wander package never traveled to the location that he was supposed to go. He just stands close to his bed, idling aimlessly (during his wander package). Then when time comes for him to hit the lever after wandering, he still will. Now, bear in mind, normally his packages work fine, so that isn't the issue. I'm just curious how saves affect NPC behavior. Also, as a side note, his "editor location" is close to his wander location, so theoretically any time his wander package is active I assume he will be near there.

 

Does this have anything to do with the "No low ai processing" flag?

 

And as soon as I run those travel tests, I'll put up my results. Didn't have time last night unfortunately!

 

EDIT: I re-examined the "wander" package mentioned above. I think that my mistake may have been embedded in the fact that his wander package location was set to "near current location" instead of "near editor location." I'll see if I run in to any more issues in the future, but I believe that should have fixed it.

Edited by kingtitan
Link to comment
Share on other sites

There is a difference in result between current location and editor location, and I sometimes try to use the less predictable nature of current location to my advantage in simulating randomness. For instance sometimes I'll make their 'have a drink' package a current location package, so I'm not sure where they'll be when they decide it's Miller time. What works against that is I believe when I enter the NPC's cell (or perhaps it's the adjacent cell) they start out from their editor location adjusted by the package that is relevant to the current time. I don't think they'll be found at any 'mid points' though (i.e. halfway to their travel package's destination). If I have a girl who should be half or part way from house A and headed to destination B within the same city, I'll never come across her where I can say she left before I entered the cell. She may be outside of the door for house A and a small distance towards her destination, but I'll never find her almost at her destination. It's almost like the game calculates where she would have started that hour of the day and when I enter the cell or adjacent cell it starts running the appropriate package.

 

If the game hasn't already 'killed off' all the various travelers between cities in your game you can see some of what I'm talking about (why would Bethesda spend all that time and money developing NPCs that could quite possibly get killed on the roads between cities before you've ever even had a chance to meet them ... baffles me why they weren't at least started out as essential until you've met them once via dialogue ... end rant). All the travelers I've seen in the CS start out at midnight (not very realistic). If they were supposed to be leaving the IC at midnight and you get to the west end of the Talos bridge before close to 1 am you'll see them trudging down the bridge, headed towards their destination. Get to the west end of the bridge at 1 am and you'll not be able to find them anywhere between the IC and their destination (they walk, I run, I'd surely catch up to them somewhere in between). If you enter a cell that they would have walked to by that time and the cell you just left was closer to their destination than their calculated position and you'll find them in between. If you run ahead and then stop to clear out a gang of bandits that would have jumped the NPC, and they walk past and to the next cell before you're done playing with the bandits and you won't be able to catch up to them again (actually the bad guys won't bug them unless you're in the same or perhaps adjacent cell, so when they die it's really your fault, whether you see them or not). If you can catch them before they get to the next cell you'll still be able to ride shotgun for them (the things you discover when you're playing in 'The Saviour of the World' mode).

 

Sometimes I'm not sure where an NPC is when I enter the cell. I have two girls who mostly hang out at the Bruma gate for instance, bugging the guards and sort of being hookerish. If I enter Bruma at a time when they both should be in Olav's quaffing a few before 'work' I'll often only find one. I've looked everywhere in Olav's ... no dice. I go outside and check all of the Bruma city exteriors (neither girl has an interior package except Olav's) ... nada. Go back into Olav's and there she is, getting gunned up. I've no idea where she is when I can't find her. I figure it just adds to the 'randomness' I'm shooting for. Now when you're shooting for "I want NPC A to be at location B at time C, ready to do task D" that 'randomness' could be a bit disconcerting.

 

On the subject of how saves figure into all this, from what I've seen if I save and the NPC is in the same cell (so their exact current state is part of the save) they'll be mid gulp if they were banging back a few at the time (or mid dance if they were doing the sedance.kf). If they're not within the view of the player it's a bit harder to say for sure if they'd be mid anything, even if they're in the same cell (in other words, if a tree falls in the woods but nobody is within earshot, will it make a sound). I think if you don't have eyes on them when you save they'll be more like the examples I've posted above, but it's not something I've concentrated on (when I'm testing NPC package runs I'll always start out the run from a save in an adjacent cell (different interior in the same city for example). If you're not in the same cell when you make the save the previous examples are what I've observed.

 

Whew ... you really got me rambling that time!

Link to comment
Share on other sites

Forewarning: I haven't yet read your above post at the time of posting this, I didn't think you would be so quick to reply striker! I'll apend this post as a reply later.

 

HUGE breakthrough. I actually kinda feel stupid now that I didn't figure this out earlier (it seems to rudimentary!). The adding of the chair travel package after the original travel package helped me come up with this:

 

"Hmm, why not just make a "find' type package that has the xmarkerheading as the location and the chair as the target instead of having two travel packages?"

 

Needless to say, it worked beautifully. The NPC activated his lever, went to the location and immediately sat down.

 

I'm making these packages more and more airtight! I'm dreading learning conditions though. I have one package in particular that I could use a single condition for, but at present it works fine without. The condition would just help eliminate a few more minor issues.

Link to comment
Share on other sites

Ah, but conditions are where you get to make the world seem real. Why would my girls sit at the Chorrol great oak to read if it's raining? I'm going to be looking into new territory (i.e. 'find') when I get back home. Nice find (I know ... so clever).
Link to comment
Share on other sites

  • Recently Browsing   0 members

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