RimWorld

RimWorld

Tree People
trisscar05 5 Dec, 2019 @ 8:50pm
Overwriting vanilla bases, please fix
Greetings sir or ma'am or however you prefer to be addressed, it seems your mod is currently overwriting {BasePlayerPawnKind, TreeBase, BasePawn}, and it's causing issues for other mods and the people who use both those and yours. I'd like to request that this be changed so that things don't break quuuite as often as they tend to. An explanation of what overwriting bases is and a different way to do inheritance is below. I hope you have a good rest of your day/night/eternal twilight on a stationary planetoid.

Explanation courtesy of Jamaican Castle on the main Rimworld Discord-

"Well, when you set ParentName="whatever" in the XML for a def, it goes for a def with Name="whatever" and puts all of the parent's tags in the child, unless the child overwrites them by having the same tags.
In the distant past, Rimworld wouldn't look outside of your own mod package for Name="whatever", so if there was a standard parent for a type of def - usually called a "base" because most of the vanilla ones have Base somewhere in their names - you'd have to define your own. For instance, vanilla pawns all inherit (directly or through an intermediary) from BasePawn. You couldn't do the same because it wouldn't find it, so many modders defined their own BasePawn.

Nowadays (since, I think, about A17) it correctly finds the named parent wherever it is, so you can inherit directly from vanilla bases. That's good. But it also means that if your mod defines a base with the same name as vanilla, it overwrites the vanilla one, and whatever changes you made propagate to many other things and generally cause problems.
Compounding the problem is that a lot of mods that do overwrite vanilla bases do so because they haven't been updated (or that part of them hasn't been updated) in a long time, so they tend to overwrite with outdated versions of the base.

If you're going to inherit from a vanilla base, just do so. Don't add a definition for that base. For example if I have one pawn, I can just put ParentName="BasePawn" and have done with it. I don't need to (and shouldn't) write my own BasePawn.
If you want to have your own base, name it something different from vanilla, like MyModBasePawn or somesuch."
< >
Showing 1-2 of 2 comments
Filthy Peasant  [developer] 2 Mar, 2020 @ 7:04pm 
Thank you. This is actually really helpful. I will fix this when I update to 1.1. My apologies for responding so late.
trisscar05 11 Mar, 2020 @ 10:29am 
No worries, just kinda assumed that life was being OP and you'd get to it when ya had the opportunity. Luck with your sudden need to update. XD
< >
Showing 1-2 of 2 comments
Per page: 1530 50