Jump to content

Reset Inventory on NPC/Follower?


Recommended Posts

I made a custom follower with custom weapons and have been testing the mod. First of all, let me just say that I have never used the "moveto" command so much in a game, lol! Anyway, I took her into an Oblivion Gate and somewhere in there she lost both her custom shield and weapon (and her torch). I know how to get these things back for myself. My question, since this is a mod I intend for release, how do I stop her items from being lost? The resurrect command doesn't respawn lost inventory it seems......or does it? I would make her essential, but I hate doing that because it kinda ruins the game for me when they can't die. Can I flag her stuff as quest items? Thanks for any help in advance.

 

I'll throw another question out since I'm at it. I gave her custom combat animations as well. She uses about a quarter of them. Is there a better way to make her use all the custom animations like through a script or something?

Link to comment

Animations: use Blockhead

You put the animation you want in the meshes\characters\_male\specialanims  folder

 

You must use the vanilla names of the kf file with a added part.

Example: you want a onehandblockhit.kf for your companion.

You put the onehandblockhit.kf in the specialanims  folder.

You rename it to

onehandblockhit_BLKD_PERNPC_xxxxxxx.esp_00yyyyyyy.kf

xxxxx you replace with the esp namw of your companion Mod

yyyyyy is the base ID of your companion in the esp.  the 6 last numer/letters. If you see in the CS or TES4Edit 010A65F3 you use the 0A65F3.

And if your mod name is MYCompanion the whole kdf name is

onehandblockhit_BLKD_PERNPC_MYCompanion.esp_000A65F3.kf

 

A bowidle.kf

bowidle_BLKD_PERNPC_MYCompanion.esp_000A65F3.kf

...

..

 

----------------------------------------

 

I never heard that a NPC loose the shild.

A weapon he can loose when he is disarmed ( even a essential  NPC can lose a weapon by disarming )

But a shild? Do you have a Mod that drop broken weapon,shild armors? Or Lovers rape setting are set to drop items ?
 
And torches are used so he can have no torches after some nights and dark caves. 
Have you set the torch in the invertory to -1 ( Yes - ) So the NPC will always have a torch. The same you see with food, set it to -1 and the NPC has always food to use the eat AI package.
 
If you lost your weapon by disarming you pick it up,  but a NPC does not do it (He rather takes a weapon from a dead man as to pick up his own.)
So all you can do is take care and take the weapon when he drops it.
 
Or did the NPC lost his weapon and shild when you close the Oblivion gate by taking the seal stone?
Do you use a Companion return from Oblivion Mod ? ( I am not sure if  it is part of the  unofficial Oblivion patch  ) I use CRFO.esp
 
But you have the mod , you have the ID of the weapon and shild.
In game open the console and click on the NPC and enter
additem xxyyyyyy 1
xx Load order of the Mod esp
yyyyyy the id of the item.
 
...............
If you set the weapon as quest item in the esp and you see that the NPC drop the weapon ( is disarmed) and you take the weapon   .... you can not drop or give the NPC the weapon, It will be in your invertory forever ( of cause you can remove the quest item flag with the console )  And I do not know if NPC are not able do drop quest items, or if a quest item weapon can not be disarmed .

 

-------------------

And your follow AI pack of your compaion.   You say you use the "moveto"  command ofter.

Have you set in the follow AI Pack

Must complete

Skip fallout behavior  ( so he do not stop to talk to other NPCs )

And in most Mod follow AI packs the duration is set to 999999 ( not 0 )

Link to comment
15 minutes ago, movomo said:

If we're talking about only the idle animations, maybe try making an inventory token, condition idle animation to use the token, give it to your dudes and call PickIdle on them.

Thanks. I found some instructions on the tesalliance site that explain what i need. But, I'll try your suggestion if it doesn't work. Installed a total overhaul mod that is completely scripted and now I'm regretting it.

Link to comment
On 8/18/2019 at 1:08 PM, KoolHndLuke said:

I took her into an Oblivion Gate and somewhere in there she lost both her custom shield and weapon (and her torch).

Your companion was reset with all the oblivion plane content. Her inventory was then reset to the one of her base actor.

To avoid that, you can make her a quest object.

https://cs.elderscrolls.com/index.php?title=SetQuestObject

Just check the box "Quest object" on her record in the TESCS.

 

Another solution implies to set a mark once you activate the oblivion gate, then to teleport your follower to the mark once you activate the sigil stone.

This requires a quest script to set a handler:

  SetEventHandler   "OnActivate"      MyOnActivate           "object"::playerRef

And a XMarker placed anywhere, named as "MyMarkREF"

 

In your MyOnActivate script:

Spoiler

ScriptName MyOnActivate

 

; performs a teleport or ensure it will work
; works on:
; - oblivion gates (from outside: set the portal as teleport marker)
; - sigil stones (from inside: teleport all followers to teleport marker)
; - doors to SI/Tamriel (teleport followers to the adequate static destination)

 

ref activatedRef
ref activatingRef

 

string_var sTmp

 

Begin Function { activatedRef, activatingRef }
  If(activatingRef != playerRef)
    Return
  ElseIf(activatedRef.IsActivator == 0 && activatedRef.IsDoor == 0)
    Return
  EndIf

 

  ; - activating an oblivion gate
  If(activatedRef.IsOblivionGate)
    If(playerRef.IsInOblivion)
      Return
    EndIf
    ; set the teleporter marker
    MyMarkREF.MoveTo playerRef
    Return
  EndIf

 

  ; - activating a Sigil Stone
  If(playerRef.IsInOblivion)
    If(activatedRef.IsActivator && activatedRef.IsDoor == 0)
      Let sTmp := activatedRef.GetModelPath
      If(-1 == sv_Find "\SigilStone" sTmp)
        sv_Destruct sTmp
        Return
      EndIf

      sv_Destruct sTmp
      ; make all people escape oblivion before reset
      Call MyMoveAllFollowersTo MyMarkREF
    EndIf
    Return
  EndIf

 

  ; - activating a SI door
  If(activatedRef.IsDoor == 0)
    Return
  ElseIf(activatedRef == SE01Door1REF)
    Call MyMoveAllFollowersTo SETamrielDoorMapMarker
    Return
  ElseIf(activatedRef == SE08OrderFringeDoorREF)
    Call MyMoveAllFollowersTo SETamrielDoorOrderedMapMarker
    Return
  ElseIf(activatedRef.GetBaseObject == SE01Door3)
    Call MyMoveAllFollowersTo SEGateMapMarker
    Return
  EndIf
End

 

And your MyMoveAllFollowersTo script:

Spoiler

ScriptName MyMoveAllFollowersTo

 

; move all people following the player to a mark

 

ref where

 

ref me
int i
array_var vFollowers

 

Begin Function { where }
  Let vFollowers := playerRef.GetFollowers
  Let i :=  ar_Size vFollowers
  While(i > 0)
    Let i -= 1
    Let me := vFollowers[ i]
    me.MoveTo where
  Loop

End

 

Anyway, people must exit the oblivion plane before it is reset, either by teleporting them before it happens or by getting priority as quest object.

This is not only true for repeatable oblivion planes, I got the same problem as yours with Peyrite's.

Link to comment

The Companion return from Oblivion Mod ( CRFO.esp ) The Mod does exactly that, it teleport the companion out of the Oblivion world.

crfo.esp

 

-----------------------------------------------

And the Inventory:

KoolHndLuke wrote

I made a custom follower with custom weapons ...

So the base NPC have the weapon and shild.  But a NPC reset does not reset the inventory.

KoolHndLuke tried " resurrect " but it does not reset the inventory, only reset health.

 

So if theNPC is disarmed during a fight he will not get back the weapon. If you set the wepon and shild "Quest item"  I do not know if he can not be disarmed anyway ( weapon dropped)

But a Mod that drop items when broken can not drop the shild.
 
EDIT:
I tested it . The Resurrect command reset the NPC inventory !!!
KoolHndLuke something is wrong in your game.
I removed some items from a NPC inventory.
I use resurrect and it restore all Base ID/NPC items. And it does not remove the Lovers Sex token ( The NPC still have the "Sex with player" token )
And I used "Kill" then "Disable" - "Resurrect" - "Enable"    and all base items restored and still all Lovers token in the inventory.
So if the Items are in the companion Mod esp, in the NPC inventory, they must be restored when you use resurrect... or your game is broken.
Link to comment
On 8/26/2019 at 4:17 PM, fejeena said:

I made a custom follower with custom weapons ...

So the base NPC have the weapon and shild.  But a NPC reset does not reset the inventory.

KoolHndLuke tried " resurrect " but it does not reset the inventory, only reset health.

Fejeena, I may be wrong, but the topic's title is: Reset Inventory on NPC/Follower

I do not think a game breaks easily (I'd not say the same for Skyrim).

Link to comment
On 8/26/2019 at 9:17 AM, fejeena said:

or your game is broken.

It's in the scripting of MOO. I looked through the ini to see what I could adjust, but didn't find anything that helped. I asked the mod author if they knew what was happening and he/she just acted like it wasn't their mod doing it- even though I tested and know its his/her mod doing it!

 

So I made the decision that since I liked everything else this mod does that I would just give her a vanilla weapon until I could figure out how to fix it. :classic_smile:

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use