Jump to content

[Papyrus] Arrow Weight, for player and followers


Recommended Posts

I'm trying to find a way to add an actual weight to arrows, but not only from the player, also other NPCs, like followers. Meaning you can't just dump all your arrows in the inventory of any NPC. (I already found a way to make this work for containers.)

 

There are some mods which do this, but none of them add an actual arrow weight for NPCs. I would prefer to do this with any OnUpdate scripts, though. I'm okay with adding a scripts to arrow AMMO records, though. (As I'm getting

into MXFP, so I could use that to apply the script to every arrow/bolt in ones load order.)

 

Is there any way to do this?

 

Thanks in advance

 

Kind regards

 

Andre

Link to comment
Share on other sites

Requires SKSE 1.7.2 or Above

A quest with a player Alias and a script attached the the alias.

Using the following events/functions:

 

OnPlayerloadGame()

GetModCount()

GetModName()

GetAllAmmo() ;Filtered by Keyword

SetWeight()

 

Using the above you can get every type of base form arrow/bolt from every loaded esm/esp and set the the base form weight.

 

Obviously though this would be fired every time the player loads a game as SetWeight() is not save persistent.

But if done right you can do it with minimal impact on load times.

Link to comment
Share on other sites

AMMO records do not have a weight entry. As a result SetWeight() will not work (according to CK wiki).

 

A solution would be to create an ammo quiver item (armor or misc object) that you give to the NPCs and player. As AMMO is added to the actor, count the total ammo, multiply by a preset weight value per individual ammo then use SetWeight() to change the weight of the ammo quiver.

Link to comment
Share on other sites

AMMO records do not have a weight entry. As a result SetWeight() will not work (according to CK wiki).

 

A solution would be to create an ammo quiver item (armor or misc object) that you give to the NPCs and player. As AMMO is added to the actor, count the total ammo, multiply by a preset weight value per individual ammo then use SetWeight() to change the weight of the ammo quiver.

 

I have seen this approach on other arrow weight mods. But would that actually work on followers? I mean if you want to put arrows into their inventory that pushes them over their weight limit, will the arrows be greyed out? Like other items?

Link to comment
Share on other sites

I tested it with these 2 mods:

 

- http://www.nexusmods.com/skyrim/mods/37816/? -> This one makes use of an MCM.

- http://www.nexusmods.com/skyrim/mods/28264/? -> This one is like you told me, with the dummy quiver items.

 

I quickly tested it with both, one at a time. Neither of them work on followers.

 

I console added 100 dragon bones to myself and gave them to a follower. Then I kept adding other items, until every item in my inventory was greyed out (= inventory of follower was full), the arrows weren't greyed out, though. Regardless, I tried adding 1k arrows to the follower and it just let me, without blocking anything.

Edited by AndrealphusVIII
Link to comment
Share on other sites

Then it is most likely due to the fact that the ammo record does not have an entry for weight. What could be done is the actor's overall weight is checked when ammo is added and if over weight, return the ammo to source container or drop if picked up with notification as to why of course.

Link to comment
Share on other sites

Then it is most likely due to the fact that the ammo record does not have an entry for weight. What could be done is the actor's overall weight is checked when ammo is added and if over weight, return the ammo to source container or drop if picked up with notification as to why of course.

 

I'm not really sure how to do that. Could you help me with that?

Link to comment
Share on other sites

Script directly on actor or on a quest's reference alias that points to the actor would have an event something like this:

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
	If akBaseItem as Ammo
		Actor ME = Self.GetActorReference()
		If ME 	;am I valid?
			Float CW = ME.GetActorValue("CarryWeight")
			Float IW = ME.GetActorValue("InventoryWeight")
			If IW >= CW
				Debug.Notification("Can't carry any more")
				If akSourceContainer 	;ammo come from a container or NPC
					ME.RemoveItem(akBaseItem,aiItemCount,false,akSourceContainer)
				Else
					ME.DropObject(akBaseItem,aiItemCount)
				EndIf
			EndIf
		EndIf
	EndIf
EndEvent 

It could probably be improved upon but it is a start.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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