ExoArchivist Posted November 26, 2016 Share Posted November 26, 2016 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 More sharing options...
Masterofnet Posted November 26, 2016 Share Posted November 26, 2016 OnActivate script on the bench Or BenchAlias and an OnGetup script a PlayerAlias. There may also be a way to use OnActivate when you get up from the bench but I have not tried that. OnGetup is the best solution for my purposes as I need a PlayerAlias anyway. Here is a huge list of scripts. Creation Kit Scripts Link to comment Share on other sites More sharing options...
Deleted3897072User Posted November 26, 2016 Share Posted November 26, 2016 (edited) 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 November 26, 2016 by OldMansBeard Link to comment Share on other sites More sharing options...
Masterofnet Posted November 26, 2016 Share Posted November 26, 2016 (edited) 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 November 26, 2016 by Masterofnet Link to comment Share on other sites More sharing options...
Deleted3897072User Posted November 27, 2016 Share Posted November 27, 2016 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 More sharing options...
ExoArchivist Posted November 27, 2016 Author Share Posted November 27, 2016 Thanks for the help guys! Link to comment Share on other sites More sharing options...
Masterofnet Posted November 27, 2016 Share Posted November 27, 2016 (edited) 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 November 28, 2016 by Masterofnet Link to comment Share on other sites More sharing options...
Recommended Posts