Another NPC problem thread.

Post » Wed May 11, 2011 2:12 pm

Hey everyone. As much as I hate starting topics, I may as well start one in the nice part of the forum.

I am absolutely clueless when it comes to scripting, so when packages come into play, things can get a bit...Cluster[censored]y? I've looked up, down, left, right, even diagonally once or twice.

All I need is for an NPC to sleep, eat, sit at a desk, (when the player walks through a trigger) greet the player once, and lock and unlock the door in morning and night. Okay so maybe that's a lot.

geck.gamesas.com isn't helping, or the construction set. So could anyone lend a hand?

Thanks in advance for anything.
User avatar
NEGRO
 
Posts: 3398
Joined: Sat Sep 01, 2007 12:14 am

Post » Wed May 11, 2011 7:53 am

Well, what have you got so far? If you want my advice, start with a single task and get it working before moving on to the next. So for starters, try to get your NPC to sleep. That should take a single 'Sleep' AI package with a schedule. Once you get your package setup, test it in the game to make sure its working the way you want, then move on to the next task. Your NPC should really have two packages for this, the first one in the list should be the sleep package, the second should be a default sandbox package so they will at least move around until its time to sleep. Make a save game just outside of the cell with the NPC that you are testing before you have entered this cell for the first time. That way you can always load that 'clean' save to test your changes to the NPC. This is important because some times a save game from within the cell or after the cell has loaded will not reflect any subsequent changes. Another caveat to be aware of is how AI packages are evaluated. Every time the NPC will pick a new one, they start from the first package in their list of packages. If the conditions on that package evaluate true, then that package will be picked, if they are not true, then the second package will be evaluated, and so on. The order you place packages in the list and the conditions you place on the packages are critical in getting the correct package to be used at the proper times.

So try out the sleep package and report back with any questions. I can see this thread going on for quite a while as you progress with all the tasks you want your NPC to perform. I have chosen not to explain everything all at once because I feel you will do better to take on each task one-at-a-time.
User avatar
Amy Melissa
 
Posts: 3390
Joined: Fri Jun 23, 2006 2:35 pm

Post » Wed May 11, 2011 12:52 am

So try out the sleep package and report back with any questions. I can see this thread going on for quite a while as you progress with all the tasks you want your NPC to perform. I have chosen not to explain everything all at once because I feel you will do better to take on each task one-at-a-time.


Okay, wow. So far so good thank you so much. Got him to sleep. I'm a little confused how I put it on a schedule. I want him to sleep at night and sit at a desk in day, and make him eat in between. Should I make him guard the terminal on the desk to make him stay there?
User avatar
courtnay
 
Posts: 3412
Joined: Sun Nov 05, 2006 8:49 pm

Post » Wed May 11, 2011 7:18 am

The schedule tab on a the AI Package is where you setup a scheduled package. If you want the NPC to use the sleep package any day of the week, Leave that field as "ANY". If you want them to sleep every month of the year, leave that field as "ANY". If you want them to sleep every day of the month, leave "Date" as "ANY". Then the Time field uses military time so 10:00 PM would be entered as 22 and then enter a duration for how long this package should last, like 7. That will make this package activate at 22:00 hours (10:00 PM) and last for 7 hours until 5:00 AM.

Then you can add a new package after the sleep package that is an "Eat" package and give it a Time of 5 to indicate that it will start at 5:00 AM when the sleep package is over. Give it a duration of 2 to allow enough time for the NPC to travel to the eating location. If the eating location is within the same cell as the sleeping location, that should be enough time. With an Eat package, you can specify the exact food item the NPC will eat or a type of food they will eat, or leave those fields blank to allow any random food type to be eaten. Then select a location that you want the NPC to eat at. It must be some persistent reference in the area you want. It can be an exact chair at a table of you can have several chairs and tables in the area and use an XMarker that you place as the destination and add a radius large enough to encompass all the chairs that you want the NPC to choose from. An NPC will only choose an un-owned chair or one that you have set the ownership to that specific NPC (or faction). An NPC will not sit in a chair that is owned by another NPC or faction that they do not belong to. Note: Placing food items on the table where an NPC will sit and eat has absolutely nothing do do with them eating and can mess up the eating animation by clipping with their chosen food from the eat package. So leave the table in front of where the NPC will eat empty of food items, plates and the like.

Once you get the NPC to sleep and eat, we can go into getting them to sit in their "work" location - like at the desk you mentioned.
User avatar
victoria johnstone
 
Posts: 3424
Joined: Sat Oct 14, 2006 9:56 am

Post » Tue May 10, 2011 11:29 pm

I could never expect so much help so soon! I do have him eating and sleeping, though he only drinks. Which, honestly, I don't care at this point. His main duty is to sit at a desk and trigger a dialog when the player walks in. But whenever I set it up for him to use the chair (or the terminal on the desk) he goes into the corner of the room and stands there.
User avatar
Je suis
 
Posts: 3350
Joined: Sat Mar 17, 2007 7:44 pm

Post » Wed May 11, 2011 8:09 am

I could never expect so much help so soon! I do have him eating and sleeping, though he only drinks. Which, honestly, I don't care at this point. His main duty is to sit at a desk and trigger a dialog when the player walks in. But whenever I set it up for him to use the chair (or the terminal on the desk) he goes into the corner of the room and stands there.


Give your NPC food so he has something to eat. Make sure that it is enough space between chair and other furniture. If you want the NPC to eat food from a plate a table has to be near the chair. Btw. you don't need to make extra sleep, eat and sit packages. Sandbox includes all of them and a general schedule when to eat and sleep (the eating & sleep hours are all mentioned in the wiki) only when the quest needs it (your trigger for example) you should switch off this sandbox package. In a sandbox is no need for furniture with persistent references. A XMarker in the middle of the room as package target is enough.

To lock the door I would make simply 2 timed sandboxes as pkleiss has already written.

About your standing problem two possibility's that come in my mind: Navmesh not ok, esm/esp problem (It is a bug in the game engine which kills the navmesh on reload if you use a esp. So it works the first time but not if you reenter the cell).
User avatar
Alexandra Louise Taylor
 
Posts: 3449
Joined: Mon Aug 07, 2006 1:48 pm

Post » Wed May 11, 2011 5:41 am

You dont need to give the NPC food if you select a 'Specify Food Type' from the drop down list of the 'Eat' tab.
User avatar
TIhIsmc L Griot
 
Posts: 3405
Joined: Fri Aug 03, 2007 6:59 pm

Post » Wed May 11, 2011 6:12 am

Correct! Sorry I was in 'sandbox' mode ;). There it is needed.
User avatar
Stephani Silva
 
Posts: 3372
Joined: Wed Jan 17, 2007 10:11 pm

Post » Wed May 11, 2011 3:23 pm

What sixm says is true about using a sandbox package for eating and sleeping, but using game settings to control these times will affect every NPC in the game that uses a sandbox package for these activities. I apologize for not mentioning it before. I have an entire city of NPCs that eat and sleep and prefer that they don't all do things at the same time, so I have always made my own unique schedules for each NPC. If this does not matter to you, then sixm's method would be easier. However, you will also end up changing the schedules of vanilla NPCs that use these setting as well, if you do change the settings listed in the wiki.

To get an NPC to sit in a chair and use a terminal on a desk in front of the chair, use a travel package with the chair as the destination that has a radius of 0. The chair needs to be a 'computer' chair so that when the NPC sits in it, they will be told to play the typing animation. You can use a schedule with this package as well if you have been doing this with your other packages as I have described. If you opted to use a sandbox package for the eating and sleeping, then you will need to make sure that this travel package is listed above the sandbox package, so its schedule will take precedence over that of the sandbox package.
User avatar
Adam Kriner
 
Posts: 3448
Joined: Mon Aug 06, 2007 2:30 am

Post » Wed May 11, 2011 2:01 pm

I didn't meant that this settings should be changed. I only mentioned it for reference when these scheduling is going on.
User avatar
Raymond J. Ramirez
 
Posts: 3390
Joined: Sun Oct 14, 2007 8:28 am


Return to Fallout 3