Jump to content

NPC Packages


kingtitan

Recommended Posts

So, as you probably already gleaned from the title, I decided to start learning how to do NPC packages. I wanted to start off small just to get my feet wet but I've run into a couple of minor problems. I'm sure someone a bit more experienced can help me out though as this should be an easy fix.

 

So, here is the setup:

 

To start my learning process, I wanted to make a simulated miner (yes yes, I know there is no technical mining in Oblivion, it is more of just a visuals thing). Anyway, I went ahead and created my orc (lore -ish friendly) miner, gave him equipment including clothing, a pickaxe (that works like a one-handed weapon), and some bread (which may come to be important later on). Dropped him in the world close to a gold vein that I had already manually placed (persistent ref, comes into play later). So, then I started on the A.I. with a very simple schedule:

1) Mine (set up as a practice one-handed near the vein) starting at 8 (a.m.) for 12 hours

2) Eat at 8(p.m.) for 2 hours

3) Sleep at 10(p.m.) for 10 hours

 

Simple right?

 

So, needless to say, I started with #1. This one was pretty simple to do (I thought) as I simply told the package to start at 8, have a duration of 12, marked the "continue if PC near", "skip fallout behavior", and "defensive combat" boxes. I told it to be a "Use Item At" type of package with the location set at near the gold vein ref with the target set to Any Object -> Object Type -> Weapons: Melee.

 

For #2, all I did was drop in the default "aaaEat20x2" package already in the game. Much easier than the last one.

 

For the final package, I told the package to start at 23, have a duration of 9, marked the "must complete", "skip fallout behavior", "armor unequiped" and "weapons unequiped" boxes. I told it to be a "Sleep" type of package (of course) with the location set at near a bedroll I had already placed in the cell.

 

I thought this would be pretty foolproof, even for a beginner like me at NPC A.I., but here is the problem I ran into: All the miner does is use the first package, the other two are not being used at all! I know this could have something with me waiting in game (say from 10:30 a.m. to 8:30 p.m.) but my hunch is that the problem lies within my package setup. Is there anyone who might be able to lend me a helping hand? I would appreciate it if you didn't redirect me to some sort of tutorial, but use your personal knowledge and experience to help me troubleshoot this simple specific issue. Plus, I don't think it is a hard solve either!

Link to comment
Share on other sites

If you tick 'Continue while PC near' your NPC will not change to his next package while your character is standing there waiting for him to change to his next package. Here's a couple of CS Wiki links that may help:

AI Package

Flags on Packages

Link to comment
Share on other sites

I wanted to wait until someone replied so I didn't look like a total fool, but I read up on the "continue while pc near" flag on the wiki page right after posting that and automatically discovered that to be the problem! Thanks for the reply striker.

 

However, I do have one more question. For the sleep package, I have the "armor unequiped" flag checked. However, the miner only unequips some of his armor and leaves the rest on. Do I have to put a full set of clothing in his inventory for the flag to take effect?

Link to comment
Share on other sites

However, I do have one more question. For the sleep package, I have the "armor unequiped" flag checked. However, the miner only unequips some of his armor and leaves the rest on. Do I have to put a full set of clothing in his inventory for the flag to take effect?

 

With the caveat that I know approximately nothing about Oblivion AI, I believe that yes, you do. NPCs seem highly resistant to going around naked if there is any alternative, so I would imagine that if there is no appropriate clothing in their inventory, they will leave that piece of armor equipped.

Link to comment
Share on other sites

I've run into that on a couple of patrols I set up near White Stallion. They like to wear their boots and gauntlets to bed. Vilja on the other hand (who has a separate inventory for you to place her sleepwear) doesn't suffer from this at all, even if you come in after her bedtime in full armor. You tell her to relax here for a while and she switches to her sleep package, she dons her proper sleepwear and goes to bed. I wonder if it has something to do with the vanilla single inventory vs having a dedicated sleepwear inventory (and the extra scripting around using that).

 

- Edit - And by the way, the reason I knew that answer was because I went through exactly the same steps when I first stated using AI packages ... standing there waiting for a package change that me standing there was stopping from happening. :facepalm:

 

- Edit 2 - Thinking on this some more there's another thing comes to mind that I haven't really taken note of before. The four patrols work 6 hour shifts. Sometimes they'll go straight to bed at the end of their patrol and others they'll either sit and read or drink (depending on if it's raining). When they switch from patrol (armored) to read or drink they change to their clothes completely. Also when they get up they don't immediately go onto patrol (4 hour sleep packages), and when they get up they take off the oven mitts and boots if they slept with them on. I need to check to see if they sleep without the boots and mitts if they start the sleep package after having a 'relaxing' package. Something about that vanilla sleep package and unequipping armor is part way broken.

Edited by Striker879
Link to comment
Share on other sites

I noticed that is exactly what my NPC is doing. Not that it is a big deal (the packages still work fine), but it is of course a bit annoying. I noticed that the NPC keeps on clothing, plus his boots, gauntlets, AND anything taking up the amulet slot. It would have been nice if someone had worked out a fix for this by now, but then again, it is a very minor issue!

 

I had another problem (and devised a workaround). When the NPC was done "working" and the #2 "eat" package started two things would happen:

1) Instead of walking to the location provided them they would disappear and reappear a second later by the stool

2) Also, although I had the flag checked, the NPC would not unequip his armor, just his weapon when he started eating.

 

I thought the second one was particularly strange. But, I devised a simple workaround to fix it by giving the NPC a wander package after "working" so that he would don his clothing and not armor. That way, when the eat package started, he would already be wearing clothing instead of armor.

 

I really hope I run across a fix for the boots/gauntlets equipped while sleeping issue!

 

EDIT: After I re-read the last bit of your last post striker, I do have one question. I set up NPC to have five packages instead of three now; the extra two are basic wander packages, one after "work" the other after the "eat" package. Therefore, since the second wander package is between eating and sleeping, would that count as a "relaxing" package? If so, from my end, the NPC wears his clothing while wandering, but puts the boots, gauntlets, and amulet back on right before going to sleep.

 

 

Edited by kingtitan
Link to comment
Share on other sites

Next time I'm close to White Knight Lodge I'm going to spend some time carefully watching the little details on package change.

 

I have found with different NPCs that they'll 'warp' to their seating position at package change (I have them sit to read). If I recall correctly I lessened the effect by giving them a wander package and assigned a location marker close to their chair (but I'd need to confirm that, as it been a while since I wrestled with that one ... now that I've thought on it the other trick I used is to just have them sit for the first part in their reading chair and then have them read). By 'relaxing' package I mean anything other than eating, sleeping or patrolling (in the case of the White Knight guards they're either reading, drinking or just wandering).

 

If you look at how Bethesda worked their packages you'll see they have a default wander package that executes whenever another package doesn't take precedence. I generally use one of the 'editor location' flavours for my 'Inside Girls' esp (used to liven up the player owned homes) and either editor location or current location on my 'Outside Girls' esp (who add some flavour to the towns). I try to give them as much variation as possible, so that occasionally you get a bit of a surprise on finding them somewhere, but without knowing how to script I'm limited to the conditions and differences between different package options. When I first started using packages I tried filling the whole 24 hours like you're doing. It is easier using Bethesda's method.

Link to comment
Share on other sites

Ok, new question, but still on packages. I have created a new NPC that I would like to use as a drawbridge operator. What I would like is to have him use the drawbridge lever ONCE at say 2300 hours. Right now he only has two packages (that unfortunately are not working together very well): One that has him sit in a chair for the entire day and the other is to use the lever to let down the drawbridge. Here is the issue tho: The NPC gets up to hit the lever and continually tries to activate it without ever going back to the "sit" package. Basically, the drawbridge just keeps going up and down because the NPC keeps activating it.

 

Like I said, I would like to set it up so that the lever is only activated once at the given time, and then the NPC reverts back to sitting in his chair. After that I would like to insert another package that has the NPC raise the drawbridge once the other NPC has crossed (give him a time interval to raise the bridge basically). How is the best way to go about doing this?

Link to comment
Share on other sites

The only thing I have used that's similar is a few of my girls use the altars in the chapels. It's a 'Use Item At' package type with the flags ticked for 'Must Complete', 'Once Per Day' and 'Skip Fallout Behavior'. The schedule is set to 'Any' for day of the week, month and date. I use two separate packages if they worship twice a day ... one at 9am with the duration set to 0 (zero) and another for 18:00 (again zero duration). No conditions are set, the location tab is 'Location' ticked and 'Near Reference' and 'Cell' whichever chapel (e.g. BrumaChapel). Then the 'Ref' is set to the altar I want her to use. They have a sit package (travel package to their bench) for a couple of hours before using the altar (two hours to give them travel time to get there ... it also means that they'll be relatively close to the altar when that package fires).

 

I'm guessing that you need to set the duration to zero to keep him from spamming the lever.

 

- Edit - Their worship package also has a Target tab set to 'Specific Reference' with the cell and ref the same as the location tab.

Edited by Striker879
Link to comment
Share on other sites

  • Recently Browsing   0 members

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