Space Engineers

Space Engineers

View Stats:
EmberStar Jan 5, 2020 @ 1:52am
Is there a way to trigger Timer Blocks when a ship connects? (Vanilla, no scripts.)
I was wondering if there's a way to set up an automated docking port so that when my freighter connects it turns on a Timer Block.

Timer Block A
Turn off Ice/Ore return sorter
Turn On Ice/Ore drain sorter
Start Timer Block B

Timer Block B (10 second delay)
Turn on Ice / Ore return sorter
Turn off Ice / Ore drain sorter

The idea is that when the ship docks, the system drains all the ice and ore it can reach (to be further sorted if necessary by other blocks.) Then once the freighter is emptied of raw ore, the ice return comes back on so that the ship's O2/H2 generators can pull automatically from the deposited ice. And in the case of ships with built in refining capacity (like the H-01 mining/prospecting ship) those can resume drawing from anything stored in the station that they can process.

I know some blocks can trigger events when they change states now. The B-60 freighter has a neat setup to control the airlocks, triggered by the Vent blocks. If I'm understanding the actions, when they lose pressure they turn off the normal interior lights, turn on red warning lights, and trigger a block that will close all the doors after a short delay. When they have full pressure, they trigger a timer block that turns off the warning lights and turns on all the normal lights. The third timer block runs on a one minute cycle, and then closes all the doors.

The only drawback is that the timer that closes the doors runs on a loop (it closes all open doors once every minute) and the bridge doesn't have it's own air vent. If you're moving around the ship this isn't an issue. But I accidentally left the game running while I made dinner a while ago, and discovered that the bridge *will* eventually run out of air. D:

In any case: Is there a way to set up the connectors to drain a ship as soon as it connects, without using scripts? I thought about Sensor blocks, but that would trigger as soon as a ship got in range, depending on how much time the overly cautious pilot (me!) spends lining up, it might have shut off again by the time the connector actually turns on.
< >
Showing 1-15 of 15 comments
ShadedMJ Jan 5, 2020 @ 3:27am 
No. If you look at a sensor, there are actions that can happen if something is detected. There are no actions on a connector.

This can be done with scripts though. Probably something similar can be done using sorters.
Last edited by ShadedMJ; Jan 5, 2020 @ 3:28am
EmberStar Jan 5, 2020 @ 3:41am 
I guess for an semi automated mining station I could do something using timer blocks then. Have one set on a 50 second cycle, and disables all the drain sorters and enables all the return sorters. Then have the second block on a ten second timer and turn on all the drains and off all the return blocks. I think that would do basically what I want (empty all the ore and ice, and still allow generators and assemblers to pull from the station as they need it most of the time.)

I'm basically trying to set up some automated drone ships, to haul ice and ore from the drilling rigs back to my main stations. (And maybe even mining drones using something like Path Auto Miner or Rdav's script, assuming those are still working.) I want to avoid relying too much on scripts for simple things like moving ores, just because it seems like patches break scripting sometimes. The less scripts I use, the less there is to break
aaron Jan 5, 2020 @ 3:44am 
Last edited by aaron; Jan 5, 2020 @ 3:45am
EmberStar Jan 5, 2020 @ 3:49am 
Originally posted by aaron:
try a script called SAMv2

I'll take a look, but as I said I want to avoid using too many scripts. More scripts means more programmable blocks on everything, and more chances for something to break when Keen releases a patch. Since I don't know script programming, I prefer to avoid being too dependent on a bunch of scrip modders not getting bored and abandoning a script that I'm depending on. The only script I really use is Isy's Ship Refueling script, because it's just too useful.
ShadedMJ Jan 5, 2020 @ 4:04am 
If you check my history, I write scripts. Even I try not to use them because the interface from Keen changes so often. I've written scripts that work fine on my system, but when given to other players only to find they are on a server with scripts disabled, so there was no point to that at all.
Candarian Jan 5, 2020 @ 5:16am 
u could add a sensor behind the connector and start it 5 sec after a ship goes within range of it
Last edited by Candarian; Jan 5, 2020 @ 5:17am
EmberStar Jan 5, 2020 @ 5:25am 
Originally posted by Candarian:
u could add a sensor behind the connector and start it 5 sec after a ship goes within range of it

As I said, the problem is that it often takes me more than five seconds to dock. For my freighter I tend to be extremely cautious lining up, since I've learned the hard way that it's *incredibly* easy to overcook the thrust and smash both connectors. I also wanted something that could work for automated ships if I manage to get my idea for a drone cargo ship working. Additionally the sensor block would continue to detect the ship as long as it's docked, meaning it would not change the states on the conveyors until the ship leaves.
ShadedMJ Jan 5, 2020 @ 6:25am 
This might help. Kind of sketchy because it references non-same-grid blocks.

StationTimerA (10 sec?) -> Trigger ShipTimerA & Start StationTimer1
Keep trying to run ShipTimerA

ShipTimerA (?) -> StationTimerA Off & Return Sorter Off & Drain Sorter On & Start ShipTimerB
Keep StationTimerA from restarting this

ShipTimerB (10 sec) -> Return On & Drain Off

StationSensor (Ship detection Off) -> Start StationTimerA
When ship leaves start StationTimerA again
EmberStar Jan 5, 2020 @ 6:42am 
I'll give that a try when I have some time later. If I understand what that's doing, it looks like I'd want to give each Ship Timer a unique name? And I might even need to set it up with the ships connected. I know I've created a "Drone control station" using a flight seat with an action to Control a remote block linked to the station. (Which helps because it's super weird to try to take control of a drone that's already attached to a Connector, because it only shows up as the one item no matter how many remotes are connected.) If I get out of the seat without docking the drone, the toolbar action to Control the remote won't work until I dock it again.

The plus side is that it's a lot easier to connect to a drone's remote when it's not linked to a station. Anyway, maybe something similar will work, although it seems pretty brute force and things might get weird if more than one ship happens to be docked at once. D: But without using scripts there probably aren't a lot of really efficient ways to do this. Thank you for the suggestion.
Burstar Jan 5, 2020 @ 6:43am 
Um, guys you can do this with a sensor.

Have the sensor detect subgrid and it'll trigger when the ship locks. You just have to make sure there are no other subgrids on the ship in the way of the field.
Last edited by Burstar; Jan 5, 2020 @ 6:43am
ShadedMJ Jan 5, 2020 @ 7:15am 
Originally posted by Burstar:
Um, guys you can do this with a sensor.

Have the sensor detect subgrid and it'll trigger when the ship locks. You just have to make sure there are no other subgrids on the ship in the way of the field.
As Emberstar stated, it takes a long time to dock. Sensor could start process and process could complete before ship is docked.
Bahamut Jan 5, 2020 @ 8:22am 
Originally posted by ShadedMJ:
Originally posted by Burstar:
Um, guys you can do this with a sensor.

Have the sensor detect subgrid and it'll trigger when the ship locks. You just have to make sure there are no other subgrids on the ship in the way of the field.
As Emberstar stated, it takes a long time to dock. Sensor could start process and process could complete before ship is docked.

The sensor, set to detect only subgrids, would ONLY trigger once the ship is actually docked, assuming the connector is itself not a subgrid of the ship.
EmberStar Jan 5, 2020 @ 8:34am 
I'll try that when I have time to finish building my test station. If I'm understanding correctly, this wouldn't work if you like to dock using extendable pistons connectors, but it should(?) work when the ship is a single grid. I'll update the first post if it works.
Burstar Jan 5, 2020 @ 8:42am 
Originally posted by EmberStar:
I'll try that when I have time to finish building my test station. If I'm understanding correctly, this wouldn't work if you like to dock using extendable pistons connectors, but it should(?) work when the ship is a single grid. I'll update the first post if it works.
If the sensor is on the ship and the ship doesn't use a piston+connector then any subgrids on the station won't be a problem. Subgrid is defined in relation to the grid the sensor is on. So if the ship does have the piston+connector, put the sensor on the station instead. Alternatively, if you put the sensor on the connector + piston make sure it is on the piston head+connector end and that it's field won't ever touch the ship/piston base.
Last edited by Burstar; Jan 5, 2020 @ 8:46am
Candarian Jan 5, 2020 @ 8:51am 
sensor
if u have it behind and u set the detection range in every direction to 1 but only the one in direction to the connector nothing trigger till u dock
< >
Showing 1-15 of 15 comments
Per page: 1530 50

Date Posted: Jan 5, 2020 @ 1:52am
Posts: 15