Automatic Ballistic Artillery Cannon

From GMod Wiki

Jump to: navigation, search
Deletion.pngThis 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

This tutorial is kinda obsolete since we now have the expression gate to calculate this stuff.

This guide will show you how to build an artillery cannon that automatically targets NPC's (or humans if you want to), calculates the correct angle & azimut and shells them to death by launching grenades in a ballistic trajectory. That means you can put this baby into a fortified base and it will shoot over the walls to anyone coming near! Max (accurate) range is about 4000 feet with the standard version, and 6000 feet with the modified cannon stool. The cannon is designed to work on a flat surface, but it turns out it also hits targets who are higher or lower than the cannon. This piece of artillery is not very well suited for hitting moving targets, since the projectiles are airborne for a few seconds, but moving targets are not the point of artillery :)

Ballistic artillery cannon5.jpg

Credits go to Malawar for building the great cannon Stool and to Pariah for the original idea and the mathematical formula [ Theta = (1/2) * Asin((g*d)/(v^2)) ].

I drew these diagrams by heart, so it's possible there are errors in them. So if you find errors or if you have any suggestions: do not hesitate to mail me

Contents

Step 0: preparation

For this contraption you will need:

  1. Gmod 10 of course
  2. Wiremod (preferably the latest SVN release)
  3. Preferably the wiremod model pack
  4. Malawar's cannon or My modified version that shoots further
  5. The PhX Model pack Part 1 and Part 2
  6. I also find the autosnap addon very handy to pick the exact center of stuff etc
  7. I made savegames for the normal version and for the super-cannon version, but they are broken since the last Gmod update...

Step 1: general

  1. I advise you to build this in single player the first time, and put godmode and notarget on, so you can test the strikes more safely.
  2. I also advise to use a flat map (flatgrass is the best I think), to keep things simple
  3. Spawn two large PhX plates. You'll build the cannon on the first one, and the control panel on the second one.

Step 2: build the cannon's physical parts

  1. Freeze the first PhX plate with your physgun, so it won't move.
  2. Spawn a large metal disk from the PhX construction menu.
  3. Select the axis tool (Friction 1000, no collide on)
  4. Attach the large disc to the center of the plate, using the axis tool. Make sure the axis is in the center of the disk too.
  5. Weld some kind of small vertical wall a little of center on the plate (check the screenshots for details) 3 Spawn a 2-by-1-squares PhX plate
  6. Select the axis tool (same settings, except NO friction this time!) and attach the new plate with the top of a long side to the bottom of the wall on your disk.
  7. Spawn a long PhX beam (Under train parts I think) and attach the end of it below on the other side of the wall on your disk
  8. Select Malawar's cannon and select the Heavy Mortar (or the Super Mortar if you are using my modified version for long distances) Select the numpad key 0 to fire the cannon.
  9. Spawn the cannon on the 2x1 plate you just attached to the little wall on your disk. I advise you to attach in in the exact center of the upper square.

Step 3: add the wiring to the cannon

  1. Spawn a 2-way radio (I advise to use the Network Card model) somewhere on your plate where it is out of the way.
  2. Spawn a WIRED hoverball (speed 0.01, strength 10, air resistance 0) on the upper edge of the 2x1 plate (above the cannon)
  3. Spawn a bidirectional WIRED thruster at the end of the lever beam (Thrust multiplier 4000, max thrust 4000)
  4. Spawn a beacon sensor in front of the tilting 2x1 platform (Don't split X,Y,Z. Make sure it outputs distance and bearing)
  5. Spawn a gyroscope somewhere on the tilting 2x1 platform
  6. Wire the components together using this diagram:

Cannon wiring.jpg

(When you want the cannon to tilt faster, you should make the hoverball speed 0.02 or something like that. But beware: the higher you set this, the more it will shake!)

Step 4: build & wire the control panel

  1. Freeze the first PhX plate with your physgun, so it won't move during the building.
  2. All the rest is basically some wiring so just build the following diagram on it:
  3. Important: make sure the Target Finder is set to detect NPC's and Not humans if you don't want to become a target yourself. I also use the paint target option, and set a range of 6000 feet or more. Don't let it target hoverballs or thrusters, or the device will attack itself! I use a negate gate to make one comparison output a negative value, so the hoverball would go down when it is true. The sum is used instead of AND (all) because that would only give positive values.

Control panel wiring.jpg

The autofire function is pretty primitive at the moment: it will start firing when the gun is rotated right, but it doesn't take the angle into account. So keep in mind that often the cannon's first rounds will land in front or behind the target until the angle is adjusted.

Step 5: finish it

  1. Link the beacon sensor to the target finder. (Do this with the beacon sensor tool, using your alt-fire)
  2. Link the two 2-way radio's together (Do this using the 2-way radio tool, using your alt-fire)
  3. Switch on the device with the general on/off switch
  4. Switch on the auto-firing if you want
  5. Spawn an NPC somewhere within reach and watch it die! :) I Advise you to use Antlion guards, since they are big and tough.

Optional Step 6: debug it

It could be that for some reason stuff isn't working as expected. I indicated on my control panel diagram which parts are for which purpose. Double check your wiring there.

Screenshots

Ballistic artillery cannon1.jpg

Ballistic artillery cannon2.jpg

Ballistic artillery cannon3.jpg

Ballistic artillery cannon4.jpg

Ballistic artillery cannon6.jpg

Ballistic artillery cannon7.jpg

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox