[Help me plz <3] Autonomous deep core drills

Started by Depleted, January 12, 2018, 03:59:52 AM

Previous topic - Next topic

Depleted

Hello,

I'm brand new to modding Rimworld and the first thing I wanted to do which hasn't been done (that i can see) is make a simple mod to change the manned deep core drills into automated ones.

The folder/file structure is a complete minefield to me (Im more of a texture artist than a xml coder) but using the find function i've found a lot of references to the deep core drill including an xml with its building costs etc, yet I have no idea how to make it automatic, could anyone more experienced please share some insight?

I've tried to look for autonomous things like static turrets in hope of finding a reference that i could try using but i've found nothing that stands out.

ethouiche

Deepdrills rely on a workDriver / JobDriver for the colonist to do the work.

You need :
- to create an autonomous bench that has no job associated
- to add a tick function that will do what the regular colonist jobDriver would do in the bench class
- to create colonist related statistics copy pasta for the bench : miningYeld miningSpeed etc

jamaicancastle

It would probably be easier to create your own comp as a hybrid of CompDeepDrill and CompSpawner (basically a spawner that uses the deep drill comp's logic for finding and depleting deep resources, then spawns them at appropriate intervals). It wouldn't be tremendously complicated as C# mods go, but you'd need to be willing to learn C# modding, and you'd need to go digging around in the code a little with ILSpy.

As far as I'm aware, there's no way in XML to simply remove the worker requirement from the deep drill.

Depleted

Thanks for the information guys, here I was thinking it would be a quick and easy mod like changing a 1 to a 0 lol, all my previous game modding exp is mainly value changing or working with textures and models.

Are there any tutorials/wiki's you could recommend for me to get me started with learning? This sounds way more complicated than I assumed it would be tbh.

jamaicancastle

If you're interested in learning about C# mods, this tutorial sticky is a good place to start. It will show you exactly what you need to get started, how to go about setting up XML and C# components for your mod, and even some basics about peeking in on the game's own compiled code.

Of course, you can do plenty with XML modding alone, if that all sounds like too much to learn all at once. You just can't do this.


BrokenValkyrie

Well we can never have enough modder. I started out modding by changing value around value as well. Some advice I can give after you have a set up. Dig around workshop folder or your mod folder for some example code. Many modder leave behind source code, and those are god send as a modder especially if they contain parts that can help you develop your own code.

Try to get decompiler, you definitely want to look at the vanilla code to aid in developing your own mods.

This is advice for others.
Stuck? Ask for help, don't spend a long time stuck on a problem someone else likely solved a long time ago. Its easy to miss that one missing letter or misplaced variable a second eye can really help.

Depleted

Brilliant thanks a lot!

I took a look around the mods folder and started to read some of the files to get to grips on the xml layout and it seems pretty straight forward. I've tried to learn coding in C++ and C# before and C# was easier to understand and learn with so I hope i'm not biting off more than I can chew.

ethouiche

#8
Alternatively, to dodge decompiling :
https://github.com/josh-m/RW-Decompile

Github research is case sensitive. That means you need to know what you are looking for, before even searching it. Try to read/understand a lot of existing code, it will be usefull.

This is fun too : https://www.dropbox.com/s/nrwtwtzh706oouw/CoreXML%20A18.html?dl=0