Ludeon Forums

RimWorld => Mods => Help => Topic started by: Cthonia on November 07, 2016, 03:59:42 PM

Title: Need some help from experienced modders :)
Post by: Cthonia on November 07, 2016, 03:59:42 PM
Hello Community!

I'd like to ask for some help,  so I'd like to make 3 separate small mods. First, the servitors (wh40k wise). Implanting a ai-chip like thing into a prisoners brain making it into a low-level working slave of your colony (maybe max lvl.5 skills either combat,agriculture,building,hauling and cleaning,combat). I got a tip from Jamestec:

[/quote]

You can do this by adding something like
<workerClass>Recipe_ImplantLobotomize</workerClass>
to your surgery/medical RecipeDef, then make the class Recipe_ImplantLobotomize : Recipe_MedicalOperation and do your faction changing in the ApplyOnPawn method.
An example where workerClass is used in vanilla for surgery is the RecipeDef for RemoveMechanoidBodyPart and the workerClass Recipe_RemoveBodyPart.

[/quote]

Where are the workClass defs? I don't know C#, but I can code in Lua and as I see it's not so different. (xml-files are settled, but without the workClass...

The second is salvaging the bionics from corpses (as I understand through butchering I can only have direct outputs not variable outputs) so maybe through surgery?

The third is just brainstorming since I know how to do it, but I don't know if it's balanced:
Performing autopsy on corpses to gain doctoring experience. Dedicated workbench using corpses that transforms into unfinished cadaver and gaining exp through finishing and with no end product. So what do you think about it (and all three) balance wise?

Cheers, Cthonia
Title: Re: Need some help from experienced modders :)
Post by: 1000101 on November 07, 2016, 05:07:34 PM
Some of what you are asking how to do has already been done.  This isn't discouragement to not pursue it on your own, but you can find the information you need regarding them from studying those mods.

ie: Autopsies have been done as well as making prisoner slaves to do work the colony.
Title: Re: Need some help from experienced modders :)
Post by: Jamestec on November 07, 2016, 11:49:06 PM
You can look at vanilla code using ILSpy, I suggest using Zhentar's version
https://github.com/Zhentar/ILSpy/releases/
The file you want to open is at
RimWorld\RimWorldWin_Data\Managed\Assembly-CSharp.dll

There is a tutorial that shows XML -> C#
https://ludeon.com/forums/index.php?topic=16405.0

And there is a Visual Studio template to help you get the mod file structure right
https://ludeon.com/forums/index.php?topic=26831

For number 2, you can't add surgery bills to corpses. The only way I can think of doing this is replacing Verse.Corpse.ButcherProducts(). You can replace methods by using CCL (which should be updated to alpha 15 soon), steal relevant code from CCL, look at other mods that used to use CCL/modify methods or look at RawCode's posts
https://ludeon.com/forums/index.php?action=profile;area=showposts;sa=topics;u=9788

For number 3, Medical training is the mod you can look at to see how they achieve the thing you're describing.
Title: Re: Need some help from experienced modders :)
Post by: RawCode on November 08, 2016, 04:26:20 AM
Quoteyou can't add surgery bills to corpses
you CAN do absolutely completely anything, you can ever add butcher bills to inorganic objects, like stones.

it all about how much time you have.
Title: Re: Need some help from experienced modders :)
Post by: Cthonia on November 08, 2016, 05:07:57 AM
Thanks for the replies, especially to you Jamestec. I try to make it work  :) I learnt coding by myself. I understand the logic of coding so the syntax should not be a big problem. About the autopsy: would that be unbalanced?
On the side note, I would have been suprised if somebody hadn't made something similiar, considering the amount of topics on the releases (20 pages a day) so excuse me if I haven't had the time nor the patience tosearch for it.

Cheers, Cthonia
Title: Re: Need some help from experienced modders :)
Post by: 1000101 on November 08, 2016, 07:02:14 AM
There is an autopsy mod already, how OP it is depends on how large of raids you defeat and how many doctors you have to train.  If one doctor is performing all the autopsies on a large number of bodies then they can gain a large amount of experience.  On the other hand, doctors rarely get a chance to get any experience to begin with...