Jump to content

Un-Equip/Re-Equip Equipment Script?


ExoArchivist

Recommended Posts

So I'm rather new to scripting and I could use some help with a basic mod I'm working on. Basically, I'm making a sauna but I'd like it so that when you sit down on a bench it un-equips everything you have equipped, then when you get up or perhaps use a different object or some other trigger occurs, all that equipment is automatically re-equipped to save the player the trouble of having to go through their inventory and re-equip everything.

 

Still, I'll settle for just an un-equip all script, but I'd prefer both. Thanks!

Link to comment
Share on other sites

If you are new to scripting, concentrate on just getting the unequip working reliably first. Unequipping is easy - there's a script function called, not surprisingly, UnEquipAll().

 

Re-equipping is harder because it involves remembering what has been equipped and re-equipping each item separately. You will quickly find that you need SKSE functions to do that and SKSE is not available yet for SSE so leave it as something to come back to later.

Edited by OldMansBeard
Link to comment
Share on other sites

If you are new to scripting, concentrate on just getting the unequip working reliably first. Unequipping is easy - there's a script function called, not surprisingly, UnEquipAll().

 

Re-equipping is harder because it involves remembering what has been equipped and re-equipping each item separately. You will quickly find that you need SKSE functions to do that and SKSE is not available yet for SSE so leave it as something to come back to later.

 

If they UnEquipAll() they will have a hard time keeping track of what was equipped. They would need to check what items are equipped, then unequip them and add them to a formlist or keep track of them another way.

Edited by Masterofnet
Link to comment
Share on other sites

 

If they UnEquipAll() all they will have a hard time keeping track of what was equipped. They would need to check what items are equipped and then unequip them and add them to a formlist or keep track of them another way.

 

 

Yes, of course. But if he tries to do that straight away, he will get nowhere without SKSE. Better to get something simple working now, get the triggering scheme solid and plan to add more functionality to the scripts later.

 

Actually, you can't do it with a formlist because that will only store base items and player enchantments will get lost; but you can do it with an array of forms, which is just as good.

 

Re-equipping arrows and bolts is a challenge. It is possible, but not obviously so.

Link to comment
Share on other sites

 

Actually, you can't do it with a formlist because that will only store base items and player enchantments will get lost; but you can do it with an array of forms, which is just as good.

 

You would put the Armor and weapon ObjectReference in the form list. You would not lose any enchantments. Yes an array is just as good. I would like to hear more about that.

 

Are you suggesting that if the player took and Iron Sword and enchanted it, then you unequipped it via script, checked for the Sword in the players inventory and reequipped it via script, the game would remove the enchantments from the sword and equip a base iron sword?

 

 

Re-equipping arrows and bolts is a challenge. It is possible, but not obviously so.

 

 

Why do you consider this challenging?

Edited by Masterofnet
Link to comment
Share on other sites

  • Recently Browsing   0 members

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