looking to make some more linkables need some help

Started by Lost56, July 16, 2020, 10:35:05 AM

Previous topic - Next topic

Lost56

hi i looking to make some more link ables but can't seem to figher out how to link the object to gether i looking at to a reserch bench but like to link some to power generaters as well.

i been looking at the code for more linkables mod and glitter net as well but still stumped to how they did it in there mods.

K

GlitterNet isn't a very good source if you're just looking to add "normal" linkables. I'm the author of it, and I used several techniques there that aren't exactly standard to make it work. There's a significant C# side to GlitterNet that allows it to connect to buildings at all, since it doesn't use the normal linkables code.

If you're just looking to add a normal linkable (more technically, a facility) to an existing building, you'll need to add your linkable to the list of linkableFacilities for the building that you want to link to, in the CompProperties_AfffectedByFacilities. The best way to do this would be using an xpath to add your new linkable to the list.

Lost56

so i have to look in to the code for the benches i want to add it to as well as the code for the link able?

as when i look in to the more linkable mod i not seen the defs for the benches. un less i been blind i not gret with code so very possably missing it.

thanks for your help so far K and great mod

K

So long as you're just adding a normal linkable, you don't actually have to write any "code" (which I think most would use to refer to the C# side of things). You only need to make additions or modifications to the XML defs of the game, which is done using xpath patches typically. The wiki has a somewhat outdated but still very useful tutorial on how to write XML patches that could help: https://rimworldwiki.com/wiki/Modding_Tutorials/PatchOperations.

Lost56

thanks again hopfully i be able to fighier it out now