RemoveAllItemsShowOff
This function has a couple bugs related to the exception formlists being seemingly ignored and certain flags not working properly. Consider not using this function until it eventually gets fixed or fully deprecated.
A function added by the ShowOff NVSE Plugin version 1.15.
Description
An extended version of RemoveAllTypedItems. Removes all items from the calling reference's inventory, with custom exceptions. Returns 0 if some error has recurred, like attempting to call this function without a valid sourceContainer, 1 otherwise.
Arguments
The first argument, flags, is a bitmask composed with all the boolean flags that can be toggled for this function. All flag values and their significance are listed below, in the Flags section.
If typeCode is omitted or set to -1, there is no Form Type ID restriction on what forms can be removed. If set to 0, will do nothing. Otherwise, this determines the Form Type ID of items that should be removed.
If targetContainer is specified, the items being removed transferred to that container with all equipment items retaining their current health; otherwise the items are destroyed as they would be via RemoveItem.
If exceptionFormlist is specified, any form in that FormList will not be removed.
Syntax
(success:0/1) sourceContainer.RemoveAllItemsShowOff flags:int typeCode:int targetContainer:reference exceptionFormlist:baseForm
Example
player.RemoveAllItemsShowOff
Behaves exactly like "Player.RemoveAllItems" or "Player.RemoveAllTypedItems".
player.RemoveAllItemsShowOff 0 24
Removes all of the player's Armor items, except for those marked as Quest Items or which are Unplayable. They are gone forever.
player.RemoveAllItemsShowOff 0 -1 SunnyREF
Removes all of the player's items and transfers them to SunnyREF, except for those marked as Quest Items or Unplayable Biped forms. Ownership is cleared for each of these items.
SunnyREF.RemoveAllItemsShowOff (0b11) -1 Player
Removes all of SunnyREF's items and transfers them to the player, except for Unplayable Biped forms. Original ownership is kept for each item transferred this way, and messages which would normally be display about the player gaining items are silenced.
Player.RemoveAllItemsShowOff (0b1100)
Removes all of the player's items, including Unplayable Biped forms and Quest Items. This means that the player's Pip-Boy is also removed, so beware.
SunnyREF.RemoveAllItemsShowOff (0b1000) -1
Removes all of SunnyREF's items, including Unplayable Biped forms. Quest Items are also removed, though that is the default for non-player characters.
Flags
- All possible flag values for the flags argument:
Bit | Value | Flag Argument |
---|---|---|
0 | 1 | Retain Ownership |
1 | 2 | Suppress Messages |
2 | 4 | Allow Removal Of Quest Items From Player |
3 | 8 | Allow Removal Of Unplayable Biped Items |
All bits/flags are disabled by default.
If targetContainer is specified (otherwise, these do nothing no matter what):
- If the Retain Ownership bit is set, the items' original ownership is retained; otherwise the ownership is cleared. This is especially notable in the case of retaining ownership on items owned by someone else when transferring them to the player, as this may be counted as stealing.
- If the Suppress Messages bit is set, the standard "Item Added" pop-up will not be displayed when this command is used to transfer items to the player.
If the Allow Removal Of Quest Items From Player bit is set, will ignore the normal limitation of RemoveAllItems-styled functions where Quest Items (IsQuestItem) will not be removed from the player's inventory. Be careful what you do with this!
If the Allow Removal Of Unplayable Biped Items bit is set, will ignore the normal limitation of RemoveAllItems-styled functions where Unplayable Biped Items (LNIsPlayable) will not be removed from sourceContainer's inventory.
- WARNING: this limit is there for a reason; it prevents accidentally removing the Pip-Boy from the player.
List of Item Type Codes
Note: Type codes exist for all record types found in the GECK, including those which are not items that can be taken into inventory, e.g. Static Collections. The following list only includes type codes for record types which can be used as inventory items.
- 24: Armor
- 25: Book
- 31: Misc
- 40: Weapon
- 41: Ammo
- 46: Key
- 47: Ingestible
- 49: Note
- 103: IMOD (weapon mods)
- 108: CHIP (casino chip)
- 115: CCRD (caravan card)
- 116: CMNY (faction currency)
Note that not all items are in the obvious category. For example, Ingestibles and other Aid items are under Ingestible and include magazines, while skill books such as The Wasteland Survival Guide are under the Book category, despite appearing in the Aid category when viewed in the Pip-boy.