Jump to content

How to disable running for player or NPC if wearing item?


Recommended Posts

Good evening everybody!

 

For a mod that I am working on I need to create a very heavy backpack that disables running when it is worn.

I will just a backpack mod, duplicate one of the backpacks and attach a script to it. (for testing)

(Eventually I will make a custom mesh ...)

 

That script should disable running for the "wearer" of the backpack.

This should work if the player wears the backpack, but also if an NPC wears the backpack.

 

 

But the only script function I have found that has to do with enabling or disabling running is "EnableRunning - InputEnableLayer".

https://www.creationkit.com/fallout4/index.php?title=EnableRunning_-_InputEnableLayer

 

And I have no idea what is meant with "Enables or disables the player's ability to run on this layer.".

 

 

To get something like this to work on the player would be easy: Just make it very heavy (like 1000000000 units) and the player will be overencumbered.

But NPCs don't care about that, right?

So I would need some scripted way to make them not be able to run while wearing that backpack.

Link to comment
Share on other sites

You could put a script on the armor

InputEnableLayer inputLayer

Event OnItemEquipped(Form akBaseObject, ObjectReference akReference)
inputLayer = InputEnableLayer.Create()
inputLayer.EnableRunning(false)
inputLayer.EnableSprinting(false)
EndEvent


Event OnItemUnEquipped(Form akBaseObject, ObjectReference akReference)
inputLayer.EnableRunning(true)
inputLayer.EnableSprinting(true)
EndEvent

Link to comment
Share on other sites

  • Recently Browsing   0 members

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