Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Quarantine Gate and small animal trigger design  (Read 585 times)

peregarrett

  • Bay Watcher
  • Гномовержец Enjoyed throwing someone recently
    • View Profile
Quarantine Gate and small animal trigger design
« on: February 25, 2011, 07:32:53 am »

For example, we want to separate a group of dwarves from others. First thing that comes to mind is to seal them there then continuously dump food supplies there and reclaim them. That bothers.

Second - operate doors that make a common area available first for majority to bring food, then for isolated ones to eat. Also enough of micromanage.

Here's the design of Quarantine Gates and shared area:
Code: [Select]
    ####========####
Out .^C^=Shared=^C^. Out
    ####=      =####
Common #= Area =# Quarantine
    ####========####
In  .^C^========^C^. In
    ####========####
Also we use two triggers. I prefer animal ones:
Code: [Select]
Z=0
  |Reset input
#####
#<+^# <- Up stair, Door (D1), Plate P
#####
   |Output

Z=1
   |Set input
#####
#>+C+.. <- Down stair, Door (D2), Hatch (H), Door (D3), exit.
#####

Inputs are Hatch H - Set and Door D1 - Reset. Output is plate P
Animal is pitted on Hatch H and remain there. His pathfinding insist on running through door D3, but it's forbidden for animals.
When Set signal is received, hatch opens and drops animal on plate, thus setting it's state to 1. And it remains 1 till Reset signal opens door D1 and lets animal out. Animal runs upstairs and stays on hatch, again.
Door D2 can be used for strictly enclosing animal over hatch and linked to plate P. When trigger is Reset and animal leaves, plate has 100 tick delay to reset and for that 100 ticks door D2 remains open. I guess it's enough for animal to do 5 tiles walk. At least for hunting dog.

So, back to Quarantine Gate.

We have separated in and out ways both from common and quarantine areas. Each way has a such set installed:
Code: [Select]
####
.^C^  <- Plate P1, Hatch H over empty space, Plate P2
####
For inputs, plate P1 is linked to all hatches at each way, except for this one. I.e plate Pci1 (P1 of common in entrance) linked to hatches Hco (common out), Hqi (quarantine in), Hqo (quarantine out), Pqi1 is linked to Hci, Hco, Hqo.
Output P1's are linked to nearest hatch. Pco1 linked to Hco, Pqo1 - to Hqo. This is used to prevent dwarves from entering through exits.
P1's are used to short-time blocking ways, to prevent simultaneous rushing into shared area both from common and quarantine areas - either single or none passages remain open.
After each hatch we have plates P2. They used to maintain the state of passages till dwarf leaves shared area back to common or quarantine. This is made by animal triggers described above - we build one trigger Tc for common area  and one Tq for quarantine.
Plate Pci2 linked to Set input of Tc, Pco2 - to Reset of Tc, Pqi2 to Set of Tq, Pqo2 to Reset of Tq.
Output of Tc linked to hatches Hci, Hqi, Hqo, of Tq - to Hqi, Hci, Hco.
So. Let's dwarf want to enter shared area from Common area. He steps at Pci1, thus blocking all other ways for next 100 ticks. He advances over hatch and steps on Pci2. Trigger Tc turns to Set state and maintains the blocked state of quarantine entrances and also opens Hci blocking way back to common area. Dwarf is sealed at Shared Area.
In  100 ticks plate Pci1 releases and closes Hco opening the way out. Dwarf runs there over Pco2 setting Tc to Reset and allowing entrance for next one from whatever area - common or quarantine.

Thanks for reading, I feel much better now.
Logged
Did you know that the Russian word for "sock" is "no sock"?
I just saw a guy with two broken legs push a minecart with a corpse in it. Yeah.