rux616 Posted August 25, 2021 Share Posted August 25, 2021 I've been attempting to make a mod recently that would benefit from having the container it opens up have the "store all junk" button that workshops have. I was hoping that it would be as simple as adding a keyword to the container, but even if it is I haven't been able to figure out what the magic keyword (or combination of keywords) is. I've tried various combinations of "WorkshopKeyword", "Workbench_General", and "WorkshopWorkbenchTypeCrafting", but to no avail. In digging into the UI a bit, I see that the container menu UI is modified based on some internal variable (uiMode) in the ContainerMenu script inside the ContainerMenu.swf interface file. Unfortunately, as that's internal to the SWF and presumably called from somewhere in the Fallout 4 executable, that's where I've lost the thread. I really don't want to have to start digging deeper into the Fallout 4 executable; does anyone have any insight here? Link to comment Share on other sites More sharing options...
LarannKiar Posted August 25, 2021 Share Posted August 25, 2021 (edited) I've been attempting to make a mod recently that would benefit from having the container it opens up have the "store all junk" button that workshops have. I was hoping that it would be as simple as adding a keyword to the container, but even if it is I haven't been able to figure out what the magic keyword (or combination of keywords) is. I've tried various combinations of "WorkshopKeyword", "Workbench_General", and "WorkshopWorkbenchTypeCrafting", but to no avail. It's the WorkshopKeyword (FormID: 54BA7). This keyword is used by the default object Workshop (FormID: 54BBC). This DFOB tells the interface that the object you're activating is a workshop workbench. If you simply add this keyword to a container, the "Store All Junk" button will be visible (after you click on the "Transfer" activate button). The problem is that you can't hide the "Workshop" activate button (workshop workbenches have two activate buttons: "Workshop" and "Transfer"). That would require editing the interface file. The other method is to make a scripted perk that adds a custom activate button. I've found a mod that does this. Edited August 25, 2021 by LarannKiar Link to comment Share on other sites More sharing options...
SKKmods Posted August 25, 2021 Share Posted August 25, 2021 Note that arbitrarily adding WorkshopKeyword to non workshop objects will break all manner of scripts and quest lookup that use it as a filter to identify Workshops: ObjectReference[] FoundWorkshops = pPlayerRef.FindAllReferencesWithKeyword(pWorkshopKeyword, 10240) /not that anyone actually seems to care about this stuff these days. Link to comment Share on other sites More sharing options...
rux616 Posted August 25, 2021 Author Share Posted August 25, 2021 It's the WorkshopKeyword (FormID: 54BA7). This keyword is used by the default object Workshop (FormID: 54BBC). This DFOB tells the interface that the object you're activating is a workshop workbench. If you simply add this keyword to a container, the "Store All Junk" button will be visible (after you click on the "Transfer" activate button). The problem is that you can't hide the "Workshop" activate button (workshop workbenches have two activate buttons: "Workshop" and "Transfer"). That would require editing the interface file. The other method is to make a scripted perk that adds a custom activate button. I've found a mod that does this. Interesting, thanks for the explanation. Do you know how this interacts with an ephemeral container that is created and activated via a PlaceAtMe / Wait(1.0) / Activate / Wait(0.1) sequence in a script? Specifically, how to activate the 'transfer' functionality? Like I said, I've tried varying combinations of keywords including "WorkshopKeyword" by itself. Note that arbitrarily adding WorkshopKeyword to non workshop objects will break all manner of scripts and quest lookup that use it as a filter to identify Workshops: ObjectReference[] FoundWorkshops = pPlayerRef.FindAllReferencesWithKeyword(pWorkshopKeyword, 10240) /not that anyone actually seems to care about this stuff these days. If it makes you feel any better, I actually do care about things like this. Do you have any suggestions on how it could be done without breaking other scripts? Would it matter if it's planned that the container this is attached to is ephemeral, existing only for a couple seconds at a time, as it's created and accessed via a script attached to an inventory item? Also, surely there are other checks in place to ensure that the ObjectReferences found are actually workshops? Like checking to see if it also has the Workbench_General keyword or something? Link to comment Share on other sites More sharing options...
SKKmods Posted August 26, 2021 Share Posted August 26, 2021 Also, surely there are other checks in place to ensure that the ObjectReferences found are actually workshops? Like checking to see if it also has the Workbench_General keyword or something? There are many different methods for finding workshops, but why would a developer load up a script with extra unnecessary function call tests (that can each take a frame to execute) if the base game STANDARD is for workshops to be identified with WorkshopKeyword ? Like, just incase someone repurposes something at some point in the future ... No, you choose the quality of the content you publish and the completeness of known issues that are documented. Link to comment Share on other sites More sharing options...
rux616 Posted August 26, 2021 Author Share Posted August 26, 2021 There are many different methods for finding workshops, but why would a developer load up a script with extra unnecessary function call tests (that can each take a frame to execute) if the base game STANDARD is for workshops to be identified with WorkshopKeyword ? Like, just incase someone repurposes something at some point in the future ... No, you choose the quality of the content you publish and the completeness of known issues that are documented. Fair enough. Did you have any feedback on the other part of my post? Would it even be possible to not interfere if utilizing an ephemeral container? I'm not going to be using the keyword route anyway, at the very least because it's simply not working, but I'm interested in your opinion as a veteran scripter. Link to comment Share on other sites More sharing options...
SKKmods Posted August 26, 2021 Share Posted August 26, 2021 The issue with subverting platform standards (as they may be) is edge and corner use caes and conditions. The fact that your container is temporary helps, but as we cant predict what may or may not be happening at that exact same time (like ResetWorkshop or WorkshopDailyUpdate kicking off) its not a methid I would publish. Would my Junk Scrapper or Global Stash benefit from a store all junk solution ? Damn right, so what I do is use workbenches as proxies and AddAcvtivate an extra menu on them for the SKK functions. You could try to copy a workbench, apply a simple Workshop Wood Crate or whatever container nif and remove the crafting keywords to see if you can preserve the store all junk option without the crafting menus. Link to comment Share on other sites More sharing options...
Recommended Posts