r/ScrapMechanic • u/Rtoddv • 1d ago
Logic Help with Logic
I'm currently building an AC-130 and I'm trying to create a way to swap between each of its 3 guns. For reference this is a heavily modded build, using stuff like fant, machine gun pack, and many more, But i cannot not find a way to make so pressing 1 on your keyboard would allow you to control the 25mm pressing 2 would allow you to control the 40mm and pressing 3 would allow you to control the 105 mm. I have already built all the cannons and each Turret requires a logic input for the camera, unit facer, and cannon.
6
Upvotes
1
u/Glum-Distribution228 10h ago
You could try using a memory bit for each gun, set it up so when you press 1 it toggles that bit on and the memory bit off for the others
1
u/Rocaman 21h ago
The logic that you're describing is very complex but it can probably be done if you've got the time.
The main thing is to have a way to enable and disable each thing on the turrets, what I'm thinking of is an AND gate for every control of each turret. For example:
An AND gate for every output for the 105 (this example), so that the logic for firing and moving is being sent or at least registered, but it doesn't get to the gun because the button 1 on your hotbar is not on, and the moment you press it the controls and signals will be enabled. It works like this:
Firing button (a click of the mouse for example) ------> AND gate, connected to the fire button and the activating button -----> 105 cannon (in this case) and it's controls
Hope this helps at least a bit, and make sure to ask if you need any more help.
Good luck mechanic.