Setting an arrow limit to NPCs (not player NPC) via a perk.

Post » Sun May 22, 2016 4:22 am



Hi there


I'm working on a mod which overhauls the way containers work. So far, I have been able to give them realistic weight limits and adding weight for arrows that are stored in the container. (should be combined with an arrow weight mod).


I have encountered some issues, though:


  • The script won't work on containers in custom home mods that use autosort scripts.

  • It also doesn't work with the Quick Loot mod. (untested, though)

  • I need to find a way to limit the arrows added NPCs/followers.

About the last one, I can't use arrow weight to NPCs. Since the game will still think they're 0 weight when I move them into the NPCs inventory, and won't block me from doing this, so I'll need to set a limit. I want to limit the amount of arrows an NPC can carry to 100-150. Since I also want maximum compatibility, I need to apply this to ALL NPCs (not only Vanilla followers), as some mods (AFT, FLP, EFF) have spells to make any NPC a follower. The script should also work with all NPCs added by mods, without needing to make a patch for every single mod. (Interesting NPCs, etc)


I was thinking about doing the following:


  • The script will only fire, when then player opens the inventory of an NPC (NOT vendors, though!), so no OnUpdate() to keep the script lightweight.

  • If the amount of items with the keyword "VendorItemArrow" in the NPCs inventory becomes >= 100 -> return the item(s) to the player + display message: "This person's quiver is full."

  • I need to somehow apply this script to ALL npcs. (also modded NPCs and followers) -> I'm thinking of doing this via a perk, so I can use ASIS to dsitribute the perk automatically to ALL NPCs.

Anyone know how I should to give an arrow limit to an actor (NOT ONLY THE PLAYER!) via a perk.



Thanks in advance



Kind regards



Sac




User avatar
Kate Schofield
 
Posts: 3556
Joined: Mon Sep 18, 2006 11:58 am

Return to V - Skyrim