RemoveAllTypedItems

From GECK
Jump to: navigation, search


A function included in the GECK for Fallout: New Vegas.

Description

An extended version of RemoveAllItems. Removes all typed items (except those listed in the exemption FormList) from the calling reference's inventory, except for the following:

  • Biped forms marked as unplayable (LNIsPlayable),
  • If the calling reference is the player, Quest Items (IsQuestItem).

Arguments

If a target container is specified, the typed items are moved to the target container with all equipment items retaining their current health; otherwise the items are destroyed as they would be via RemoveItem.

If the retain ownership flag is set to a non-zero value, 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 flag is set to 1, the standard "Item Added" pop-up will not be displayed when this command is used to transfer items to the player.

If the typeCode flag is omitted or set to -1, will try to remove all items, essentially doing the same thing as RemoveAllItems. If set to 0, will do nothing. Otherwise, this determines the Form Type ID of items that will be removed.

If exceptionFormlist is specified, any form in that FormList will not be removed.

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.

Syntax

[help]
sourceContainer.RemoveAllTypedItems targetContainer:reference retainOwnershipFlag:(0/1) suppressMessages:(0/1) typeCode:int exceptionFormlist:baseForm

Example

player.RemoveAllTypedItems vGOMPlayerEquipmentContainer 1 0 40 NVImprovedHoldoutWeapons

Every item with FormType 40 (Weapons) will be removed from the player and transferred to vGOMPlayerEquipmentContainer, except for forms in NVImprovedHoldoutWeapons or which are unplayable Biped forms, or which are quest items. The original ownership of each item is retained, and no message is displayed.

TopsCompanionLocker2REF.RemoveAllTypedItems Player 1 0

Every item will be removed from the Tops Locker (TopsCompanionLocker2REF) and given to the player, except for unplayable Biped forms. Each item keeps its original ownership, and messages are displayed for each item being transferred.

See Also