Jump to content

Place dead npc INSIDE object


Recommended Posts

It might be a stupid question. I have a hollow object, let's call it a jar, that I want to move a corpse into. I can occasionally do so, but it's not very consistent. The jar is a constructible object in the Workshop Menu.

I'm using MoveTo, SetPosition, and SetAngle, but it still ends up off to the side of my hollow object. Weirdly enough if it works on the first jar during a game instance, it works on all of them. If it doesn't work on the first one, it has the same offset when used on subsequent jars.

Any thoughts?

Link to comment
Share on other sites

I remember we've talked in Garden of Eden SE's comments section so if using that is fine, and assuming this is an inventory level project and not something like the Cryopods in Vault 111, maybe PickUpObject() is able to place objects, including NPCs, in containers and actor inventories.

("Maybe" because Starfield's code has an equivalent function and I don't remember whether it could put non-equippable forms into inventories in Fallout or in Starfield but I know it could..).

   ; # Makes akActor to instantly pick up iCount number of
   ; # instances of akReferenceToPickUp. Can be essetially used to clone inventory items
   ; # because the code reattaches all instance data of akReferenceToPickUp to
   ; # the duplicates. Optionaly abPlayPickUpSound to play the pick up sound.
Function PickUpObject(Actor akActor, ObjectReference akReferenceToPickUp, int aiCount, bool abPlayPickUpSound) native global

This one's for furnitures but don't know if it works on dead NPCs:

   ; # Moves akActor instantly to akFurnitureRef (and makes them sit on it)
   ; # optionally, one can specify the target MarkerID of akFurnitureRef
Function MoveActorToFurniture(Actor akActor, ObjectReference akFurnitureRef, int aiMarkerID = 0) native global

 

Of course, if there's a working vanilla way that's preferred but I can't think of anything other than MoveTo either: Disable-->MoveTo-->Enable / perhaps Resurrect-->Disable-->MoveTo-->Enable (assuming the actor ref wasn't flagged as "Starts Dead").

Edit: Actor.SnapIntoInteraction() came into my mind, this function is used by one of the Vertibird Companion AI packages if I'm remembering right. You may want to try that first.

Edited by LarannKiar
Link to comment
Share on other sites

Thanks for the reply 🙂

this is a cryopod type situation, but another part of it is inventory level, so I just tried PickupObject() for that part: it picked the actor up but crashed when I tried dropping it back into the world. Still, that was pretty fun lol

So I'm going to try the furniture and snap into interaction next, thanks for the idea 😀

 

EDIT: So far nothing works for dead actors really, and even resurrecting them to put them in a chair isn't working out consistently, plus it's bad for the corpses' inventory.

I'll have to think of something else


EDIT 2: Okay, so I made a duplicate of my jar object with no collision, to swap in and out with the final jar, letting me place the body properly via registering the body for OnGrab() and OnRelease()

Link to comment
Share on other sites

  • Recently Browsing   0 members

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