Jump to content

Need help getting current carry weight value


1NTEGRAL

Recommended Posts

Hi all. I'm trying to make a dynamic encumbrance mod and I can't seem to figure out how to get the current carry weight. I looked in the Papyrus documentation and I couldn't find anything. Currently, I'm trying to use GetValue() to get the weight. However, when I looked at the debug notification, I got something akin to "70.0000, 141.0000". Is there a way to get the current weight or does Papyrus not support that?


Here is my code:


Event OnTimer(int aiTimerID)

if (aiTimerID == dynamicEncumbranceTimerID)

Actor p = Game.GetPlayer()

float cwBase = p.GetBaseValue(CarryWeight)

float cw = p.GetValue(CarryWeight)

Debug.Notification(cwBase + "," + cw)

if (cw > (cwBase / 2))

cwBase = cwBase / 2 ; Did not want to add two /2's to the next line so repurposed variable

float newMult = Math.Max(100 - (75 * ((cw - cwBase) / cwBase)), 0)

p.SetValue(SpeedMult, newMult)

EndIf

;Debug.MessageBox("Tick tock...")

StartTimer(5, dynamicEncumbranceTimerID)

EndIf

EndEvent

Link to comment
Share on other sites

Unlike Skyrim, there is no way to get the current carry weight value. Only the base and maximum value. And as you seem well versed in math and may instead attempt to use GetActorValuePercentage, don't - it does not work with CarryWeight. I was helping someone with the same thing on the official boards and we couldn't find a way around it.

In Skyrim you could do this with the AV "InventoryWeight" which returns the current carry weight, but for reasons unknown that was removed in Fallout 4.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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