Topic on Talk:Modding Tutorials/ThingComp

Jump to navigation Jump to search

Assuming you're talking about the ctor which removed the comp at comps.OfType<>.Length -1 ?

Removing the comp itself seemed pretty fragile, and overwriting the default values from the compProps is better done with a new parent: It's less code to write.

It's also a question of certainty: are you certain an XML parent didn't get overwritten by some other mod? If so, you just took out the only Comp you had. Not to mention: what if the parent isn't abstract but a regular def? Your ctor would get rid of the only Comp again.

It's a clever work-around, for sure! But IMO it's too fragile and uncertain to add to a wiki. --Mehni (talk)