Jump to content

Turn Off Button Not Working


Kastrella
  • Branch: Live Branch Version: Windows Pending

The turn off button on the auto dispenser is not functional. When it does work, it completely disables the auto dispenser that the turn on button and enable building will not fix it. Currently unable to reproduce the complete disable part.


Steps to Reproduce

Place an auto dispenser and click the turn off button from the popup UI.




User Feedback


In order for the Turn Off button on the Dispenser to be functional, three conditions must be met:
1. The Dispenser must be connected to the Energy
2. After pressing the button, the live Duplicant should come up and switch the Dispenser, just as they switch, for example, an open/closed Door.
3. After that, you need to save and restart the game. then the Dispenser will really switch. (and this is really a bug)
OR install this mod, then saving and restarting the game will not be required (but connecting to Energy and a live Duplicant is still required)
PS this was my very first mod. and it contains the simplest patch in one line of the operating code.

Spoiler



[HarmonyPatch(typeof(ObjectDispenser), "Toggle")]
internal static class AutomaticDispenser_Toggle
{
  private static void Postfix(ObjectDispenser.Instance ___smi, bool ___switchedOn)
  {
    ___smi.SetSwitchState(___switchedOn);
  }
}


 

 

  • Like 1

Share this comment


Link to comment
Share on other sites

20 hours ago, Sanchozz said:

In order for the Turn Off button on the Dispenser to be functional, three conditions must be met:
1. The Dispenser must be connected to the Energy
2. After pressing the button, the live Duplicant should come up and switch the Dispenser, just as they switch, for example, an open/closed Door.
3. After that, you need to save and restart the game. then the Dispenser will really switch. (and this is really a bug)
OR install this mod, then saving and restarting the game will not be required (but connecting to Energy and a live Duplicant is still required)
PS this was my very first mod. and it contains the simplest patch in one line of the operating code.

  Reveal hidden contents

 



[HarmonyPatch(typeof(ObjectDispenser), "Toggle")]
internal static class AutomaticDispenser_Toggle
{
  private static void Postfix(ObjectDispenser.Instance ___smi, bool ___switchedOn)
  {
    ___smi.SetSwitchState(___switchedOn);
  }
}

 

 

 

 

 

I decided to record this a video representation for Sanchozz steps. There was a cut on the loading screen because that is a boring part. Excuses my fumbling on what to build. Thank you telling me why my auto dispenser got bricked on one of my saves.

Share this comment


Link to comment
Share on other sites

@Kastrella:

And I had thought the button was a decoy. Correct me if I'm wrong, but using the turn on/off button when plugged in will still allow for the building to consume the 60w/s.

BTW, I just recently kinda necro'd some of that odd stuff on the forums:

 

 

Share this comment


Link to comment
Share on other sites

If it dispensed an item, it will consume power when it is available. So yes, the building will still consume 60w. I know this because I used that button to try to turn off the dispenser on a power line at exact 2kw and it keep putting it over 2kw when it was off. That was when I saw that restarting the game completely disable the machine until restarting again with it being turned on.

Share this comment


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...