Wiremod - How can I wire my pod controller to my button that controls hydraulics?

Hi, I am trying to make a bomber and the bomb bay doors are controlled by hydraulics, linked to a button. The the button controls the hydraulics perfectly as I want, but ideally I want to be able to open the bomb bay doors from the pod controller, can you please tell me how I can do this? Thanks :slight_smile:

I recommend http://www.wiremod.com/forum/?tabid=11

You need to learn expression 2, it is for these things.

A simple e2 for hydraulic control:

@name Door control
@inputs Cycle #Wire this to a key on the pod controller
@outputs Length #Wire this to hydraulic
@persist Open 


if(Cycle) {Open = !Open} #This is a basic E2 toggle, it is very useful

if(Open == 1)
     Length = 100 #set this to whatever the open length for the hydraulic is
if(Open == 0)
     Length = 10  #set this to the door closed hydraulic length

Plan b:
Use a numpad input for the hydro’s idle and expanded length. Then wire an numpad output of the same key to a control on the pod controller.

That E2 works fine, but there’s no need to have it constantly running. Here’s a slightly tinier version if that’s what you like, though the one above is easier to read.

@name Bomb Doors
@inputs [Door]:number #Wire this to an output key of the Pod Controller
@outputs [Length]:number #Wire this to the hydraulic's length input
@trigger [Door]:number
@persist [Open]:number

if (~Door) {
    if (Door) {
        Open = !Open #This toggles Open to 0 or 1 when you press a key once

Length = (Open ? 100 : 15) #Set 100 to the hydraulics's open length, and 15 to the closed length

First change the 100 at the bottom of this code to whatever the extended length of the hydraulic is, then change the 15 next to it to the length it is when closed. Take out the Expression 2 tool, paste this in the editor, spawn the E2; then wire the Door input to an output like Mouse1 on the Pod Controller, and wire the Wire Hydraulics’s Length input to the E2’s Length output.

Technically you could probably do this with a bunch of gates and constant values, not E2, but this saves on entity counts.

This worked, thanks :slight_smile:

[editline]11th March 2016[/editline]

Thanks for the response, but I used the one below but yeah, thanks anyway :slight_smile: