3D tracking turret
From GMod Wiki
This page has been nominated for deletion. Deletion is due within approximately 30 days from nomination, unless the deletion has been disputed on the talk page. See more pages nominated for deletion here. Reason for deletion: Not what Garry wants the wiki to be used for Last Edit was made on 11/16/2011 |
Contents |
3D Tracking turret
3D tracking turret: 3D Tracking turret |
Description: | A 3D tracking turret made by swij |
Original Author: | Swij |
Created: | 19 Nov 2008 |
Notes: | - |
Intro
Okay, in this tutorial i will teach you how to make a 3D tracking turret. This turret will be able to aim Up/Down and Left/right, it can be set to track anything from RPG's and Npc's to vehicles.
Here's a thread to post on for help
This is how it will look when it's done!
Creating it
1) First create a wire wheel on the ground.
Model: Oil drum Torque: 8000 Friction: 10
2) Create another wheel on the side of the oil drum wheel
Model: Car wheel torque: 2500 Friction: 2
3) Spawn a Beacon sensor on the bottom of one of the polygons on the wheel and spawn a wire Turret just above the Beacon sensor. settings: check the split X,Y,Z
4) Spawn a target finder on the ground, you can insert any settings you want.
5) Link the beacon sensor to the target finder by right clicking on the beacon sensor with the beacon sensor tool and then left clicking on the target finder.
6) Choose your physical properties tool (under the "Tools" tab) Set the material to ice and uncheck the gravity box
7) Apply physical properties to all of the parts on the turret
8) Now create 2 arithmetic - sign gates on the ground, Do not put any gate or target finder on the turret because that will make it spass and not working correctly
9) Create 2 Comparison - is in range exclusive gates on the ground
10) Name one of the sign gates to First with the namer tool and name the other one to second. do the same thing with the two in range gates.
11) Create a Logic - And (all) gate on the ground
12) Create a Constant value with 2 values value 1 to 90 value 2 to -90
Wiring it
13) Now for the wiring, Wire the first sign gate's A to the beacon sensors X input.
14) Wire the Second sign gate's A to the beacon sensors Y input.
15) Wire the Oil drum wheel's output Go to the first sign gate
16) Wire the Car wheel's output Go to the second sign gate
17) Wire the first in range gate's MIN to constant value of -90 and wire the MAX to constant value of 90
18) Do the same thing to the second in range gate
19) Wire the first in range gate's value to the beacon sensor X input
20) Wire the second in range gate's value to the beacon sensors Y input
21) Wire the And (all) gate's A to the target finder's output: 1 and the B to the first in range gate. and the C to the second in range gate.
22) Wire your turret's Fire to the and (all) gate.
23) now your ready and your turret should find the closest target and shoot at it.
Pictures
Modifications
If you would like to aim the turret with your mouse instead of it aiming by itself you could:
1) Create a airboat seat.
2) Apply the same physical properties as before
3) Easy weld it to the side of the car wheel so it you can see where the turret aims
4) Create a advanced pod controller on the ground and link it to the seat by right clicking on the pod controller and then right clicking on the seat
5) Remove the target finder
6) Take the Beacon sensor tool and link the beacon sensor to the pod controller
7) Wire the pod controller's crosshair output to the pod controller's active input
8) Now wire the turrets fire output to the pod controller's mouse1 input
9) Now you can aim the turret with your mouse and shoot with your left mouse button
Help
If you got any questions about the turret just PM me or add me on steam, My steam name is Swij and my hotmail is [email protected]
Credits
Credits:
Swij - Creating and writing this Tutorial
Borafor - Giving me some ideas.
tedeology - Finding bugs
Jolt - Being a victim of the turret
Made by:Swij 22:10, 20 November 2008 (GMT-1)