Required Roof for Building

Started by Soup, May 21, 2021, 07:09:00 PM

Previous topic - Next topic

Soup

Hey, new to I'm modding and I'm trying to make a mod where a building "attaches" to the roof, so if the roof breaks I also want the building to break instead of just floating in midair. I checked placeworkers and doesn't seem like there is one for roof required, how do I create my own placeworker, and if I were to do that does that also have the building break upon roof  destruction?

RawCode

not possible with xml only

you will need custom code for building itself and for placement

Soup

I figured it out, but a follow up, do you happen to know how to damage the roof? I want the roof to be destroyed when this building "attached" to it gets destroyed

RawCode

there are methods to work with "roof", unlike most other things, roof is not "thing" and property of map itself, start from Map class.

Soup

where can I find the Map class? ILSpy?(I've been having trouble in using ILspy properly)

RawCode

dedicate more then 5 minutes and try harder, you can find Map class same place like all other classes

also you may want to switch to dnspy