Please teach me

Started by NemesisN, May 18, 2016, 08:47:18 PM

Previous topic - Next topic

NemesisN

I am really trying hard to mod this game....I did start long time ago but I quit out of frustration and I got back to it a couple of days ago...but all I can do is just change the names and some numbers (increase or decrease)

I am really confused as I see a lot of people add new stuff new things that are not just a small modification or texture of something that exists but a completely new thing added to the game

is there any video tutorial ? I searched YouTube but all I can find is mod reviews not really any tutorials on how to mod....do you know where can I find video tutorials if they exist ? I do read forums but a video tutorial would help a lot since I am not that good with coding
Join the RimWorld fan community group on Facebook: https://www.facebook.com/groups/1404635226524821/

RawCode

there is nothing special about c# used for Rimworld


RemingtonRyder

The thing to bear in mind really, especially if you're new to modding in classes for RimWorld, is that you add new classes by creating a library. You also need to reference the DLL files to do anything RimWorld-y, you can locate these in the RimWorld1135Win\RimWorld1135Win_Data\Managed folder - usually, you'll want to reference Assembly-CSharp.dll and UnityEngine.dll.

There are a lot of places in XML where classes are invoked (in other words, particular classes are named in the XML and this means they are used by the object defined in the XML). So to experiment with this, you can make a similar building and point to your own class.

Note that you need to point to the right NameSpace. This is because you could, oddly enough, have classes with the same name but in different namespaces, and the game needs a way to know which one you want to use!

It's a lot to take in, but just take it a bit at a time, and you'll get the hang of it.

1000101

Please don't waste your time and everyone else's with open generic questions or pleas of "I don't understand" and "please teach me."  If it's that you don't know how to program in C# or xml formatting, then the RimWorld forums is not the place to ask.  Use google to find sites which you can teach you those basics.  Follow the tutorials which are present (namely the ones in this sub forum, such as the dark matter generator) and most importantly - Teach yourself.  Everything learned was through someone investing the time to do the research, you need to do your own too.

We can be very helpful on the forums but you need to help us help you.  Ask pointed questions and include the steps you took to figure out the solution to the problems you are encountering.  eg, "I'm trying to make a new heat pump which can transfer from the "indoor" collector to the "outdoor" exaust but I'm having trouble linking the buildings.  I have tried these steps...", etc.

TL;DR - Don't be lazy, you need to do your part before anyone else will help you.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

Thunasura

#4
I personally have been looking for just such a post, because it is exactly how i feel.  Probably just so social interaction can lighten the mood of programming and give me some bearings.  I can't speak for Nemesis though.
If anyone else feels the same way... then lets be study buddies!

Thank you Marvin.  Much clarity.

100101010111101 hard worker vs lazy... -5 (edit: -20) ... i had to say it.
The arcane exist, weld it and we will achieve works greater than that of the Japanese toilet!

heo rung

#5
Okay, here's my 2c:

When you want to start contributing content to a game because you like the game so much, you need to write down exactly what it is that you want to add to the game, so that you can plan for what is reasonable and what is not, given the resources available to you.
This is THE most important skill that a developer will ever acquire: The ability to know his limits. This principle applies to modding ANY game, not just Rimworld (and it also applies to the career path of 'Developer', for any software, not just games).

Start small; Keep It Short & Simple.

Start your modding journey/career with something easy. Find tutorials for the most basic and simplistic things imaginable. "Hello World" has historically been used for this. Research and get to understand every single function that you're asked to use in the 'Beginner' tutorials, then try them for content that you would like.
For example, find a tutorial on how to add a new hairstyle to the game, complete the tutorial, then try doing a couple of your own. Move on to the next tutorial you can find, rinse, repeat.
Once you find enough tutorials to help you do 51% of the ideas you wanted to put in to your mod, just do the 51%, and forget about the other 49%.
Once the 51% of ideas are completed and playable, find people who will playtest it for you and/or go through your code to tell you what you did wrong.

The best way to learn any skill is to understand your limits and know where to go for help: You've taken the right path by coming here asking us for help, now you need to gain the ability to take measure of what you DO know and CAN do, so we can help you with the rest.

Good luck!

RawCode

Quote from: heo rung on May 24, 2016, 04:38:25 AM
Okay, here's my 2c:
wrong.

Every new developer make same mistake again and again, "new developers" want result:
RIGHT *** INSTANT
with some variations related to timeframe.

No matter how well your plan, how short and simple it is, you will never get result instantly, it may take weeks or ever years to complete your task.

I monitor multiple forums, bukkit, spigot, stackoverflow, codeproject and ofc rimworld, every forum have same issue:

"i made this code in 10 minutes and it does not work please help REALLY FAST ASAP PLEASE111111"


...


I started modding Rimworld in august 2014, i never planned anything, i wanted "bukkit for rimworld" from very first day.
First step was completed in december 2015 and work far from finish.

year and 4 month of time for 20 lines of code but you gave up after just few minutes

Dont waste time on plans, dont waste time on forums, all your questions are already solved, you just need *some* time to find the answer.

If you can't find the answer:

A) you do it wrong
B) your skill is far beyond everyone and your question is truly unique

Fluffy (l2032)

@RawCode; They're two sides of the same coin. Many 'newbies' burn out because they have no clear goals, or overambitious goals. Since there's no real progress to be had, they get frustrated, and at some point, give up. I don't think you qualify as a good example of the average modder ;)

So yeah, don't start big, start small. And even when you start small, expect to take a while to figure stuff out - especially when you're new to a language/environment/game.

Oh and Nemesis, if you're going to ask for help, show people you're willing to devote some time and effort. You're looking for youtube videos, while there's at least two perfectly good tutorials right here on the forum. Why would we invest time helping someone who's too lazy to try himself?

RemingtonRyder

From what I can gather, all he's asking is how to create assembly files like other modders do, since that seems to be how all the cool and unusual stuff arises.

Some more pre-emptive Q&A follows.

Where's the download button on GitHub?
Click the green 'Clone or download' button and then click Download ZIP.

I want to create my own assembly (.dll) file, how do I do that?
If you already have a solution (.sln) file which you're using, create a new project (.csproj) file using the menu of whatever you're using as your environment e.g. Microsoft Visual Studio. You'll be asked what kind of project you want to create, you want to choose (.NET) (Class) Library. You'll probably be prompted to enter a name for your project.

What is a solution anyway?
It's a way of grouping together related projects so that you can jump from one to another as easily as you might switch tabs on your web browser.

How do I set the right references for RimWorld?
Each project can have its own set of references. Expand the project - usually by clicking the small triangle pointing at your project - so that you see a list of what is inside the project. References would be shown as a further sub-level that you can expand.

Again, depending on what you're using for your environment, you may need to right-click on References and choose Add Reference or Edit References.

You'll get a dialogue box which will have one tab which says '.NET Assembly Files' or 'Browse' and this will allow you to choose the reference files Assembly-CSharp.dll and UnityEngine.dll which are located in, for example, \RimWorld1135Win\RimWorld1135Win_Data\Managed. You can copy those files to your project folder if it helps, but you can't distribute those with your mod.

Having these references set means that you can first of all refer to those assembly files in your code, if you have for example 'using RimWorld;' and/or 'using Verse;' at the top of your class file.

Wait, back up a minute dude, what the heck is a class file?
You can have as many classes inside a library as you like, although you typically only need one per mod. A class has a namespace, almost always the same as the project name e.g.

nameSpace ISummonYe{

  public class MyClassHatesMe
  {



  }

}


How do I get an actual .dll file out of this damn thing once I'm finished?
On the top menu there should be something along the lines of 'Build' - so, choose to build whichever project you're currently working on.

Depending on your active configuration (defaults are Debug and Release, you can add more) your DLL file may end up inside YourSolutionFolder/YourProjectFolder/bin/Debug. Open that folder and you can copy it and paste it in the Assemblies folder of your mod. In fact, make a shortcut to that folder, you're going to be visiting it a lot.

Help, it didn't build, I have errors!
I can't cover every single possible error in a Q&A. The errors will usually tell you what's wrong, in an 'oh great that's superhelpful' sort of way and point you at the offending line. If you have errors, you need to fix them before you can build.


RawCode

@MarvinKosh
I hope you understand that your Q&A is not ever related to Rimworld and about "how to code c# without reading ever basic documentation".

Problem with github - read documentation.
What is DLL - read wikipedia.
What is solution - read your IDE documentation.
What is IDE - read wikipedia.
References - read sticky threads at forum, there is spoonfeeding tutorial about this.
What is class - are you kidding, read damn documentation already!
How to compile - ahahah please stop!
I have errors! - your only "error" is missed reading lessons

short:

static public void SolveAnyQuestion(string q)
{
string[] gr = GoogleThisFirst(q);

for (string s in gr)
ReadFully(s);

string rtm = UpdateQuestionWithPrevSearchResult(q);

while(true)
{
gr = GoogleThisFirst(rtm);
for (string s in gr)
ReadFully(s);

if (solved)
return;

if (timededicatedinhours >= 4)
AskOnForum(rtm);

//asking on forum is not excuse to stop searching for answer self at same time

rtm = UpdateQuestionWithPrevSearchResult(q);
}

}


I perfectly understand that many many individuals want suped duper mod of they own without investing any time and resources into it.
Sadly, it wont happen.

RemingtonRyder

I do not like this practise of discouraging someone from modding before they have begun. It's difficult to judge what someone's true capabilities are just by one or more forum posts.

I would rather someone figuratively put their hand up and said 'I'm stuck' than think to themselves 'nah, I won't ask on the forums, because someone will make me the flavour of the day.'

I sincerely hope that it is not the case that someone is being singled out for some sort of punishment for asking the 'wrong' questions, because that would be harassment.

1000101

@MarvinKosh,

I think you misunderstand us.  We're not trying to discourage or belittle anyone.  At the same time, we aren't handing lollies out like a doctors office.  We are simply trying to point out that the RimWorld forums aren't the place to learn to program and that RimWorld modding will take programming experience.  Further, one must put enough effort into the problem before eliciting help from other people.  I've put in more than 25 years into obtaining my level of skill and knowledge, including self-training, self-education as well as paid-for training and education with the earliest part of that being in the days before the internets pervasiveness - there was simply no choice but to "do the work to obtain the reward."  Why would I (or anyone else) ever want to give 25+ years of hard-work and experience away to someone who can't do the first basic steps on their own?

Speaking personally, my first foray into computers involved reading paper manuals cover-to-cover and trying every single example in them, making sure I varied the example code enough to make sure I understood in individual aspect being taught by the example.  I spent 6-12 hours a day on top of school just learning to program and by the time I got to the level where programming courses were offered in school, I already knew more than the teachers (in fact, I taught my first computer course because I knew more than the teachers and was graded on how well I taught the course).  I am not about to just give all that away to someone who can't first use google to answer some basic questions.

As I said in my first post in this thread...
Quote from: 1000101We can be very helpful on the forums but you need to help us help you.  Ask pointed questions and include the steps you took to figure out the solution to the problems you are encountering.  eg, "I'm trying to make a new heat pump which can transfer from the "indoor" collector to the "outdoor" exaust but I'm having trouble linking the buildings.  I have tried these steps...", etc.

Again, we are not trying to discourage anyone but, we are also not giving out lollies.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

Fluffy (l2032)

Completely agree with E, with the exception that I do think modding is a nice way to learn C#/some basics of game design - but only if learning to program is your goal. If only modding is your goal, and programming is just a hurdle, you're going to have a bad time with C# mods.

Also marvin, I'm a little offended you'd even suggest that this is personal. At this point it's more of a meta discussion than about the OP anyway.

RemingtonRyder

I was suggesting that it could be perceived that way, hence the 'I sincerely hope.' If you say that it's not the case, then I accept that.

As I said, you have no way of judging someone's experience with programming from their forum posts unless they actually post some code. Even someone experienced could use a crash course in the terminology, and that's why I answered questions that I myself might have asked not so long ago.

I've not attended many courses, or read many books on programming. I've never had a paying job in the field of programming. Along the way I have occasionally looked in my dog-eared copy of A Book on C, but mostly I just got in there and started messing around with stuff, which is great if you know enough about the environment you're working with. So again, that's why I posted answers about that.

From the above you can gather that I have quite different experiences than you guys, which at least in part explains our differing opinions on this topic. But yeah, it's getting a bit meta-discussion now so... L Break Into Program. :)