Jump to content

[LE] [Script]RemoveAllItems with exception those are worn/equipped


anb2004

Recommended Posts

Hi

 

Basically a very first stage for auto sorting stuff, putting all player items into specific container that already has auto sorting script after activate something. The only addition that would be great is, how to make worn/equipped armor & weapon is not affected by it, so player just don't go...well u know the situation is. Anyone care to show how to code that ?

 

  Reveal hidden contents

 

Novice scripter here, any help will be appreciated

Link to comment
Share on other sites

Do not use RemoveAllItems. Instead build formlists of objects that you want sorted to the different containers. Then loop through those lists checking each object to ensure that it is not equipped or a favorite prior to removing it. Problem, it is extremely slow.

 

Here is a function I made for my Inventory Management System mod that included the process described above. It is commented out because it is extremely slow and I did not want something that took a long time to process. At least it gives you an idea.

 

  Reveal hidden contents

 

Link to comment
Share on other sites

  On 3/25/2020 at 2:09 PM, IsharaMeradin said:

Do not use RemoveAllItems.

 

Yeah, realize RemoveAllItems is a bad idea, tested with new player with few items in inventory is ggreat but with items more than 50+ is like having a system freeze.

 

  On 3/25/2020 at 2:09 PM, IsharaMeradin said:

Instead build formlists of objects that you want sorted to the different containers. Then loop through those lists checking each object to ensure that it is not equipped or a favorite prior to removing it.

 

That's the thing, i want to avoid using formlist if possible because it kind of "limited", it also the reason i set up a trigger on activate to take all player items into a container than another trigger to sort all the items inside it (same as Jaggarfeld did).

 

Planning to release a player home with auto sorting function. My main goal for the auto sorting is by having a single activator (like leaf rest did) that can check all player items for every each akbaseitem and base keyword than take all items and stored them into each assigned container without using formlist and leave equipped items untouch (so any added/modded items can work as well and of course they were set with appropriate keyword).

 

Believe i've tested any auto sorting mod and i found 2 type of mechanism :

- Auto sort by dropping the item into a container (base on keyword : Jaggarsfeld)

- Auto sort by activate something (base on formlist : Leaf Rest )

 

I know it's like i'm asking for more, more and more especially with my limited coding skill but's it worth a try. Anyway thanks for sharing your codes, i'll see if i can tweak it as i want it.

 

Thanks

Link to comment
Share on other sites

Hey, if you don't mind using SKSE, you could use Player.GetNumItems() and Player.GetNthForm. Something like this:

 

 

  Reveal hidden contents

 

Edited by dylbill
Link to comment
Share on other sites

  • Recently Browsing   0 members

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