[Tutorial] Modding Rimworld with only simple tools

Started by lobz, July 29, 2021, 07:39:55 PM

Previous topic - Next topic

lobz

Hi there, I'm making a small sequence of tutorials on modding rimworld for begginers who never modded before and don't have any tools (basically what I wish I had when I made my first mod) as I learn more on how to mod. It's still a work in progress but I wanted to share what I did with you all.

https://github.com/Lobz/modding-Rimworld-tutorial#readme

sharp-ID

i wish i could give you a like or two XD for your nice and kind work.

Thank you

RawCode

i hope you understand that using xpath where you should not is not something beginners should do.

tutorial for beginners rely on "copy def you like to change from core to your mod and change whatever you want" not playing with xpath.

lobz

Quote from: sharp-ID on July 29, 2021, 09:08:42 PM
i wish i could give you a like or two XD for your nice and kind work.

Thank you

Aw thank-you for the encouraging words! Did you read the tutorial? Find anything useful?

lobz

Quote from: RawCode on July 30, 2021, 12:32:58 AM
i hope you understand that using xpath where you should not is not something beginners should do.

tutorial for beginners rely on "copy def you like to change from core to your mod and change whatever you want" not playing with xpath.

Oh! I do not understand that actually. Did I use xpath where I shouldn't? I remember when I made my first mod I got some feedback explaining I should use PatchOperations to make it have any chance of being compatible with other mods that alter the same thing. I think that's a good point and I wouldn't wanna teach bad practices.

Also, unfortunately I haven't had feedback from any actual begginners who don't have some familiarity with xml or at least html. Maybe I will add some extra resources to help understand xml pathing.

RawCode

well, i wish you luck with teaching your personal opinion of "bad practices".

tutorial for beginners should be easy to follow, it's not about "best practices" and "high enterprise standard", it's about using provided tools at most basic level.

just imagine "hello world" tutorial that starts with building custom garbage collector and custom malloc (with kernel driver) because author of tutorial thinks, that using buildin one is "bad practice".

lobz

Ok, I don't even know what "enterprise standard" means and your example is going a bit over my head, but, do you have like an example of a good tutorial that teaches how to change things in Rimworld without any complex tools? I mean, part of why I'm wrtiting this is that a lot of the tutorials I found start with using C# and a decompiler and I literally still haven't managed to make a DLL mod, so I wanted to slow down the speed of tutorials. If I'm going too fast, I want to do better. But I don't know exactly what making a Def that has the same name as a Core Def does, and I've been told it creates incompatibilities, and I don't want to avoid teaching the tool I learned as the right one to use. But maybe I could slow it down more.

I took your advice into consideration and slowed down this part of the tutorial. I also linked to the xpath generator tool (https://xmltoolbox.appspot.com/xpath_generator.html) which I think makes messing with xpath much easier. Maybe I should also add a "how to use this tool step by step"?

mikeejimbo

I think you should move the xpath stuff to a little later in the tutorial, and start with creating entirely new things. You won't need patches if you're making something like an entirely new hat. You will still have to teach about inheritance but that's unavoidable. Basically, I think if you just switch parts 2 and 3 you're good. You could then add some preamble to part 3 explaining why changing something is actually a little more complex than adding a new thing, because you have to take into account that you're maintaining compatibility.

RawCode

well, as i stated before, you probably should know and understand subject before you trying to make tutorial on it...

files created by C# "compiler" do have "dll" extension (or any other extension you may set) (and PE header), but they are not Dynamic Link Libraries, they are CLI Assemblies, and proper link is:
https://docs.microsoft.com/en-us/cpp/dotnet/mixed-native-and-managed-assemblies?view=msvc-160
NOT wiki link you provided in your tutorial
also you probably should understand that PE header is not valid on Linux or Mac, but will be recognized by runtime just fine

C# assemblies are not "compiled", C# is JIT runtime based and compilation done, right before you ask runtime to execute managed method, it's possible to actually compile C# with AOT technique, this will result in native binary, for specific architecture.

i do not make tutorials of any kind, mostly because my tutorials instantly collapse into code\data snippets:

why should i explain what "DLL" is, i can't do it better then official documentation anyway, probably i should give a link?
why should i give link, when people can google it on they own?
why should i explain industry standards, people can google "XML syntax" on they own?

Modding for complete noobs?
go to "data" folder and edit XML files directly, there is nothing else to explain
you do not ever need to create "mod" for this

You need to create "mod" only when you planning to share your mod with community and this is not something to consider with "hello world" level mods.