Greetings.
So i was playing around with complex rail movement sequences and found that i needed a failsafe to prevent messing up the sequence by spamming the activation module.
I haven't found anything like that on this forum so i made one and wanted to share with the lot.
So the First step would be to mock up a sequence like this example:
Repeated input by the user messes up the sequence wich can be fatal in a more complex sequences.
It could for example tangle up hatches in each other or gates are closing on extended turrets etc.
How to prevent this?
My approach was to detect the state the sequence is in and block input accordingly.
on this example i used activation modules to detect if the docked core is moving or not.
If it is not moving it is stationary at either end of the rail.
The OR module will always be lit if the rail is stationary and off if not.
NOTE!
When the docked entity is starting to move there is a delay until the docked entity fully left the rail block. Only then the activation module switches off. That is why an additional rail with no attached modules as buffer is required here.
The output of the OR module cannot be used yet since this setup uses permanent On/off signals instead of pulses. If we were to directly use it as condition on an AND module we would end up with this:
This will prevent the sequence whenever the docked entity is moving, This is not wanted.
What is desired is to prevent a change of signal while the rail is moving.
For this it is needed to detect the change of the signal wich can be done with a setup like this:
Whenever the activation module is turned on or off a pulse signal is created wich is effectively detecting the change of the signal.
On to off its a high edge and a on to off is a low edge. This setup combines the both to detect either edges.
Now the output of our High/low Edge detector is our first condition and the Railposition detector is our second condition.
If the Docked entity is currently not in sequence AND the Signal is changed Then we output a Permanent signal to our activation module initiating the sequence.
to make the pulse permanent we use a flip flop. and the result is this:
As you can see im hitting the activation module like an epileptic monkey, the sequence will always finish before changing back again.
my mother language is not english so if i screwed up with the terminology correct me please.
I really just was in the mood to make a tutorial. Still criticism is always welcome so i may improve upon.
So i was playing around with complex rail movement sequences and found that i needed a failsafe to prevent messing up the sequence by spamming the activation module.
I haven't found anything like that on this forum so i made one and wanted to share with the lot.
So the First step would be to mock up a sequence like this example:
Repeated input by the user messes up the sequence wich can be fatal in a more complex sequences.
It could for example tangle up hatches in each other or gates are closing on extended turrets etc.
How to prevent this?
My approach was to detect the state the sequence is in and block input accordingly.
on this example i used activation modules to detect if the docked core is moving or not.
If it is not moving it is stationary at either end of the rail.
The OR module will always be lit if the rail is stationary and off if not.
NOTE!
When the docked entity is starting to move there is a delay until the docked entity fully left the rail block. Only then the activation module switches off. That is why an additional rail with no attached modules as buffer is required here.
The output of the OR module cannot be used yet since this setup uses permanent On/off signals instead of pulses. If we were to directly use it as condition on an AND module we would end up with this:
This will prevent the sequence whenever the docked entity is moving, This is not wanted.
What is desired is to prevent a change of signal while the rail is moving.
For this it is needed to detect the change of the signal wich can be done with a setup like this:
Whenever the activation module is turned on or off a pulse signal is created wich is effectively detecting the change of the signal.
On to off its a high edge and a on to off is a low edge. This setup combines the both to detect either edges.
Now the output of our High/low Edge detector is our first condition and the Railposition detector is our second condition.
If the Docked entity is currently not in sequence AND the Signal is changed Then we output a Permanent signal to our activation module initiating the sequence.
to make the pulse permanent we use a flip flop. and the result is this:
As you can see im hitting the activation module like an epileptic monkey, the sequence will always finish before changing back again.
my mother language is not english so if i screwed up with the terminology correct me please.
I really just was in the mood to make a tutorial. Still criticism is always welcome so i may improve upon.
Last edited: