Jump to content

AI Help


LegoManIAm94

Recommended Posts

I am trying to make a AI for my NPC. His daily plan is simple. Sleep in a bedroll in the waterfront at night, Wander the waterfront in the day, go to the Merchants inn and eat and drink in the evening. Go back to the waterfront to sleep at night. But It just won't show me the reference for the bedroll and stool to sit in.
Link to comment
Share on other sites

I am trying to make a AI for my NPC. His daily plan is simple. Sleep in a bedroll in the waterfront at night, Wander the waterfront in the day, go to the Merchants inn and eat and drink in the evening. Go back to the waterfront to sleep at night. But It just won't show me the reference for the bedroll and stool to sit in.

That's because the bedroll is not a persistent object. Rather than make it persistent if the bedroll is an unowned vanilla object, just place an Xmarker near the bed, and use that as the location (radius 512) for the sleep package. If the bed is something placed by your mod, you can just make the bed persistent and use it directly as the location. The reason for handling a vanilla object differently is to prevent conflicts with other mods that might affect the same area/object.

 

For eating packages, NPCs will always try to sit when they go to eat. Unless you are wanting him to use a specific stool (not sure why it would matter for most cases), you can just use the cell as the location for the eat package. Wih an eat package, the NPC will go to the cell marked as the location and; use food if they already have it, buy food if there is a merchant and they have money, or steal food (ends in gruesome death) if they don't have money or food, and have a low responsibility. If none of these cases are present, the NPC will normally just stand in the interior. The item used for an eat package is always random, just as is the seating.

 

If you really want a specific animation (eat vs drink) you will need to do quite a bit more work and setup useitemat packages for each individual action. For eating, set the location to the stool, and the target to be a specific food item that is in their inventory (you can precede this package(s) with a find package related to the same object in order to force them to buy/acquire that object before eating). Normal drinking is done in the same way, except with one of the vanilla alcohol types. There's a drunken idle, but this cannot be used when sitting.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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