Is a momma-mod possible?

Started by rimaholic, October 28, 2020, 11:22:11 PM

Previous topic - Next topic

rimaholic

TL;DR: Can a mod save and exit the game at a predefined time (e.g. 2 am)?

Hello,
I've discovered Rimworld only a couple weeks ago and it's already the game with the most hours played in my steam library... with no sign of this changing.
The problem is, that I have real trouble getting to bed early, even with the real-time clock display on. (I would be like: "Duh, it's 3 am but we first have to hunt this lynx before it attacks a colonist..." and so on ...). Right now I have holidays, so it's just an issue of social jetlag and getting scolded by my mom, but when college starts again I cannot afford to f*** up my sleep cycle this way.

So I thought about creating a mod which saves and exits the game at a predefined (real-world) time. Since my games always start paused it's probably not an issue even if there's a fight going on right then.

I know there are timer mods, which tell you how long you've been playing in a streak, so I reckon the timing part is feasible. But how about the save and exit part: can this be done with a mod?

Greetings and good night (it's 4:30 am again  ::))
Rimaholic

rimaholic

PS: if that's now possible it would also suffice to make the game effectively unplayable, e.g. by:
* adding a huge unremovable GUI element over the screen (except the menu)
* permanently pausing the game (either making unpause impossible, or re-pausing immediately)
* ...
(* adding increasing mood debuffs to colonists if I don't go to bed  :P)

rimaholic

I've built a prototype-mod for this, and it seems to work pretty well :D

The method used is to re-pause immediately.
The mod uses harmony to patch methods around pausing the game and the go-to-bed schedule (for me it's 1 am to 7 am) is currently compiled into the dll, which has the neat advantage of discouraging late-night-changes. It also displays a message telling you to go to bed.
The actually easiest way to circumvent the mod is to disable it (which requires restarting the game).

I haven't had time yet to package it to upload it on steam workshop, but I'm already really confident it is completely safe to add to existing saves and that it won't clash with any mod. It requires harmony though.

Greetings, rimaholic

RawCode

game de facto open source and you can do anything, including removal or blocking GUI elements.

demeggy

Potentially;

The game's built on Unity, so the C# command would be Application.Quit() - but I've no idea how you'd trigger the save mechanism without looking into it further.

In all honesty, I'd be inclined to suggest you try a little willpower?