Jump to content

Disappearing conduit?


HeyYou

Recommended Posts

Usually for making an object only visible in workshop mode the event OnWorkshopMode is used to Enable/Disable it.

 

But I'm afraid that disabling a conduit could cause unexpected issues to the power grid so, if that is the case, you could make use of destruction stages, in which the conduit uses a transparent material swap, or a transparent model if the original one doesn't allow for material swaps.

 

So when you enter in workshop mode it uses a destruction stage that makes it visible, and when exits from workshop mode it changes the destruction stage to use the invisible one.

To change destruction stages you can make use of DamageObject and ClearDestruction.

 

To setup the destruction stages you need to use "Edit Destruction Data" in the conduit. If you need examples you can check cars or flora for destruction stages.

Link to comment
Share on other sites

I don't know, maybe. "Build your own pool" uses OnMenuOpenCloseEvent though, along with RegisterForMenuOpenCloseEvent("WorkshopMenu") at OnWorkshopObjectPlaced, and UnregisterForMenuOpenCloseEvent("WorkshopMenu") in the OnWorkshopObjectDestroyed, if the above mentioned method doesn't work as good as you would like, you might want to try with this other event. It seemed to replace the objects marker/water instantly.

Link to comment
Share on other sites

I don't know, maybe. "Build your own pool" uses OnMenuOpenCloseEvent though, along with RegisterForMenuOpenCloseEvent("WorkshopMenu") at OnWorkshopObjectPlaced, and UnregisterForMenuOpenCloseEvent("WorkshopMenu") in the OnWorkshopObjectDestroyed, if the above mentioned method doesn't work as good as you would like, you might want to try with this other event. It seemed to replace the objects marker/water instantly.

That's a good point. I have used that mod, and place a fair bit of water...... Convenient that it uses 'markers' with collision for placement. :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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