Jump to content

Automatically adjust item properties with script?


CharmicsMods

Recommended Posts

I'm looking to create a script that automatically change's items' weight when picked up, based on the class of item.

 

I'm planning to use Event OnItemAdded and a few if statements, but I don't know syntax for how to check if the item is armor / a weapon / food / misc / etc, and I don't know what syntax to change the item's weight.

 

I've looked through what documentation I can find on papyrus and skse, but nothing seems to apply to item properties. I just keep seeing things on doing things manually in the creation kit, which obviously doesn't work for modded items etc.

 

Sorry if this is a dumb question, I'm a total novice to papyrus and skse. :tongue: Thanks!

Link to comment
Share on other sites

The SKSE function you want to use to set an item's weight is called SetWeight. This function does not persist across game sessions. It only changes the weight in active memory. Thus you need to utilize some maintenance code to run each time the player starts up the game. This requires using OnPlayerLoadGame.

 

Assuming OnItemAdded event, you can determine what the added object is with the following...

 

If akBaseItem as Armor

ElseIf akBaseItem as Weapon

ElseIf akBaseItem as MiscObject

ElseIf akBaseItem as Potion

ElseIf akBaseItem as Ingredient

etc...

Link to comment
Share on other sites

  • Recently Browsing   0 members

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