Jump to content

[Script] Event for Scrapped


Zorkaz

Recommended Posts

So you need an event to detect when the object is "Scrapped" and not "Stored"? Since OnWorkshopObjectDestroyed is sent in both cases, I think (haven't tried it) you need to call WorkshopRef.GetItemCount(ScrappedOrStoredObject.GetBaseObject()) before and after scrapping/storing. Theoretically, "Store" should add one base form (of the reference) to the workshop workbench, "Scrap" adds its components. Both "destroys" the reference though.

Link to comment
Share on other sites

...Theoretically, "Store" should add one base form (of the reference) to the workshop workbench...

 

How and where are these items made visible, if anywhere, in the game?

Tried selecting a workshop workbench in console and entering "inv". It listed all the things visible in the container menu but no stored workshop objects (though specialized work*bench* stuff like chems do show up).

 

Is there a non-material ref somewhere in memory I could PRID? I just want to look at it visually for debugging purposes.

Link to comment
Share on other sites

Maybe check IsDeleted(), I think it will be false if stored:

One of the connectors on my isolation switch was storable in workshop earlier. When it got stored, a simple MoveToNode() brought it back into the game world.

 

For me, when I store an object, it gets disabled and deleted immediatelly unless it's hold by a variable. (I haven't tried MoveToNode() though).

 

 

...Theoretically, "Store" should add one base form (of the reference) to the workshop workbench...

 

How and where are these items made visible, if anywhere, in the game?

Tried selecting a workshop workbench in console and entering "inv". It listed all the things visible in the container menu but no stored workshop objects (though specialized work*bench* stuff like chems do show up).

 

Is there a non-material ref somewhere in memory I could PRID? I just want to look at it visually for debugging purposes.

 

 

I don't know where the game keeps that data. It's interesting question though.. there's no "reversed" StoreInWorkshop() unfortunately, a "Form[] Function GetWorkshopStoredObjects()" would be needed. Maybe an F4SE plugin have such function.

 

By the way, I tested the GetItemCount() theory and no it doesn't work.. workshop objects are not even inventory items, sorry. It was a pretty bad idea.

 

GetWorkshopObjectCount returns 0 in both cases, and GetComponentCount doesn't help either.

Edited by LarannKiar
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...