player.RemoveAllTypedItems

Post » Sun May 02, 2010 8:39 am

I've been working on my sorters, and another very gracious member shot me a tip I will try and use for weapons, armor and clothing. I THINK I understand all of this except for the last thing. Could someone help me make sure I understand this correctly? I think I have most of it, but I'm unclear on what the "NVImprovedHoldoutWeapons" is

From the wiki: container.RemoveAllTypedItems TargetContainerID:ref RetainOwnershipFlag:int UnknownFlag:int TypeCode:int FormListID:ref

EXAMPLE: player.RemoveAllTypedItems vGOMPlayerEquipmentContainer 1 0 40 NVImprovedHoldoutWeapons

So, breaking this down am I understanding this correctly so far?


"player.RemoveAllTypedItems" (removes all items of the specified type, right?)

"vGOMPlayerEquipmentContainer" (this is the container you want the items removed to go into?)

"1" (retains ownership)

"0" (says unknown flag, so we don't know what this does?)

"40" (that's the typed items being removed, (in this case weapons) and placed into "vGOMPlayerEquipmentContainer"?)

"NVImprovedHoldoutWeapons" (this is the one I don't understand. Could you explain what this is, please?)

Thanks for your help with my noobish questions, but I'm really trying my best to get an understanding on how this works. Sometimes it looks like Chinese to me, lol.

Thanks again!

(Basically, what I'm trying to do is use this in a computer terminal, have the user click an option to Sort Weapons, Sort Armor or Sort Clothing, and remove the items and place them in the specified container WITHOUT placing a duplicate fully repaired copy like the player.removeitem and additem does.) Also, thank you to JoshNZ at the Nexus for showing this to me!
User avatar
Dawn Porter
 
Posts: 3449
Joined: Sun Jun 18, 2006 11:17 am

Post » Sun May 02, 2010 12:20 am

In this case, NVImprovedHoldoutWeapons is a formlist of items that you do not want removed from the player. So 'remove everything of this type except for the items in NVImprovedHoldoutWeapons'. The formlist is optional.
User avatar
Dina Boudreau
 
Posts: 3410
Joined: Thu Jan 04, 2007 10:59 pm

Post » Sun May 02, 2010 2:17 am

In this case, NVImprovedHoldoutWeapons is a formlist of items that you do not want removed from the player. So 'remove everything of this type except for the items in NVImprovedHoldoutWeapons'. The formlist is optional.


Yes, that's kind of what I thought as "holdout" seemed to imply the weapons you might sneak into a casino when you get unarmed at the door by the greeter. So, I could just leave that out, and it would take every weapon the player had in their inventory. I should also be able to create my own list so my personal weapons or armor don't get removed? That would be nice!

Great! Thanks for the clarification! I hate being stuck at the office where I can't play around with this. Oh well, gotta keep the lights on.

Thanks again!
User avatar
Isabell Hoffmann
 
Posts: 3463
Joined: Wed Apr 18, 2007 11:34 pm

Post » Sun May 02, 2010 3:32 am

Yes, that's kind of what I thought as "holdout" seemed to imply the weapons you might sneak into a casino when you get unarmed at the door by the greeter. So, I could just leave that out, and it would take every weapon the player had in their inventory. I should also be able to create my own list so my personal weapons or armor don't get removed? That would be nice!

Great! Thanks for the clarification! I hate being stuck at the office where I can't play around with this. Oh well, gotta keep the lights on.

Thanks again!


Is there any way of editing this list?
User avatar
Caroline flitcroft
 
Posts: 3412
Joined: Sat Nov 25, 2006 7:05 am

Post » Sun May 02, 2010 1:31 am

Editing it in the GECK. In-game, scripts can add to a formlist (addformtoformlist), but not remove. NVSE has more formlist functions including removal.
User avatar
Mike Plumley
 
Posts: 3392
Joined: Wed Sep 05, 2007 10:45 pm

Post » Sun May 02, 2010 1:56 am

OK. I got everything working as it should including my lists that exclude certain items and so on. Now what I would like to see if I can accomplish would be to set the sorting terminal so when you click "sort armor" for example, it takes whatever the player is NOT wearing. In other words, leave out anything the player has equipped. Is there a simple way to do this? If so, what would the code need to be that goes in the Item Result Script box for the terminal?
User avatar
Steeeph
 
Posts: 3443
Joined: Wed Apr 04, 2007 8:28 am

Post » Sun May 02, 2010 2:13 am

OK. I got everything working as it should including my lists that exclude certain items and so on. Now what I would like to see if I can accomplish would be to set the sorting terminal so when you click "sort armor" for example, it takes whatever the player is NOT wearing. In other words, leave out anything the player has equipped. Is there a simple way to do this? If so, what would the code need to be that goes in the Item Result Script box for the terminal?


I can't think of a simple way - well it might be simple to some, or someone might have a better way ;)
1. It will require NVSE
2. Add to a formlist 'MyCustomForm' of Armor Items that the player has equipped (GetEquipedObject) - since you need NVSE anyway you might as well do all the biped slots.
3. Use the 'RemoveAllTypedItems' for armor items with 'MyCustomForm' as the exclusion form list.
4. Step through 'MyCustomForm' again, checking to see if the player has more that one of each of these items.
5. If the player has more than one of an equipped item, get the health of the equipped item, Remove the excess number of this item and copy to the sorting container (you won't be able to sort these with their real health - it's not available). Also, you might remove the one that is equipped by the player.
6. If step 5 removed an item that was equipped, you will still have one in inventory. Equip it, and SetEquippedCurrentHealth with the health setting that you saved in step 5.
User avatar
Melung Chan
 
Posts: 3340
Joined: Sun Jun 24, 2007 4:15 am

Post » Sun May 02, 2010 8:04 am

NVSE... I've seen some use inventory-walking to mark all worn items as quest-items (undroppable) and then unmark them when done. Probably want to keep a formlist of the ones you turned quest flag on so you don't accidentally unmark a quest item that was supposed to be.
User avatar
A Lo RIkIton'ton
 
Posts: 3404
Joined: Tue Aug 21, 2007 7:22 pm

Post » Sun May 02, 2010 12:07 am

NVSE... I've seen some use inventory-walking to mark all worn items as quest-items (undroppable) and then unmark them when done. Probably want to keep a formlist of the ones you turned quest flag on so you don't accidentally unmark a quest item that was supposed to be.



No worries there, there is no quest item that is wearable in the game.
User avatar
Zualett
 
Posts: 3567
Joined: Mon Aug 20, 2007 6:36 pm


Return to Fallout: New Vegas