DukePatrick Posted July 23, 2017 Share Posted July 23, 2017 So I have a work bench that is placed via the workshop. But I want the work bench model to change in game sometimes via script. I tried to use delete and then place at me for a new workbench but a work bench spawned with place at me will not "hook up" to the local workshop. So is there a way to swap models (this could be done in Skyrim but that may have been with SKSE) or a way to make place at me workbench actually work? The only other trick up my sleeve is to use an invisible work bench with a "not activatable" form on top of it occupying the same space and then change THAT form via scripting. Link to comment Share on other sites More sharing options...
JonathanOstrus Posted July 23, 2017 Share Posted July 23, 2017 So I have a work bench that is placed via the workshop. But I want the work bench model to change in game sometimes via script. I tried to use delete and then place at me for a new workbench but a work bench spawned with place at me will not "hook up" to the local workshop. So is there a way to swap models (this could be done in Skyrim but that may have been with SKSE) or a way to make place at me workbench actually work? The only other trick up my sleeve is to use an invisible work bench with a "not activatable" form on top of it occupying the same space and then change THAT form via scripting. The simple answer is no. The complicated answer is maybe. The object has some linked references to match it up with the workshop when it is placed. In theory if you properly re-link the new object it should work. Though I think you also have to add it to the workshop script system. Not absolutely sure about that since it has been a while since I played with the FO4 workshop system so this is all from memory. The best way to try and get situated is to look at vanilla pre-placed objects and see what the linked refs are. Link to comment Share on other sites More sharing options...
DukePatrick Posted July 23, 2017 Author Share Posted July 23, 2017 The best way to try and get situated is to look at vanilla pre-placed objects and see what the linked refs are. Yep tried that, copied all the keywords and such... works if placed by the workshop, did not work when placed via "place at me". Searching the internet just got me people with the same problem going back years.But I was hoping something new was discovered in the last year and known by someone here. Link to comment Share on other sites More sharing options...
JonathanOstrus Posted July 24, 2017 Share Posted July 24, 2017 The best way to try and get situated is to look at vanilla pre-placed objects and see what the linked refs are. Yep tried that, copied all the keywords and such... works if placed by the workshop, did not work when placed via "place at me". Searching the internet just got me people with the same problem going back years.But I was hoping something new was discovered in the last year and known by someone here. Took a quick peek at some refs. This code is from memory so it may not actually compile but should give you the gist. Keyword Property WorkshopItemKeyword auto const {LinkedRef keyword for WorkshopItems} Furniture Property WorkbenchChemistryB auto const {An example furniture to spawn and link} ObjectReference Property TheWorkshopRef auto {the actual red workshop container} ObjectReference Property NewlySpawnedObj auto {the new item you spawned} NewlySpawnedObj = TheWorkshopRef.PlaceAtMe(WorkbenchChemistryB) NewlySpawnedObj.SetLinkedRef(TheWorkshopRef, WorkshopItemKeyword) That should give you a chemistry bench that is linked to the workshop and even shares the container. Just as if you spawned it by crafting from the workshop menu. Link to comment Share on other sites More sharing options...
DukePatrick Posted July 24, 2017 Author Share Posted July 24, 2017 Keyword Property WorkshopItemKeyword auto const {LinkedRef keyword for WorkshopItems} Furniture Property WorkbenchChemistryB auto const {An example furniture to spawn and link} ObjectReference Property TheWorkshopRef auto {the actual red workshop container} ObjectReference Property NewlySpawnedObj auto {the new item you spawned} NewlySpawnedObj = TheWorkshopRef.PlaceAtMe(WorkbenchChemistryB) NewlySpawnedObj.SetLinkedRef(TheWorkshopRef, WorkshopItemKeyword) Holy cow I get what you are saying now. Thank you so very much. Link to comment Share on other sites More sharing options...
Recommended Posts