Carreau Posted January 30, 2020 Share Posted January 30, 2020 I'm trying to devise a way to remove items from the player's inventory via the pipboy and place them into another storage container. For the most part, this works with the exception of leveled items like weapons and armor. Since weapons and armor are kept as persistent object references, simply calling RemoveItem() will not correctly work. RemoveItem removes a random item of that base type from the inventory instead of the currently selected item. I tested this by adding 10 randomized laser guns to inventory and then parse them one at a time. A random laser gun would be removed instead of the selected one in the pipboy. Additionally, since I'm dealing in base forms, the laser guns are re-randomized. Basically, one needs the object reference used for persistence to be able to perform this function. In my injected ActionScript, I polled the currently selected item object to get all of the storage values. And this is what was returned favorite = true taggedForSearch = false isLegendary = false count = 1 nodeID = 19798 //0x4D56 filterFlag = 3 equipState = 0 text = 10mm Pistol clipIndex = 0 formID = 18466 //0x4822 canFavorite = true This was polling the starter 10mm pistol from Vault 111. Obviously, the ID fields are in decimal and not hex for the report. The one value of interest is 'nodeID'. If you drop the weapon and then retrieve it, 'nodeID' will change, so I'm assuming this is the value used as a persistent reference. The thing, though, is that it's internal to the pipboy. Rectifying this value either through xSE or papyrus results in no form or reference retrieved. I'm guessing this value is internal to the pipboy structure, which is unfortunately not very well exposed in xSE currently. When you use commands such as Drop in the pipboy, the entire object is sent back to the EXE, so I'm guessing the EXE uses the values listed in the entry list item to remove the persistent reference and drop it into the game world as a generated object reference. So I'm hoping someone here has some insight on how best to use the values available to create the correct ObjectReference so that I can more easily make my transfer. Thanks in advance! Link to comment Share on other sites More sharing options...
DieFeM Posted January 30, 2020 Share Posted January 30, 2020 My knowledge of as3/flash is pretty limited, I don't have experience on it aside of a couple of as3 edits here and there... I could say more or less the same about xSE, I know how to use most of the functions that F4SE adds, but I have zero experience on how to create a plugin. This being said, this would be my two cents: I guess you are adding an additional action/button to the pipboy interface that let you send an item to an storage container, so if you have this already done, the only you would need to do is mimic the vanilla "drop" function of the interface, but it would need to be listening for the OnItemRemoved event from papyrus, you would need to send some additional information from as3 to the game so, in papyrus, you can distinguish the objects dropped with your button from the actual drop button, then you can use the reference given by OnItemRemoved to store the object in the container. Link to comment Share on other sites More sharing options...
Carreau Posted January 30, 2020 Author Share Posted January 30, 2020 Thatâs my planned work around and already have it partially encoded in my test build. Being able to resolve an o-ref in my xSE plugin would be more ideal so i can be sure Iâm only grabbing what I need instead of grabbing items that may be truly dropped. Link to comment Share on other sites More sharing options...
Carreau Posted January 31, 2020 Author Share Posted January 31, 2020 I bit of an update to this for anyone following. OnItemRemoved is a good workaround, although it would be nice to be able to resolve the inventory item in xSE since the workaround is VERY brute force. And thanks to the slow speed of papyrus versus the faster response time of native handling, I had to give a short delay between firing my xSE function to call papyrus and calling the EXE's dropitem function. Without a small delay in the AS3 side, papyrus takes too long to register the event and fill the item filter before the item is removed by the EXE. This was causing the item to drop as normal without moving it to my storage area, but a subsequent pickup and store function call would get caught since the event and filter were still in effect. I would still love to figure out how to resolve the pipboy item to an ObjectReference, but this workaround will be sufficient for now I suppose. Link to comment Share on other sites More sharing options...
Recommended Posts