Ludeon Forums

RimWorld => Mods => Help => Topic started by: Tynan on April 23, 2014, 06:09:31 PM

Title: Mod-making Tutorials on the Wiki
Post by: Tynan on April 23, 2014, 06:09:31 PM
Mod-making info is available here on the wiki:

http://rimworldwiki.com/wiki/Modding (http://rimworldwiki.com/wiki/Modding)

Another good source: Roxxploxx RimWorld Guide (https://github.com/roxxploxx/RimWorldModGuide/wiki)

If you have a question, post it in this forum. If you want my input, PM me and point me to the public thread. That way, your question and my response will be visible by all, and all can benefit. Please do not PM me questions - it's not sustainable for me to help everyone one-on-one.

If you're willing to help write more modding tutorials, that would be awesome as well! I also encourage people to transfer what they've learned from the forum to the wiki. The forum is ephemeral, the wiki is a permanent knowledge repository which I hope can just grow and grow until it is supremely useful.
Title: Re: Write modding tutorials!
Post by: longbyte1 on April 23, 2014, 09:11:11 PM
Yes! I'm up for it.

http://rimworldwiki.com/Modding_Tutorials
Title: Re: Write modding tutorials!
Post by: jpwrunyan on April 29, 2014, 08:36:16 PM
I've written a tutorial for implementing a smelter to melt slag into metal. This should cover the basics of custom work bench design.

http://rimworldwiki.com/Modding_Tutorials/Smelter

Note that I am still ignorant of a lot of game concepts so much of the text in the files looks like boilerplate to me. But I try to point out where and what to write in order to implement a bare-bones interactive building/work table.

I would appreciate if others can double-check my work and add their own insights. Some questions not addressed in my tutorial:

What do Ingredients, Filter, ParentIngredientFilter, and DefaultIngredientFilter do specifically? Are they each mandatory?

How does the value of PriorityInType work in the WorkGiverDef? Is a higher value more important or a lower value?

Thanks.
Title: Re: Write modding tutorials!
Post by: Tynan on April 29, 2014, 09:43:06 PM
First off, thanks for the tutorial.

Quote from: jpwrunyan on April 29, 2014, 08:36:16 PM
What do Ingredients, Filter, ParentIngredientFilter, and DefaultIngredientFilter do specifically? Are they each mandatory?

How does the value of PriorityInType work in the WorkGiverDef? Is a higher value more important or a lower value?

-Ingredients - the things a recipe needs to be enacted. Will be consumed. Can be defined in general categories (e.g. any meat, any food, etc).

For the next two, take a look at the bill interface and note that there is a way to select what ingredients your colonists are allowed to use to do a recipe. For example, the cooking recipe bills default to disallow the use of human meat.

-ParentIngredientFilter - This is a hard filter on the ingredients which the recipe can accept. Items not passing this filter are not displayed at all in the bill interface's ingredient selection interface. Not mandatory. If not defined, accepts anything.

-DefaultIngredientFilter - This is the default ingredient filter configured on new bills. For example, meals default to not be made with human meat. The player can reconfigure this. Not mandatory. If not defined, accepts anything by default.

For the WorkGiverDef, priorityInType determines which order the workgivers will be checked within the specific work type. Higher is first. So, for example, the construction worktype has givers for creating frames from blueprints, for bringing resources to unfilled frames, and for working on filled frames to make them buildings. The last one I mentioned has highest priority (think about what would happen if it were the other way around).

It may be worth copying this info onto the wiki.
Title: Re: Write modding tutorials!
Post by: jpwrunyan on April 30, 2014, 01:23:02 AM
I removed ParentIngredientFilter and DefaultIngredientFilter from the tutorial and started a new page for RecipeDef that (ideally) should explain the structure and use of these elements in the future. For now I posted your above response as a quick-and-dirty entry.

Again I appeal to some of the more experienced modders to double check the source code in the tutorial. In my games that use the component I based the tutorial on, I still get some odd random behavior (like not being able to interact with the building as though WorkGiverDef didn't exist). So I worry that someone else may follow the tutorial, have the same random failure despite using the code verbatim and give up in frustration...
Title: Re: Mod-making Tutorials on the Wiki
Post by: Compozitor on August 17, 2014, 03:23:06 PM
There is a wrong link on Modding Wiki.... 

It's http://rimworldwiki.com/wiki/Modding (http://rimworldwiki.com/wiki/Modding)
Title: Re: Mod-making Tutorials on the Wiki
Post by: Tynan on August 17, 2014, 04:56:08 PM
Quote from: Compozitor on August 17, 2014, 03:23:06 PM
There is a wrong link on Modding Wiki.... 

It's http://rimworldwiki.com/wiki/Modding (http://rimworldwiki.com/wiki/Modding)

Thanks, fixed.
Title: Re: Mod-making Tutorials on the Wiki
Post by: jacob814 on December 17, 2014, 05:47:01 PM
Is the wiki up-to-date? I am having some trouble with it and I would like to know if the wiki is still accurate for modding alpha 8. Also is their a better place to learn how to mod.
Title: Re: Mod-making Tutorials on the Wiki
Post by: MonkeyBlasterino on December 31, 2014, 12:14:30 PM
I'm also having issues with the tutorials on the wiki. Following the 'simple block' tutorial (at http://rimworldwiki.com/wiki/Modding_Tutorials/Getting_Started) has resulted in 12 lines of error messages in the debug log. I originally typed the code out by hand to aid my understanding which resulted in error messages, so I cleared the XML file and copied and pasted the text directly from the tutorial. Unfortunately this was to no avail, as the same error messages showed :(

Should I post the contents of the output log to show the errors I am having, or are the tutorials are no longer compatible with alpha 8? Thanks!
Title: Re: Mod-making Tutorials on the Wiki
Post by: Tynan on December 31, 2014, 01:01:17 PM
Quote from: MonkeyBlasterino on December 31, 2014, 12:14:30 PM
Should I post the contents of the output log to show the errors I am having, or are the tutorials are no longer compatible with alpha 8? Thanks!

It's almost certain that the tutorials are out of date.
Title: Re: Mod-making Tutorials on the Wiki
Post by: Rock5 on February 21, 2015, 06:27:04 AM
Ever consider implementing Visual Editor (http://www.mediawiki.org/wiki/VisualEditor)? It would make updating the wiki more accessible to more users.
Title: Re: Mod-making Tutorials on the Wiki
Post by: longbyte1 on March 04, 2015, 10:01:59 PM
Quote from: Rock5 on February 21, 2015, 06:27:04 AM
Ever consider implementing Visual Editor (http://www.mediawiki.org/wiki/VisualEditor)? It would make updating the wiki more accessible to more users.
I think the proposal has already been brought up but rejected because VE is "too buggy" for general use.  :-\
Title: I updated the first one to Alpha 10
Post by: Dave-In-Texas on April 29, 2015, 12:59:04 AM
Quote from: Tynan on December 31, 2014, 01:01:17 PM
Quote from: MonkeyBlasterino on December 31, 2014, 12:14:30 PM
Should I post the contents of the output log to show the errors I am having, or are the tutorials are no longer compatible with alpha 8? Thanks!

It's almost certain that the tutorials are out of date.

It only took me a few hours, lol.

its also built from stuff rather than just metal.

[attachment deleted due to age]
Title: Re: I updated the first one to Alpha 10
Post by: longbyte1 on April 29, 2015, 07:25:00 PM
Quote from: Dave-In-Texas on April 29, 2015, 12:59:04 AM
Quote from: Tynan on December 31, 2014, 01:01:17 PM
Quote from: MonkeyBlasterino on December 31, 2014, 12:14:30 PM
Should I post the contents of the output log to show the errors I am having, or are the tutorials are no longer compatible with alpha 8? Thanks!

It's almost certain that the tutorials are out of date.

It only took me a few hours, lol.

its also built from stuff rather than just metal.

Updated the Git repo (https://github.com/oldmud0/rwmd). Thanks for taking many hours for all of us.
Title: Re: Mod-making Tutorials on the Wiki
Post by: Mr.Cross on June 29, 2015, 10:22:37 PM
Hello, I'm wondering, as i'm unsure if the tutorials are out of date (i read that they were), on how one would go about making a faction/pawn type?

Also, I was wondering. How would one make a basic faction. I've been trying to figure things out for a bit now. I've been looking between the wiki's (maybe out dated wiki's) and some of the Zombie Apocalypse mod that and am thinking on how best to do this. I am not sure how to go about this, some help would be appreciated.

Also how exactly would one start? Just looking at the defs. I'm seeing a faction and a pawn. Advice would be Greatly Appreciated

*Note: The reason why i'm trying to look off of the Zombie Apocalypse mod is because I hope to have my faction acting similar, and before you ask No it's not going to be a rip off of that mod. It's going to be "hopefully" something new.
Title: Re: Mod-making Tutorials on the Wiki
Post by: Alistaire on July 12, 2015, 02:36:32 PM
What's up Tynan and Mod Tutorial writers.
Something happened; tutorials from Modding are now moved over to Modding tutorials, which always was the better page to place tutorials.


The following text dump is me slightly ranting about the state of Modding Tutorials on the wiki.




I've worked on a few tutorials over the past day detailing the following things:

> The above four conclude the Introduction part of Modding Tutorials (http://rimworldwiki.com/wiki/Modding_Tutorials),

> The above three conclude the C# part of Modding Tutorials,

> The above two don't have a clear category.

... Which leaves the wiki with a bunch of red links and another bunch of outdated tutorials and an outdated Modding (http://rimworldwiki.com/wiki/Modding) page:


I also came across one of the most useful tutorials on the wiki at the moment;





To make the wiki Modding Tutorials section a better place I would suggest getting style guidelines in place, telling people to not only scan but
thoroughly read the existing tutorials before writing a new one that either completely ignores existing tutorials and tells the reader for the fifth
time how to set up a folder structure or one that adds a lot of Alpha specific code so the tutorial is useful for a full four weeks.

I get that updating your tutorials on the wiki is a big responsibility, but throwing them on there and leaving them for time to make them
obsolete is more of a waste of time. Please, write good articles and if you think part of, for example, coding a nuclear reactor should already
be known to the reader you're golden writing a tutorial on the basics first and writing up to the point where the reader should understand all
the nitty-gritty of it.

TL;DR:

- Make tutorials that will stand the test of time, unless you want to keep them updated.
- Look at the other tutorials first; lots of things are already explained. Readers aren't stupid and don't want the same thing explained twice.




If anyone actually feels like I'm ridiculing their tutorials, that wasn't the purpose of this post. I felt creative in the body of the message and
went overboard with assumptions about Cala13er, so sorry if that offended you.
Title: Re: Mod-making Tutorials on the Wiki
Post by: kaptain_kavern on July 12, 2015, 04:03:21 PM
Thx for your hardwork.
Much clear organised that way (or organized at all ;) )
Title: Re: Mod-making Tutorials on the Wiki
Post by: longbyte1 on July 13, 2015, 10:35:20 PM
I wrote the "Getting Started" tutorial. In fact, I was the one who started the whole modding tutorials thing. This was back in, what, alpha 4?

If anything, it was more of an invitation to contribute than an attempt to teach "advanced" modding. I thought, "no, it's not worth another 6 hours of research trudging through ILSpy and source code on people's mods trying to figure out the simplest plugin possible." Besides, this was alpha! Features are overhauled all the time; there's no point in trying to spend too much time figuring out changes in each update. :-\

Things are still changing a bit too rapidly. It's not just tutorials that are out of date; a lot of information and stats also get outdated very quickly and the way we are trying to keep it up to date at the moment is extremely inefficient. The content is also prone to grammatical errors that don't get fixed. In addition, not many of the properties are documented well. I can tell you that property X makes the def work correctly, but I cannot tell you where it fits into the game.

The sound article was written by Tynan. "Well why doesn't everyone write like him?" As the developer, only he knows the technical details of just about everything in the game, knows exactly what's going to be updated in the future, and what is going to stay the same. We as players cannot read his mind or the sticky notes on his desktop, and we do not know what game mechanics or defs will be preserved across versions in order to make our tutorial as "neutral" and version-agnostic as possible. Notice that Tynan did not include any XML code in this tutorial, because only he knows that the dev menu will always contain a sound editor that will always produce compatible code.

Suffice to say, there is no way to make a tutorial that will stand the test of time. Maybe later this will be possible once we get into Beta.
Title: Re: Mod-making Tutorials on the Wiki
Post by: Alistaire on July 14, 2015, 06:48:35 AM
I understand you need some commitment to update tutorials over the course of several alpha's, I can't expect people to do that (although people
should expect to be doing that themselves really.. oh well). However;

The moment you open any of the tutorials on very specific things, you're greeted with "Start of by making your xml look like this." followed by a
very simple XML file structure. What a programmer or even XML coder has to know by now is that you're lazy and so are aspiring programmers
and coders. Just like in XML, you should be able to inherit existing information from the wiki otherwise you're writing the same code till the end of
time. It's true that the wiki doesn't have enough parent classes tutorials, but as a modder you already know the basics and as a wiki writer
you already know how to write..

As Tynan says in OP: "If you're willing to help write more modding tutorials, that would be awesome as well! I also encourage people to transfer
what they've learned from the forum to the wiki. The forum is ephemeral, the wiki is a permanent knowledge repository which I hope can just
grow and grow until it is supremely useful.
", the wiki is to be built upon over time and I get that half a year ago there was very little to build
upon, but people who see the tutorials in their current state are scared away and rightfully so.
I pointed out tutorials that I read when I started modding and never ever learned anything from - I browsed through the game files and read
them for several hours till it kinda made sense. What I didn't learn through that were things, like XML's Abstract type, which could be explained
in a small wiki article and then sent to the realm of things readers from that point on are supposed to understand.

So, if you're writing tutorials or planning on doing so, make sure you split more basic things that other tutorials might also need off into their own article so others can build upon it, and build upon the things that others have written so far.
Title: Re: Mod-making Tutorials on the Wiki
Post by: s_fratley on August 14, 2015, 03:04:56 PM
Hey Guys,

I just got done looking through the tutorials and was encountering the issues mentioned above. I appreciate that individuals took the time to put that together those tutorials and it is unfortunate that they aren't as useful as they once were.

I am experienced with programming, however new to modding and writing XML and so was more interested in something along the lines of an API reference. specifically in regards to ThingDef and what parameters are required/available for it. I'm guessing from the above post that something like that doesn't exist and really the best way to get a grasp on creating mods is to dive into the source and just look at everything? I just wanted to check and make sure before i spend that time.

This is the first time a game has attracted me enough to become interested in modding. Thanks for a great game and I look forward to being able to contribute.

s_fratley
Title: Re: Mod-making Tutorials on the Wiki
Post by: Cardbo on September 20, 2015, 12:29:33 AM
If I wanted to make a set of armor, give it certain attributes like say regeneration, is there a guide out there for that.  I see a weapons guide, but nothing focusing on armor.
Title: Re: Mod-making Tutorials on the Wiki
Post by: Cala13er on December 21, 2015, 05:58:13 PM
You really wanted to shoot some bullets when criticising mine and others tutorials. Baring in mind I wrote them back in Alpha 3, and spent about 5 minutes doing so, a rubbish tutorial is better than no tutorial at all. But hey, whatever floats your boat I guess.
Title: Re: Mod-making Tutorials on the Wiki
Post by: catter on February 16, 2016, 11:30:04 PM
Ok so I have a question...

I want to make a new background in A10 and I don't know how to do that. Please help!
Title: Re: Mod-making Tutorials on the Wiki
Post by: Noa3 on April 12, 2016, 02:13:01 PM
Can anyone update the example projekt pls?
for now, the example is realy confusing
Title: Re: Mod-making Tutorials on the Wiki
Post by: ppumkin on September 09, 2016, 02:58:15 PM
Hi Everybody,
Been playing rimworld for manyhours by accidentially discovering it. I am a C# developer and noticed C# files while looking around the directory. So I thought to my self lets see if I can mod something.
Obviosly I started at the mod wiki help section, which now out of date but thanks to the stick post on the XML for A15 and the ingame errors I sorted the basic building out within 5 minutes.

So. I would like to update the turotial on github. Is this still the way to do it?
What is suggested way of doing it, just create a pull request against the named tutorial is enough?
I will be raising a PR soon, I hope somebody is there to check it out. As I will be learning I can update the GitHub docs, maybe add some new one? As I go along.

Lets see how far I can get. First time modder - But all this looks pretty standard and easy to me. Just need to learn the XML'hell' root node names..sigh.. but should be fun! :)
Title: Re: Mod-making Tutorials on the Wiki
Post by: jjcm04 on January 07, 2017, 10:32:06 PM
I think everyone could benefit from a map making tutorial. A lot of people like making their own custom textures for the WorldGen and the playing field (don't know what the name of that map is). 
Title: Re: Mod-making Tutorials on the Wiki
Post by: roxxploxx on May 02, 2017, 11:41:31 AM
I'm creating a wiki brain dump for what I am learning as I am modding. Since I'm going fairly in-depth in c# coding, I'm finding a lack of resources. For example, in my Unifica Magic Mod https://ludeon.com/forums/index.php?topic=31826.0 (https://ludeon.com/forums/index.php?topic=31826.0) I am creating new types of items: turrets run on arcane runes, druid plants that reach out and grab, wands that cripple people that are zapped, etc. There's a lot to learn but it's doable. I'm trying to archive what I have learned to help others.

So, here's an example of low-level class relationships that I put together:
    https://github.com/roxxploxx/RimWorldModGuide/wiki/SHORTTUTORIAL%3A-Things-and-ThingDef

Here's my wiki's home page:
   https://github.com/roxxploxx/RimWorldModGuide/wiki

Hope it's useful to others!
Title: Re: Mod-making Tutorials on the Wiki
Post by: Sugarbunnylet on May 09, 2017, 04:39:34 PM
Quote from: roxxploxx on May 02, 2017, 11:41:31 AM
I'm creating a wiki brain dump for what I am learning as I am modding. Since I'm going fairly in-depth in c# coding, I'm finding a lack of resources. For example, in my Unifica Magic Mod https://ludeon.com/forums/index.php?topic=31826.0 (https://ludeon.com/forums/index.php?topic=31826.0) I am creating new types of items: turrets run on arcane runes, druid plants that reach out and grab, wands that cripple people that are zapped, etc. There's a lot to learn but it's doable. I'm trying to archive what I have learned to help others.

So, here's an example of low-level class relationships that I put together:
    https://github.com/roxxploxx/RimWorldModGuide/wiki/SHORTTUTORIAL%3A-Things-and-ThingDef

Here's my wiki's home page:
   https://github.com/roxxploxx/RimWorldModGuide/wiki

Hope it's useful to others!

Hey rox, do you have Discord? I'd like to chat with you!!
Mine is [email protected]

-Sugar
Title: Re: Mod-making Tutorials on the Wiki
Post by: roxxploxx on May 24, 2017, 11:54:13 AM
I'm on Discord as roxxploxx. Say hi.
Title: Re: Mod-making Tutorials on the Wiki
Post by: Mehni on February 06, 2019, 06:39:35 AM
It's time to take ownership of some recent additions.

New:
- https://rimworldwiki.com/wiki/Modding_Tutorials/Hello_World
- https://rimworldwiki.com/wiki/Modding_Tutorials/XML_Defs
- https://rimworldwiki.com/wiki/Modding_Tutorials/Modifying_classes
- https://rimworldwiki.com/wiki/Modding_Tutorials/Compatibility
- https://rimworldwiki.com/wiki/Modding_Tutorials/ModSettings
- https://rimworldwiki.com/wiki/Modding_Tutorials/DefModExtension
- https://rimworldwiki.com/wiki/Modding_Tutorials/ThingComp
- https://rimworldwiki.com/wiki/Modding_Tutorials/GameComponent
- https://rimworldwiki.com/wiki/Modding_Tutorials/BigAssListOfUsefulClasses
- https://rimworldwiki.com/wiki/Modding_Tutorials/TweakValue
- https://rimworldwiki.com/wiki/Modding_Tutorials/Compatibility_with_DLLs

Completely rewritten:
- https://rimworldwiki.com/wiki/Modding_Tutorials/Modifying_defs
- https://rimworldwiki.com/wiki/Modding_Tutorials/Custom_Comp_Classes
- https://rimworldwiki.com/wiki/Modding_Tutorials/Compatibility_with_defs

Large contributions:
- https://rimworldwiki.com/wiki/Modding_Tutorials/PatchOperations
- https://rimworldwiki.com/wiki/Modding_Tutorials/Distribution
- https://rimworldwiki.com/wiki/Modding_Tutorials/Assets
- https://rimworldwiki.com/wiki/Modding_Tutorials/First_Steps
- https://rimworldwiki.com/wiki/Modding_Tutorials/Decompiling_source_code
- https://rimworldwiki.com/wiki/Modding_Tutorials/Testing_mods

Planned:
- Rewrite ThingDef to be useful (no, I'm not going to document all 200+ tags)
- Linking C# and XML
- Rewrite https://rimworldwiki.com/wiki/Modding_Tutorials/Weapons_Guns
- Rewrite https://rimworldwiki.com/wiki/Modding_Tutorials/Def_classes
- Add Jecrell's step-by-step guide.

I could use some help with:
- Adding links to all modding articles where useful
- Adding screenshots (https://rimworldwiki.com/wiki/Modding_Tutorials/Testing_mods for instance could do with an up-to-date screenshot of the dev mode bar (including tweak values) and visuals on how to set up a shortcut for testing.)
- Categorising stuff
- An article dedicated to textures. I am out of my depth on that. TexturePaths, especially for multis and randoms, confuse me.