DLL Creator

Started by milon, August 21, 2015, 02:24:02 PM

Previous topic - Next topic

milon

I know very little about modding, but I know that basic XML mods just replace/add content.  This makes them potentially incompatible with other mods because they're all trying to rewrite the same files.

A DLL mod is a fancier bit of compiled code that edits memory values at run-time, rather than overwriting an entire file.  These are more likely (but not guaranteed) to be compatible with other mods.

So here's my idea / question.  Is it possible to take an XML mod and run it through a script that compares it to the Core file it's replacing, take the difference, and spit out a DLL that does the same thing?  In other words, DLL mods made easier.

I would have no ability myself to create this, but I think it's quite doable, and could be used to increase the compatibility of mods and even to standardize things a bit.  Just a thought.  Would anyone use it?  Anyone want to try to make it?

Jaxxa

No, there are not any XML to .dll converters, it is also not possible and there is no need for it.
Where is this question coming from? Because you appear to have fundamentally misunderstood a number of concepts in Rimworld modding.

QuoteThis makes them potentially incompatible with other mods because they're all trying to rewrite the same files.

Incorect, XML mods do not replace files. In an XML mods that contain something that is named (the object name inside the xml file) identically as something that already exists in the base core or a previously loaded mod, this item will be replaced. If someone was copying entire files out of core into their mod rather than just the bits they were using then this is an issue by the mod maker and is wrong.

QuoteA DLL mod is a fancier bit of compiled code that edits memory values at run-time, rather than overwriting an entire file.  These are more likely (but not guaranteed) to be compatible with other mods.

A .dll is executable code and can define classes that are used by .xml code. For example if you wanted to make different types of lights you could define these in xml and just change the values. If you wanted to do something more complex like a shield generator you would have to write the logic in a C# .dll file, you would also need to have a .xml file that pointed to your new shield generator building. .dll and .xml do separate things and are not interchangeable.

QuoteIs it possible to take an XML mod and run it through a script that compares it to the Core file it's replacing, take the difference, and spit out a DLL that does the same thing?

Any decent mod should only be replacing the objects that it is editing.

RemingtonRyder

The best solution for XML mod incompatibility is for someone to make a compatibility patch and then that loads after the incompatible mods making them work together.

I wouldn't mind seeing an in-game way of loading and saving modconfigs rather than having to overwrite it every time you want to install and use a modpack.

RawCode

This done by vanilla mod loader already.

it loads core and then loads mods, any values from core are replaced with values provided with mods.
Not files, value, you can change name of item and leave other fields alone.

If one mod change damage of sniper rifle to 50 and other to 60, there is no way to resolve such situation, DLL based mod also wont help.

If you want to alter damage of all guns that may exists in game, probably double damage or add explosion effect, you will need DLL, but, there is no way to define such change in XML, so there is no way to write "creator".

milon

Thanks for correcting me. I code only a little bit, and I've apparently misunderstood a lot of the modding discussions. Makes more sense now.