GamerRick Posted September 21, 2022 Share Posted September 21, 2022 Or, you could do all of that the way MS05 does it: setshowquestitems 1 player.removeallitems MS05PlayerInventoryChest Link to comment Share on other sites More sharing options...
Eillis Posted September 22, 2022 Author Share Posted September 22, 2022 (edited) @RomanRThanks for the info about magical items.I'll probably be doing more tests with scripted item and enchantment blocks to get a better understanding of any potential issues, but I'll be sure to keep your findings in mind.If that's just the way it is, I won't be too worried if I end up with similar results to yours. @GamerRickDoes this flag actually affect how RemoveAllItems work? Or it's just visibility?Also, what is MS05? Edited September 22, 2022 by Eillis Link to comment Share on other sites More sharing options...
RomanR Posted September 22, 2022 Share Posted September 22, 2022 @Eillis MS05 is internal Bethesda's mark for a side quest "Through A Nightmare, Darkly". It's a quest where you are rescuing a mage trapped in his own dreamworld. Link to comment Share on other sites More sharing options...
GamerRick Posted September 22, 2022 Share Posted September 22, 2022 (edited) Thanks RomanR. Yesterday, I wanted to see how it was done in vanilla, and quest MS05 was the first thing that I thought of. Oddly the code to remove the player items is in the amulet script MS05DreamworldAmuletScript. I was surprised to see that command setshowquestitems. Never knew about it before that. I verified that the relevant code was from Oblivion.esm and not from the UOP. The only problem I can see with it, if is if want the player to have a quest item on them that they have access to, after stripping them of everything else. But if that's the way Bethesda did it and no one ever thought it needed fixing and it always works as it should ever time I have done that quest, then obviously it works. Also, why do you need to do anything special for unplayable items? They are always invisible to the player. Most are tokens added by mods that tell them they already messed with that container (like one added by COBL to tell it it already checked that container). If you remove those, the mods will think they haven't checked the player yet. Edited September 22, 2022 by GamerRick Link to comment Share on other sites More sharing options...
Eillis Posted September 24, 2022 Author Share Posted September 24, 2022 @GamerRickJust hiding quest items on player is not enough in my case.I'd gladly go with leaving quest and unplayable items where they are, and in fact, that is what I'm trying to do. It's just not that simple.NPC will transfer his/her quest items to player. That requires workarounds. @RomaRForgot to mention it earlier, but GetItems does in fact return object IDs.I recently tested it to be 100% sure. Link to comment Share on other sites More sharing options...
RomanR Posted September 24, 2022 Share Posted September 24, 2022 Then I apologize for a misleading info about GetItems. As I see RemoveAllItems docs on CS Wiki it seems that unsetting playable flag is enough to be ignored by this command. So for quest items (in fact all) you need unset this flag only and they don't need to be unequiped as they will be ignored afterwards. With recorded info about changed items and setting this flag back after both transfers I think this problem is much easier to solve, perhaps you don't even need a temp container for this. Link to comment Share on other sites More sharing options...
Eillis Posted September 24, 2022 Author Share Posted September 24, 2022 There's nothing to be sorry about. We're all here to share knowledge. A lot of this stuff is very confusing. Setting unplayable will work in case of armor/clothing.Other item types don't have this option. So this leaves the problem for non-armor/clothing quest items of NPC. Link to comment Share on other sites More sharing options...
GamerRick Posted September 24, 2022 Share Posted September 24, 2022 (edited) Here is another way you could transfer all items from the player to a container: foreach refItem <- player set count to refItem.GetRefCount if count > 0 refItem.RemoveMeIR refOtherContainer endif loopNo need to check playable or quest flag it will move everything. I never tried it on something the player could be wearing or have equipped though. This command (RemoveMe & RemoveMeIR) and RemoveAllItems are the commands that fit your needs here. They will keep the items' reference settings when moved. Reference settings would be like the current health of a weapon or armor piece and the soulgem level for ones that you filled with a Soul Trap spell. When you do an AddItem(NS) and a RemoveItem to "move" the item, you are really deleting the current one and adding a brand new one in its place. Edited September 24, 2022 by GamerRick Link to comment Share on other sites More sharing options...
RomanR Posted September 24, 2022 Share Posted September 24, 2022 (edited) Well, for player, the problem is practicaly solved - unsetting playable flag will make clothes or armor to be ignored and as quest items will not affected too, I dare to say that using RemoveAllItems should be safe enough. But for NPC I begin to think that using this command is almost useless. With no such restrictions as for player you will be forced to filter and move NPC's items by hand and make a record what will stay in NPC's inventory to avoid accidentaly transfer to player. Temp container will be needed too. The only question is how to handle scripted items. The safest way would be to ignore them too. Edited September 24, 2022 by RomanR Link to comment Share on other sites More sharing options...
RomanR Posted September 24, 2022 Share Posted September 24, 2022 (edited) @GameRick:You really can't move everything from player or NPC so easily, considering there are advanced mods using tokens or such. With this you could cause havoc. Edited September 24, 2022 by RomanR Link to comment Share on other sites More sharing options...
Recommended Posts