Jump to content
  • The forum downloads section will be removed on Jan 1st 2023. Players may still download mods that are currently hosted, but new submissions are no longer being accepted. Mod makers are advised to relocate their mods to alternative hosting solutions.

AFK Auto-Pause 1.2


1 Screenshot

About This File

Have you ever had to quickly leave your PC and couldn't be bothered to hit Escape? Now there's help with that. By using this mod, the game will detect when you haven't done in-game things for a while and, once that is the case, pause for you. No longer must Wilson suffer under inactivity.

Configure the waiting time: From 1 second to 3 minutes, choose whatever you prefer.

Modes:

  • Pause Screen/Menu (true pause) - Equivalent to hitting "Escape"
  • Freeze Time - Halts all in-game processes, but HUD, UI and even inventory still work normally. Click into the world to resume.
  • Slow Time - For whatever reason, this mode exists to let Wilson do the "Matrix" moves. Except that he is idle and time resumes normally once he moves.

Tip: Use "Freeze Time" mode with "1 second" delay to make Don't Starve (almost pseudo-) turn-based!

FAQ

  • Is this mod compatible with Time To Craft?
    Yes it is, though there may be counter-intuitive interaction.
  • Does this mod use the so-called "soft stop" with "timescale" and such?
    Yes, if you select either time warping mode, it does.
  • This mod crashes/freezes/kills my game!
    Make sure it actually is this mod that causes the problem, then write a rough report to me. Ideally, include "log.txt" as described on the bug tracker.
  • When will this mod come to Together?
    Think about it for a moment and realise just how fundamentally flawed this question is.

What's New in Version 1.2   See changelog

Released

  • Fixed camera control when freezing time
  • Fixed pausing despite an action being planned
  • Added 1s delay option
  • Resets time scale when using move controls
  • Like 1
  • Thanks 1

User Feedback

Recommended Comments

Hey, I think this is a great start!

One issue I noticed is that OnClick() currently appears to be triggered (unpausing the game) in response to any mouse movement, not just clicks.  It should probably only be triggered by actual clicks. (Fixed)

Edited by Elestan
Link to comment
Share on other sites

10 hours ago, Elestan said:

Hey, I think this is a great start!

One issue I noticed is that OnClick() currently appears to be triggered (unpausing the game) in response to any mouse movement, not just clicks.  It should probably only be triggered by actual clicks.

This must be an issue with the line I added last-minute. I removed it for now.

Link to comment
Share on other sites

On 4/27/2016 at 0:20 PM, Mobbstar said:

This must be an issue with the line I added last-minute. I removed it for now.

Yep, that fixed the mouse movement.  Cool!  I've done some further testing, and found some more issues:

  1. Most keyboard shortcuts do not work while paused.  I think Q/E (Rotate) should work but not unpause, and the walk keys should unpause. (fixed in 1.2)
  2. TAB-ing to the world map and back currently unpauses; I don't think it should.
  3. Mouse wheel zoom does not work while paused. (fixed in 1.2)
  4. If you use CapsLock to pull out the crafting tool bar, the game will not pause until you close it.
  5. Currently, the pause can occur while Wilson is in the middle of doing something (anything other than walking).  For example, with a low enough timeout (I added 1 second to the options), I can click on a distant sapling, and Wilson walks to it, and then as soon as he stops walking, the game pauses before he can pick it.  Is there a way to ask the API what Wilson's current activity is?  I think that it should wait until Wilson is idle before starting the pause countdown. (fixed in 1.2)
Edited by Elestan
Link to comment
Share on other sites

Glad to see the update!

I've tested the new version, and it's working much better.  There are still the world map and crafting bar issues, but as you mentioned to me, those may be hard to do anything about.

I did find a couple more minor issues that are more in the nature of polish; the mod is functional without them, but they would make it look better:

  1. While the game is paused (Freeze time), the item highlight and tooltip (e.g. "Examine Rock") are also frozen.  It would be better if those UI features could work normally while time was frozen.
  2. Sprites with multiple "sides" have their images locked while time is frozen, so they do not update properly when the view is rotated.  To demonstrate this, let time freeze with an animal such as a bird, snake, or beefalo on screen, facing left or right (let's use left for this example).  Now rotate the view 180 degrees so that you are looking from the opposite side of Wilson.  The animals will still be facing to the left, even though they should now be facing to the right.  If you now un-freeze time, they will all suddenly turn around.  Ideally, rotatable graphics would be properly rotated even while time is frozen.
  3. I think that changing a worn item (body/hand/head) should trigger an unpause, because that is actually a meaningful change.  Also, changing those slots while paused causes weird things like torches that are equipped but not lit.

I also had a thought about the way the mod is implemented.  Currently, the mod looks at the locomotor, and looks for bufferedactions.  In SGWilson.lua, it looks like there is an "idle" state that is active when Wilson is not doing anything.  I was wondering if it would work to just check the state machine with:

inst.sg:HasStateTag("idle")

...and/or maybe hook into the onenter and onexit (and probably ontimeout) for Wilson's idle state?  You might not even need to keep your own timer; you could just look at the idle state's timeinstate value.

Edited by Elestan
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...