![]() DON’T FUCKING INCLUDE VANILLA BASE ABSTRACTS.Not all Defs have to have a Name attribute, but the ones that do can be inherited by items that refer to them with a ParentName attribute. It is declared inline with the def declaration, like, rather than as a separate node. The Name is an attribute used specifically so XML can tag specific defs and refer to them later. The defName can be literally anything, and it just is a unique way to identify a specific def. ![]() SummaryĪ Def can have both a Name attribute and a defName. It’s pretty much guaranteed that some other modder will have “BaseMakeableModGun” as an abstract, and that’ll cause you and your users headaches like no tomorrow. If you make an abstract, give it a unique name by using your mod name, initials, or whatever. If you make a weapon or whatever that will require heavy altering, it’s advised to make your own abstract, again inheriting from as far down the chain as you can - mostly because that avoids duplicating and copy-pasting needless code. If it is in a list, the inherited member appends to the list rather than replaces. If you need to alter a single value, you can still inherit and overwrite that single value in your individual item - as long as it’s not in a list. If you make a mod, inherit from as far down the inheritence chain as possible. It contains all the basic information provided in the preceding Parents, and all the specific things that makes this Def unique. This is the eventual Thing that actually gets generated in the game. Note that this is the first time we include a defName. We do this by creating another Abstract and using the BaseWeapon as a parent, like so: If we want to use that to build upon, we will need to inherit from it. So we have the building blocks for a Def, with the name of BaseWeapon. Next step, the example of ThingDefs_Misc\Weapons_Guns.xml Inheritance Why? Because other mods inherit from it, and when there are two versions of the Abstract to inherit from, things go bad. If you copy-paste that over in your mod, you cause incompatibilities with other mods. Tech Level 0: This is the lowest level of tech and it has very little effect on gameplay, outside of being able to set up some basic traps for protection from predators. If you inherit from it (use it as a parent) you use it. You can inherit from this, but DON’T copy it over in your mod or otherwise include it. You use abstracts for partial Defs, things you’d otherwise end up copy-pasting without modifying ten times over. It’s not a complete entry either, which is why it needs to be an Abstract. This is an Abstract, meaning it’s not generated by the game but only used as a base for other XML entries to build upon. If you’ve got a weapon you’re pretty much guaranteed to need the things in there.
0 Comments
Leave a Reply. |