Jump to content

Function assistance: Find and use nearest bed


FlashyJoer

Recommended Posts

Hi all,

 

I apologize ahead of time if the answer is obvious - or there are resources I havent been successful in locating on google. That said, I was wondering what exactly would need to be called to make your follower locate the nearest bed and use it? Ive seen examples of Closest.MoveTo but this isnt giving me what I need in terms of usage. If anyone has a small and simple snippet of code that will trigger the follower to locate and use nearest bed, that would be wonderful and Id thank you profusely!

Link to comment
Share on other sites

Unfortunately it's not obvious or simple, but it is possible. You need to set up an AI package for your follower / NPC. When I was making Scavver, I found most of my answers on the Skyrim side of the wiki.

 

To find/use a bed... Sleep (Procedure): https://www.creationkit.com/index.php?title=Sleep_(Procedure)

 

To find/use other specified items: https://www.creationkit.com/index.php?title=Find_(Procedure)

 

Package Templates (Skyrim side): https://www.creationkit.com/index.php?title=Category:Package_Templates

 

(For comparison: Anemic Fallout 4 side documentation: https://www.creationkit.com/fallout4/index.php?title=Category:Package_Templates )

 

Look for YouTube tutorials from Seddon4494 and Darkfox127 if you decide to dive into the AI rabbit hole.

Link to comment
Share on other sites

There's also Sandboxing, which includes sleep functionality at night: https://www.creationkit.com/fallout4/index.php?title=Sandbox_(Procedure)

 

Alternately, if you wanted to build a pure code solution from scratch, the starting point would probably be FindClosestReferenceOfType. But once the code located a bed, you wouldn't have the walk to bed or sleep behaviors.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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