Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Can a lever trigger more than one thing?  (Read 2339 times)

callisto8413

  • Bay Watcher
    • View Profile
Can a lever trigger more than one thing?
« on: September 12, 2013, 10:14:43 pm »

Can I, for example, link a lever to TWO drawbridges?  So if a person pulls it into the 'on' position it makes an outer drawbridge and inner drawbridge both lift?
Logged
The most EVIL creature in Dwarf Fortress!

BlackFlyme

  • Bay Watcher
  • BlackFlyme cancels Work: Interrupted by bird.
    • View Profile
Re: Can a lever trigger more than one thing?
« Reply #1 on: September 12, 2013, 10:24:23 pm »

Yes to both. When a lever is pulled everything it is attached to is affected.

Though the lever can only be 'on' or 'off', as in it can't turn one thing on and another off such as raising one bridge and lowering another simultaneously.
« Last Edit: September 12, 2013, 11:00:38 pm by BlackFlyme »
Logged

Descan

  • Bay Watcher
  • [HEADING INTENSIFIES]
    • View Profile
Re: Can a lever trigger more than one thing?
« Reply #2 on: September 12, 2013, 10:48:25 pm »

Order the lever to be pulled through its q menu. A free dwarf will get assigned the job of pulling the lever. This dwarf might be a long way away, and the delay in pulling the lever can result in Fun. Levers also make good furniture choices when constructed with high-quality mechanisms.
I don't think you answered a single one of his questions.
Logged
Quote from: SalmonGod
Your innocent viking escapades for canadian social justice and immortality make my flagellum wiggle, too.
Quote from: Myroc
Descan confirmed for antichrist.
Quote from: LeoLeonardoIII
I wonder if any of us don't love Descan.

kebab4you

  • Escaped Lunatic
    • View Profile
Re: Can a lever trigger more than one thing?
« Reply #3 on: September 13, 2013, 01:48:15 pm »

Yes to both. When a lever is pulled everything it is attached to is affected.

Though the lever can only be 'on' or 'off', as in it can't turn one thing on and another off such as raising one bridge and lowering another simultaneously.
Another question, if you wire two levers to the same object and turn one of them on, does 'on' overwrite the 'off' of the other switch?
Logged

vanatteveldt

  • Bay Watcher
    • View Profile
Re: Can a lever trigger more than one thing?
« Reply #4 on: September 13, 2013, 02:58:36 pm »

AFAIK, the lever puts the connected object into the new state.

So, if you have two levers connected to a bridge, pulling L1 will open the bridge. Pulling L2 will also send "open" to the bridge, and hence do nothing. Pulling L1 again will close the bridge, even though L2 is still "on". In other words, the state of the lever that was pulled last prevails.

(it gets tricky with reaction time, I believe new lever state changes are ignored in the time between pulling the first lever and the opening of the bridge.)

Though the lever can only be 'on' or 'off', as in it can't turn one thing on and another off such as raising one bridge and lowering another simultaneously.


That is true, but there are two options:

1) use targets that behave differently, especially bridges and floodgates. A bridge is raised (and hence blocks the passage) when the lever is "on", while the floodgate opens when it is on. So, if you connect a floodgate and a raising bridge in the same passageway to a lever, you get a kind of air lock system where the lever alternates which is open.

2) you can use an inverter, e.g. using fluid logic http://dwarffortresswiki.org/index.php/DF2012:Fluid_logic
Logged

Merendel

  • Bay Watcher
    • View Profile
Re: Can a lever trigger more than one thing?
« Reply #5 on: September 14, 2013, 12:49:35 am »

Yes to both. When a lever is pulled everything it is attached to is affected.

Though the lever can only be 'on' or 'off', as in it can't turn one thing on and another off such as raising one bridge and lowering another simultaneously.
Another question, if you wire two levers to the same object and turn one of them on, does 'on' overwrite the 'off' of the other switch?

in short yes.  in long Levers send a single pulse of their on/off command.  There is no continuous on or off singal.  if you flip a lever to on it sends the on signal to anything conected to it, if on tells the bridge to raise they will all try to raise unless already in the raised position in which case it will do nothing.  If there are 2 levers connected to something and the levers are in different states the target does not care, it will just obey whatever the last signal sent to it was.  The exception is some devices can only respond to signals so fast, if you send multipule signals faster than it can respond some will be ignored.
Logged