Celebrations Mod -.dll help required

Started by demeggy, January 28, 2017, 06:39:01 AM

Previous topic - Next topic

demeggy

Morning all,

So I've started preliminary work on my first assembly mod for Rimworld, which is to incorporate the triggering of parties for colonist birthdays, and a calendar through the UI that allows you to set and define specific dates as 'holidays'. Just because you're stranded on a rim world shouldn't mean you miss out on pseudo Christmas!

What I'm thinking is utilising a tab exactly like the standard Restrict menu, with 4 rows for each season, and a text input box to be prompted when one of the 15 days is clicked on. That day is then stored as a holiday, with a party triggering on the day of the event.

Thoughts, suggestions etc (I'm looking to keep this low key as my first .dll) are welcome, but what I'm really looking for is some assistance with the coding. I'm C# orientated, just need to dust off my brain and get familiar with the RimWorld libs.

Thanks,

Demeggy

RawCode


demeggy

Quote from: demeggy on January 28, 2017, 06:39:01 AM
...but what I'm really looking for is some assistance with the coding. I'm C# orientated, just need to dust off my brain and get familiar with the RimWorld libs.

JaxelT

That's not a question! It's very broad and difficult to help you with.

I recommend you download dnSpy and decompile the Assembly-CSharp.dll in the Rimworld Managed folder so you can peek at the game's code when you work. You will need to create a .NET 3.5 project and include any DLLs used in the base game in your mod if you need them. You may also want to pick up HugsLib so you can detour code from the vanilla game to alter it. After that it's up to you what you do to make your mod, those are just the things I wish I'd been told when I started.

demeggy

Without being too literal, I was assuming someone would be able to read between the lines and identify that I'm simply asking for advice on which particularly functions I could utilise from any of the vanilla libs, but no bother - I'll have a dig around with some decompilers at some existing mods to see if I can frankenstein something together!

RawCode

you can utilize any function, if function is private\protected, you can use reflection to access it.

demeggy

Quote from: RawCode on January 30, 2017, 05:00:14 AM
you can utilize any function, if function is private\protected, you can use reflection to access it.

Aye, it was more of a 'can anyone think of a handy set of references within the libraries I can utilise as a starting point', but I believe I'm getting somewhere with it now thanks.

RawCode

start from references to GUI frame you described in first message, you already know two keywords GUI and frame, good luck.