Where to start with code?

Started by mortizzle, June 23, 2014, 06:09:18 AM

Previous topic - Next topic

mortizzle

Howdy All,

Myself and some friends have been having fun making some basic mods over the last couple weeks, structures, weapons, research etc so I've got a pretty good idea of how the defs hang together now.  Having a programming background I thought I'd delve into things a little more deeply and do something a little more complex, but when I decompiled the game I'm greeted with a hundred plus classes in the top level and I'm at a bit of a loss where to start looking.  Can anyone with some experience with coding mods give me a hand and point me towards a good starting point for an understanding how it hangs together? Happy to elaborate on plans for modding if it helps hone in where I should be looking.

Ta

Haplo

A good and easy entry point to understand a bit of the basics..
Hmm, I think the building_xxx classes are the best entry. They show you a bit of how buildings are coded and interlinked.
For more detailed information you need to be a more specific about what you wanna do :)

mortizzle

Heh fair enough. So i basically wanted to introduce the idea of hygiene, I haven't really thought through all the implementation details yet but the basics are that you have a hygiene need that increments over time and you have a toilet building that you go to to relieve/reset that need. Down the track I'd probably introduce showers and tie it into cleanliness, and probably split the hygiene types somewhat and tie it into the eating mechanism too. I figure it's a fairly basic and intuitive idea that covers a couple different areas and will be a good entry point into the code.

Thoughts?

Haplo

He, he, that an easy entry point? I don't think so ;)

What you propose is an addition to the pawn class.
This includes that you need to replace every pawns used ingame with your class.
Doable? Sure. Easy? I don't think so.
But take a look into the Automation mod. That does something similiar. It adds a few commands to the pawns.
Secondly I recommend a look into the various pawn mods: K9, Droids, Miscellaneous
There you can find how the different parts of a pawn work together.
As I had my whole bunch of problems with Mia (in Miscellaneous) I can tell you that everything that has to do with pawns isn't really easy..
Easy would be buildings :)

mortizzle

Awesome, thanks for the pointers.. greatly appreciate it. I'll let you know how I go!

Haplo