Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

How can I disable ship drills ?

Discussion in 'Programming (In-game)' started by Mollymawk, Apr 16, 2019 at 18:45.

  1. Mollymawk Trainee Engineer

    Messages:
    71
    Hi,

    Is there a way to disable a drill so that it cannot be operated manually?

    I have a "ship full" script which turns lights on when full. I have been trying to make it disable the drills when the ship is full, it works fine if you operate the drill using ON and OFF, but if you are using the drill in manual mode, like most of us do, the on / off status is totally ignored.

    I was hoping there is a way to separate Enable/Disable from on/off.
     
  2. mojomann71 Senior Engineer

    Messages:
    1,434
    If you know your ship is full why would you try to use them manually anyway? (not being trollish, just you said you know it is full when lights are on, so why even try to manually drill at that point?)
     
  3. Sinus32 Trainee Engineer

    Messages:
    20
    Yes.
    The solution should be like this:
    Code:
    IMyShipDrill myDrill = GetMyDrillSomehow(...);
    myDrill.Enabled = false;
    Sorry, I have no intention to offend you and this is a really good question, but I think it is not a solution to the problem.
     
  4. Mollymawk Trainee Engineer

    Messages:
    71
    Too easy, Just humour me, think of me as ignorant monkey who doesn't know better, and make me some tea, or in this case tell me how to disable a drill.

    Thank you Sinus, I have already tried this, but this doesn't work.
    when you manually operate the drill, the fact that the drill is either On or Off has no effect at all.

    you can turn the drill on:
    myDrill.Enabled = true;

    but if you subsequently use the mouse Button to mine manually, when you let go of the mouse button. The drill will stop drilling even though myDrill.Enabled == true;

    you can turn the drill off:
    myDrill.Enabled = false;

    but if you subsequently use the mouse Button to mine manually, when holding down the mouse button. The drill be drilling even though myDrill.Enabled == false;

    You don't even need to script to see this, drag the block tool for the drills to your action bar, Also drag "Toggle block On/off" to the tool bar.. manual use ignores the On/Off state.
     
    Last edited: Apr 16, 2019 at 23:13
  5. Malware Master Engineer

    Messages:
    9,351
    The problem is that you start the drills by enabling them. That's specifically what makes them spin. Thus I don't think there is a way to do what you're asking.
     
  6. Mollymawk Trainee Engineer

    Messages:
    71
    If it was available, I think it should be a cockpit setting, there are already options to control thrusters & wheels there could be a "Control Block Tools" option.
     
    • Like Like x 1
  7. Ronin1973 Master Engineer

    Messages:
    4,587
    Drills can be operated as a ship tool by placing the block tool icon of a drill in a toolbar and enabling it. This allows you to left click the drill and operate them in short bursts with the mouse button. You want to be able to override this feature with an in-game script. The in-game script doesn't have access to override this set-up. I don't think you can turn off the drill in this manner. But it's possible you could use a sort block after the drill(s) to stop ore from passing. You can also do this with two connectors facing each other and disabling one of them.

    The other solution is to NOT use the left click and use the toolbar to turn the drills on.

    It's not the solution you want but the only solutions that will reasonably work.
     
    • Like Like x 1
  8. Mollymawk Trainee Engineer

    Messages:
    71
    I was mulling this over today. I have a sneaky idea, untested yet as I have work to do. The drills go on a drilling "rig" (just drills and conveyors) the rig is attached to the ship with a small hinge(i love the hinges mod), the rig is held in place with a couple of landing gear.
    I can cut power to the drill at will by detaching/reattaching the hinge. Its a complicated idea from a problem that is not really a problem so in my head it looks perfect. :)
    -