Jump to content

Help with sorting script


t0n1x

Recommended Posts

 

 

I don't believe there is any way to determine if an item is a quest item. For my sorting mod, I simply reject persistent references. That works fine for potions, crafting items, and ingredients because they are rarely persistent. For books you might find your items being rejected more often than they are accepted.

 

Ya, If these are not his books from his quests it is going to be very hard to do. I think SKSE has that function but it is not available for SSE yet.

 

Through use of the abRemoveQuestItems parameter in the RemoveAllItems() function combined with either a second inventory (to juggle items with) or something like the OnItemRemoved() event, it should prove quite easy to specifically filter quest items. I do like the idea of taking advantage of quest items persistence though, that's not something that I had thought of. That flaw's a bit of a bummer though.

 

 

It is my understanding that that parameter is broken. At least that is what is reported on the wiki. The wiki has been wrong before though.

Link to comment
Share on other sites

 

I was hopping to find a way to tell the script to ignore non droppable (quest) items and store only the droppable ones. But apparently it is not so easy to do and I will have to edit my formlists.

 

You might be looking at this the wrong way. I don't think you are going to hurt anything by removing the quest items. There could be some issues but they would be easier to deal with than tracking down every possible quest item and removing them from your Formlists.

 

Also the Mod would be a bit off only removing some items and leaving others.

 

If they are going into a safe place the player can always go and get them if they need to, and if they know the Mod removes quest items they will know to check for them in the chest.

 

Some people might like this Mod.

 

Put this under your first function and replace Game.getplayer() with this playerref.

 

actor playerref = game.getplayer()

Edited by Masterofnet
Link to comment
Share on other sites

I know that item sorting mods are popular and people think they should be easy but it turns out they are some of the hardest. And that's why there are so many of them. None really end up working well in the general case although lofgren's Simple Storage Solutions is the best I've seen so far.

 

Here are some of the problems:

  • Anything relying on formlists won't be able to handle mod added items without some sort of configuration system or many, many patches.
  • Without SKSE you can't reliably detect if the player has an item equipped or if it is marked as a favorite.
  • While formlists can move large sets of items relatively quickly, even with SKSE you won't be able to skip quest, favorite, and equipped items.
  • That abRemoveQuestItems parameter is broken. If that option worked you would still be stripping the character of all of their equipped items and if you try to re-equip them via script any player created enchantments won't be applied correctly.
  • There is no way to detect quest items (with or without SKSE) so you have identify them by hand and some things are only quest items part of the time (and there's no way to support all of the quest items that mods might use).

I spent quite a bit of time looking into inventory management and I eventually just gave up on the idea of moving items via script for my Storage Helpers mod. Even with the help of SKSE's inventory functions it just wasn't flexible or fast enough for me. I eventually wrote a SWF extension to hook into SkyUI because at the UI level you can do more (like detect which items are quest items).

 

I'm going to do something I don't normally do and point you to one of my own mods. Better Container Controls modifies the actual container interface to add a Store Most button to match the game's Take All. It's an alternative to the formlist and menubox approach taken by traditional sorting mods. Instead of providing the player with predefined lists of things that can be moved I change the interface itself so the player can simply choose a view and transfer items of that type. When SKSE64 and the full SkyUI are finally available the ability to use SkyUI's filter feature will make that even better but it still won't be perfect.

Link to comment
Share on other sites

@ t0n1x

As far as searching for all of the base game quest items, you can find them all on this wiki page. Wiki pages tend to be a big help with these sorts of things.

 

@lofgren

Oh dang, I didn't realise that parameter was broken, sorry. I obviously hadn't used it myself (at least in SSE), I just remembered it from when I was looking through the wiki. I guess that's why the parameter isn't in the Fallout 4 equivalent function.

 

@cdcooley

Couldn't you use something like the IsEquipped() function on the various form lists to check whether an item is equipped? Given that you'd have to run it on every entry in the form list, this would take time proportional to the number of entries in the form list (which would take a good amount of time in-game). Alternatively, you could use one of the GetEquipped() function variants to determine which item is equipped. There's also the SKSE IsObjectFavorited() function, which returns whether an item is favorited or not. I trust that you've already thought of this, given how obvious it is, I'm just wondering why this wouldn't work.

Link to comment
Share on other sites

Thank you guys. I Have decided to go with MasterOfNet's idea and warn my mods users that this may happen, so I can continue modding and learning new thins instead of trying to solve something that is not so easy solvable.

 

If you find out a way to do what I was trying to do from the beginning please post it here.

You can give a look at my mod page to find out how I imagined all this to work. I called this function "Bulk Items Autosort"
http://www.nexusmods.com/skyrimspecialedition/mods/6075/?

Edited by t0n1x
Link to comment
Share on other sites

 

I think SKSE has that function but it is not available for SSE yet.

 

 

It does not.

 

Some people might like having the quest items taken out of their inventory. Formlists are going to be limited in the functions they can perform when sorting.

 

Good luck with your Mod.

Edited by Masterofnet
Link to comment
Share on other sites

Whether or not removing a quest item from your inventory breaks a quest will depend on how the quest is written.

 

I have been thinking of a quest this might break, but off the top of my head I can't. Most quests that involve retrieving an item have the condition on the dialogue that the player must have the item.

 

If I am ever able to get my mod done I will look into this further. I do not like un-removable items in my inventory.

 

Also keep in mind. Quest items that are weapons can be removed from the players inventory and placed on some weapon racks in player owned homes.

 

BTW - I suspect this might also apply to some display cases but I have not tested it. In that case you could remove allot of different quest items from the players inventory already.

Link to comment
Share on other sites

The risk would be if there is an item that the player is meant to pick up and then the scripting assumes the player will not drop and pick it up again, so when it gets removed and then returned to the inventory the script fires again or sets the quest to the wrong stage. This could be considered sloppy scripting but of course it is well established that Bethesda does not script with potential mod functionality in mind. (And I don't blame them. Trying to anticipate how even my small mods might interact with even the most popular mods on the Nexus is madness inducing.)
Link to comment
Share on other sites

Thank you guys. I Have decided to go with MasterOfNet's idea and warn my mods users that this may happen, so I can continue modding and learning new thins instead of trying to solve something that is not so easy solvable.

A very wise choice.

You can give a look at my mod page to find out how I imagined all this to work. I called this function "Bulk Items Autosort"

http://www.nexusmods.com/skyrimspecialedition/mods/6075/?

That looks interesting.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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