How to make a mod? (Theoretical research mod)

Started by Mendel, August 14, 2016, 03:49:52 PM

Previous topic - Next topic

Mendel

I want to make a mod that adds one research option. The research option in question would be "theoretical research" that costs 9999999 research points to finish and adds nothing to the game except being a research option that you can research to get researching exp to a scientist when you have no other sensible thing to research.

I made suggestion about that here: https://ludeon.com/forums/index.php?topic=24139.0

I would like to make the simplest possible implementation of this myself if nobody else has indeed done this. Mostly because I want this in a game but also because I want to learn how to mod. I would imagine this might be as simple as adding a few lines of text to some cfg/ini/whatever file.

Where should I look for help on how to do this?
How do I get started? I have never modded a game before but I know basic computer stuff, I have used computers all my life and played a lot obviously.

I might need help for both of these things too:
I want the mod to be visible in the menu where I can easily enable or disable it.
I want to be able to publish it in steam workshop.

Any help would be appreciated, thanks!

edit: This might help someone from the same bit of headache that I had:
I was trying to update the mod but could not because the upload to workshop button had disappeared.
solutions: Turns out the button only appears if I have developer mode on in the options.
This might seem obvious to some but it was not to me :)

Shinzy

Check the mods folder in your Rimworld directory

make your own folder in there for your mod
then check the Core mod (or any other mod if you have any) and see how they're built
then try to make yours look the same

you can find an example of how researches are made in the ResearchProjectDefs in the core mod
and you can open them xmls with a notepad
try to study the files a bit and you should begin to understand how they work in no time at all ;D

if you run into any specific problems go riiiight ahead and ax again

Mendel

Perfect answer. Thank you! I will take a look at this when my current colony dies as I dont want to risk killing my save game with a failed mod :D

Also... I just realize there is a whole mods section to this forum and you didnt even mock me for posting on general  :-[  8)

Shinzy

Quote from: Mendel on August 14, 2016, 04:57:21 PM
Perfect answer. Thank you! I will take a look at this when my current colony dies as I dont want to risk killing my save game with a failed mod :D

Also... I just realize there is a whole mods section to this forum and you didnt even mock me for posting on general  :-[  8)

Oh gosh I didn't even notice this was in general (I usually just read through the 'show unread posts')
I'ma move it, you.. um buffoon! yeah. take that
Consider yourself mocked!

robotguy4

Quote from: Mendel on August 14, 2016, 04:57:21 PM
Perfect answer. Thank you! I will take a look at this when my current colony dies as I dont want to risk killing my save game with a failed mod :D

Also... I just realize there is a whole mods section to this forum and you didnt even mock me for posting on general  :-[  8)
You could just not play your current saved game with your mod enabled. Disable your mod whenever you want to play.

CallMeDio

Make a copy of your save and save it somewhere else as save "before" the mod, I always do this for a lot of different stuff, I never need to come back to the backup but it adds more safety and make me take the step.
QuoteYou may need a rubber duck.  Also, try some caveman debugging.

Released mods: No Mood Loss on Prisoner Sold or Died

SpaceDorf

Also make a backup of the config folder, just in case :)

This lets you jump between different mod-loadouts and load-orders without the ingame hassle.
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

Mendel

I just copied the about folder and the Defs\ResearchProjectDefs folders over to a new theoretical research folder under mods

I am getting an error message: Mod theoretical research has incorrectly formatted target version "Unknown". for the current version, write <targetversion>0.14.1249</targetversion>
However, it does not specify where (which file) am I supposed to write that in.

Still. it actually works if I just ignore that error message:



Now I´d still like to deal with that error and then somehow put this in steam workshop because I want to learn to do that too.



kaptain_kavern

It is located in the first bit of the about.xml files

Mendel

Okay, well that line was not there in the core mod folder´s about.xml file
However I added that line to the about.xml of my mod folder and that did work. Thanks.
Oh... and also there seems to be a big fat upload to workshop button on the mods menu :)

Mendel

#10
Okay it´s up in case anyone wants to try it out

http://steamcommunity.com/sharedfiles/filedetails/?id=746660838

it´s probably nothing special for you guys who can do much much more awesome stuff but this is at least what I wanted to do and Im happy that I was able to do at least this small thing :)
If any single one other than me finds this useful, great. if not... well, I will still use it myself :)

Big thanks to all of you for help!

Master Bucketsmith


Mendel

Small update: changed the tech level of the theoretical research from neolithic to transcendent.
This should improve compatibility with tech advancing mod.