Wired Vehicles
From GMod Wiki
One of the most important uses of the Target Finder and Beacon Sensor tools (from Erkle's Wire Addon) is in vehicles, to enable them to track or follow objects, NPCs, players, etc. This page describes the construction some vehicles, integrating some of these applications.
Contents |
Attack Tube
Wired Vehicles: Attack Tube |
Description: | The Attack Tub is a completely autonomous bathtub that chases targets and runs them down. |
Original Author: | Nesc |
Created: | unknown |
Notes: | - |
Essentials
The Attack Tub will, in fact, not function without these.
First, get the unwired base together. Spawn a bathtub and stick four wheels on it. They don't need to be wired wheels.
- Spawn a button on the side, set to toggle.
- Weld a target finder onto the front, with whatever settings. I like to keep the range a little low.
- Spawn a beacon sensor on either side at the front, set to output distance. Link the beacon sensors to the target finder using the right-click. Be careful they are aligned with each other.
- Spawn two Greater Than gates (in Gate - Comparison) on either inside wall, then two And gates (in Gate - Logic).
- Wire the left-side Greater gate. A: the left side sensor. B: the right side sensor. Reverse that for the right-side Greater gate.
- Wire the And gates. A: the button. B: the target finder. C: the Greater gate on the same side as the And gate.
- Spawn four thrusters on the outside corners, 1000 multiplier.
- Wire the front thrusters. A: the And gate on the same side.
- Wire the back thrusters. A: the And gate on the reflected side.
- Spawn an Or gate, and wire. A: an And gate. B: the other And gate.
- Spawn a 3000 multiplier thruster on the back, outside. Wire. A: the Or gate.
The beacon sensors report their distance from the target to gates that decide which side of the tub is closer. The thrusters are activated (if the button is on and a target is acquired) until the tub is facing the right direction. The thruster on the back is also providing forward thrust.
More specific thrust
Proof of concept. You can take that to any bank. But it spins wildly and, given enough time, falls over. We need to set the big thruster to only fire when it's pointing in the right direction. An Equals gate wired to the two beacon sensors wouldn't work, because that's too exact.
- Spawn a Subtract gate, an Absolute gate (both in Logic - Arithmetic), and a Greater gate.
- Wire the Subtract gate's two inputs to the two beacon sensors, and the Absolute gate's single input to the Subtract gate.
- Spawn an Constant Value of around 5. This represents how straight the tub has to be pointing.
- Wire the Greater gate. A: the constant value. B: the Subtract gate.
- Now, spawn an And gate, and wire. A: the button. B: the target finder. C: the Greater gate.
- Delete the Or gate, and wire the thruster to the new And gate.
- Spawn a Not gate, and wire it to that And gate.
- Update the first two And gates. D: the Not gate.
Problem is, now the big thruster isn't firing during most of the turning, and there's too much friction.
- Spawn another big 3000 multiplier thruster, centered between the 4 wheels underneath.
- Wire the thruster to that Not gate.
Self-righting
It still falls over a lot, though. Lift up the tub and get underneath.
- Spawn a gyroscope set to output 0-360 on the bottom (make sure it's flat).
- Spawn a Greater gate, a Less Than gate, and two constant values.
- Wire the two gates. A: the Roll output of the gyroscope. B: one of the constant values.
- Set the value the Greater gate is wired to as 240, and the other as 120.
- Spawn an Or gate, wired to the Greater and Less Than gates.
- Spawn an And gate. A: the button. B: the Or gate.
- Spawn a 5000 thruster pointing up on the rim, above the target finder, and wire it to the And gate.
The two gates ask the gyroscope which way the tub is pointing, and if it is close to falling over either way, the thruster fires. But we want everything else to stop when it's righting itself.
- Spawn a Not gate, wired to the new And gate.
- Update the four And gates on top (leading to the other thrusters). E/E/D/D: the new Not gate back underneath.
Efficiency
It wobbles back and forth a lot. You could give it some time to align itself before the main thruster fires. This might mean using a timer for 1 or 2 seconds before the main thruster would fire. There are probably simpler solutions.
It also bumps the target a lot, because it's not fast enough. You could figure out a way to keep stability while increasing the thruster power. You could go with the quick and easy way, and wire some dynamite to the front. Or, you could set up a routine that would reverse the tub if it pushed against the target for too long, and them ram it again. See if you can figure out how to implement some of these on your tub.
Designed and written by Nesc, Steam account name "taio".
Stable Wire Car
Wired Vehicles: Stable Wire Car |
Description: | A wire car that most of the time will never come off the ground! |
Original Author: | Orb posted by , quangphangbang |
Created: | Unknown |
Notes: | - |
- First for the control panel. Spawn a 2 by 2 Panel from Phoenix models.
- Spawn 2 wire buttons for Left and Forward with an on value of 1. This is for Forward, Left, and Right. Then spawn 2 more buttons for Backward and right with a on value of -1.
- Spawn an add gate and link the forward and back buttons to it.
- Spawn another Add gate and link it to the left and right buttons.
- Spawn a 2 Way Radio and link A to the forward and back Add gate, and B to the Left and Right Add Gate.
- Now for the simple car. Spawn a 4 by 4 from Phoenix models.
- Put 2 wheels on 2 sides that are opposite to each other. Put 1 thruster on the left side on the back and one on the left side on the front. Torque and Power can be adjusted to your needs.
- Spawn 4 Gps's on 4 corners on top of the car.
- Spawn 4 If Than Else Gates, Delta Gates, and Greater Than gates. have one for each Gps.
- Spawn a Thruster on top of each corner.
- Link one Delta Gate to one GPS.
- Link output A of one Greater Than gate to one Delta.
- link output A of one If Than Else gate to one Greater Than gate and output B to the delta gate.
- Link the thrusters to the If Than else Gate associated with it.
- Link the 4 wheels to output A of the 2 Way Radio. Wire the turning thrusters to output B of the 2 Way radio.
Go back to your control panel and control the car. You will notice it won't bounce around as much.