3D Tracking Turret for Wiremod

 

2011-07-13_00019
This is a fun little turret that will lock on to whatever you want (players, npcs, rpgs…), and just shoot away as long as they’re in range. Great fun to leave next to the spawn point on public servers. Grief!

 

It’s based on the tutorial below, but updated to reflect changes in the Beacon Sensor’s operation, and some issues a wiremod update caused in placing the wheels on each other.
You shouldn’t need anything extra downloaded for this one, so let’s get cracking…

Step 1 (First wheel):

Spawn a PHX (Props Tab – General Construction) 2×2 base plate, and a 1×1 plate for later.
Freeze your 2×2 plate flat on the ground, and add a the wiremod wheel with the barrel model bang in the middle:
Settings:
Torque 4000
Friction 3
No Collide = yes

 

Step 2 (Second wheel):

The next step is to weld a second barrel to the first. Due to a wiremod update, we can’t add one wheel directly onto another, so weld your 1×1 plate to the side of the first wheel.
Hint: The easiest way to get the second plate onto the barrel is to select the EasyWeld tool, click in the plate center, click near the top of the barrel, and click a third time anywhere.
Once that’s in place, add the second wheel as shown below.
Settings:
Torque 4000
Friction 3
No Collide = yes
Note:
This one doesn’t especially have to be a barrel – a wide enough wheel will work, but run the risk of getting stuck and grinding against the side plate.
That and you can fit way more guns on a barrel…

Step 3 (Adding components to the turret):

Spawn a Beacon Sensor (hula girl) on one side of the 2nd barrel.
Remember to check “Split Output, x,y,z”
Now spawn a turret as close to the Beacon Sensor as possible.
Try placing them as close as possible on the same polygon to ensure they’re aiming in the same direction.
Could be a little tricky first time, but have a wee look at this pic.
Later we can add loads more turrets. Pew pew. But untill then.

Step 4 (Other components):

These components should go on the main base, to make the thing portable.
  • Spawn a Constant Value (Wire I/O – Constant Value) , with 2 values :
    Value1 = -90
    Value2 = 90
  • Spawn 2 “Is in Range (exlcusive)” gates (Wire Control -> Gate – Comparison), also on the base. I.e. one on the left, one on the right.
  • Spawn 2 “Sign (-1,0,1)” gates (Wire-Control -> Gate-Arithmetic). Place one on the left and one on the right again, so we know which is which.
  • Spawn 1 “And (All)” gate (Wire-Control -> Gate-Logic). Place it somewhere in the middle of the other components.
  • Spawn one “Target Finder” (Wire-Beacon -> Target Finder). Place it somewhere on the base.
Note:
It’s possible to rename components, but assuming you remember which is which, and place them carefully, you shouldn’t have to.
Your base should now look something like this.
[PIC]

Step 5: (Physical properties)

Tempting as it would be to wire the whole thing up right now, you should now use the Physical properties tool on anything above the bottom base.
I.e.  Wheel1, the small plate, Wheel2, beacon sensor, and the turret.
Settings:
Type: ice
Gravity Toggle = off
This will stop the weight of the components interfering with the targeting. You might want to freeze the wheels now, before wiring them, to avoid them beginning to spin while you’re wiring. It could get messy otherwise! Use whatever tools you want to color the thing now as well.

Step 6: (Wiring)

You’ll be needing the “Wire (advanced)” tool for this. If you’ve not used it before, it’s fairly straight forward. Point at a component, and use the mouse wheel to select an input then click. Now find the output you want to join it to, click, scroll to the selection, and click again. (Yes, setting the input skips a click, and it’s very annoying.) If you make a mistake at any point, remember you can hit reload (R) while pointing at a compoenent to remove the inputs to it.
  • -wire the Beacon Sensor’s [TARGET] to the Target Finder’s [1] output.
  • -wire the left Is In Range gate’s [Min] input to the Constant Value’s [-90] output.
  • -wire the left Is In Range gate’s [Max] input to the Constant Value’s [90] output.
  • -wire the left Is In Range gate’s [Value] input to the Beacon Sensor’s [X] output.
  • -wire the right Is In Range gate’s [Min] input to the Constant Value’s [-90] output.
  • -wire the right Is In Range gate’s [Max] input to the Constant Value’s [90] output.
  • -wire the right Is In Range gate’s [Value] input to the Beacon Sensor’s [Y] output.
  • -wire the And Gate’s [A] input to the left Range gate’s output.
  • -wire the And Gate’s [B] input to the right Range gate’s output.
  • -wire the And Gate’s [C] input to the Target Finder’s [1] output.
  • -wire the turret’s [Fire] to the And Gate’s output.
  • (turret only fires if we have a target, and are roughly facing it)
  • -wire the left sign gate’s [A] input to the Beacon Sensor’s [X] output.
  • -wire the first wheel’s [GO] to the left sign gate’s output.
  • -wire the right sign gate’s [B] input to the Beacon Sensor’s [Y] output.
  • -wire the second wheel’s [GO] to the right sign gate’s output.
  • -Wire the Beacon Sensor’s [Target] to the Target Finder’s [1] output.

 

It should all look a little messy like the pic now.
Besides looking like the glowing candy from that Santa Clause film, it should be pretty lethal when you unfreeze the top components. Do so.
Well, that’s it. Happy griefing.
Q- Help! My Turret faces the wrong way:
A- Simplest solution – place your gun on the other side. This happens once in a while, and my best guess is it’s something to do with the orientation of the models when they’re created. Once it’s working though, any adv-duped copies should also remain working.
Q- Operation is a little stiff!
A- Try nocolliding the moving parts, checking that stuff isn’t stuck together, and ensure you have unchecked “Gravity Toggle” for the “Material Properties” tool.
Here we are with a few extra gunz. Pew pew.

Leave a Reply

Your email address will not be published. Required fields are marked *