Railgun OXP

From Elite Wiki
Revision as of 11:42, 18 November 2021 by Cholmondely (talk | contribs) (Added more)
Coilgun animation.gif

Introduction

This OXP adds a new class of weapons to the Ooniverse. Railguns fire high velocity kinetic projectiles which are destructive simply by impacting on their target.

Overview

Fauchon-Oliphant Inc., producers of high-powered electrical coils and appliances, proudly present their newest contribution to advanced weapons technology: the Fauchon-Oliphant X-series of precision railguns.

The basic principle of railguns has been known for centuries: a strong electric current sent through a pair of metal rails accelerates a conductive projectile to speeds much higher than achievable by propellants like in missiles. The Fauchon-Oliphant X-series operates with kinetic projectiles: there are no explosives involved, the damage to its target is dealt purely through the kinetic energy of the impact. The lack of explosives makes at the same time the projectiles perfectly safe for storage on a space ship.

Military Railguns

Currently the Fauchon-Oliphant X-series of precision railguns consists of three different varieties: The X-100 Small Railgun, the X-150 Medium Railgun, and the X-200 Heavy Railgun. Their basic difference lies in the different composition of the projectiles. The heavier projectiles yield more destruction on impact, but the gun needs more time and energy to recharge. While the X-100 allows for an almost continuous firing rate of its lighter projectiles, the rate is noticeably slower for the X-150 and the X-200. The prodigious amounts of energy needed to create the electric current means that with all weapons the user should have an eye on their energy banks. As an added safety measure the guns will shut down if there is only one full energy bank left.

Each of the railguns needs its specially manufactured projectiles. These are available in bundles of 100 at your local equipment department of at least techlevel 3. The railguns themselves can be fitted in stores beginning with techlevel 4 for the X-100 Small Railgun.

Fauchon-Oliphant Inc. guarantee the efficacy of all their projectiles up to a certain range, depending on the type of projectile. The guaranteed range for the X-100 Small Railgun is 16 km. Due to their higher projectile density the X-150 Medium Railgun and X-200 Heavy Railgun have guaranteed ranges of 18 and 20 km, respectively. Above their guaranteed range the projectiles tend to dissolve due to the increasing friction with the surrounding phlogiston.

Mining Railguns

For civilian use Fauchon-Oliphant Inc. is also proud to present the new Z-series of mining railguns. Currently this consists of the Z-300 Mining Railgun. While the basic principle is the same as for the X-series, the projectiles of the Z-300 Mining Railgun are much heavier than even the X-200 Heavy Railgun projectiles, and they are fired with a much slower velocity. This—and the enormous energy and time needed for recharging the gun—makes them practically useless as weapons against moving targets, but a very powerful tool for asteroid mining. Two projectiles should be sufficient to crack all but the biggest asteroids, and another one will usually knock a couple of valuable splinters from the resulting boulders.

The higher mass and density of the Z-300 Mining Railgun projectiles made it possible to increase their effective range. Fauchon-Oliphant Inc. therefore guarantees their functionality up to a full scanner range of 25.6 km. The downside of their increased mass is that one bundle only contains 50 projectiles, and is a little more expensive than the bundles for the X-series.

All railguns are mounted close to the front laser of your ship and fire their projectiles strictly forward. They are currently not available for other orientations. All railguns need to be activated first (default key 'SHIFT-N'), before they can be fired (default key 'N'). A message informs the pilot how many projectiles are left in the magazine. When all projectiles have been fired, the gun stops working until the pilot has re-filled the magazine.

Notable features

Railgun.oxp adds four different types of railguns, all of which need to be primed with 'SHIFT-N' first, after which they can be fired with 'N'. Only one railgun can be installed at a time, so if you want to replace your current railgun, you have to sell it first and then buy another one.

The OXP also adds one type of ammunition for each railgun. Only the correct type for your railgun will be offered. You can fill your stock anytime, but cannot carry more than one bundle. Remaining projectiles are discarded. You can check the amount of projectiles currently in your magazine on the manifest screen (F5-F5).

Railgun.oxp also installs a slightly altered interceptAI, replacing Oolite's interceptAI.plist. This was necessary in order to make police ships react to offences committed through railgun firing. It may cause incompatibility with other OXPs which alter interceptAI.plist. As of the release of this OXP, I am not aware of incompatibilities.

Minimum Requirements

Railgun.oxp v 1.3 requires at least Oolite 1.75.2.

Download Location

Railgun.oxp v 1.3 is available for download via box.com. Railgun v1.3.zip a different box.

Installation

Move or copy the file railgun.oxp from its download folder into your AddOns folder. Where that resides depends on your installation. Restart Oolite.

License

  • License: Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License
  • Author: Commander McLane

Tweaking

It's sort of a pain in the neck to spawn the railgun projectile in the right place: right in front of your ship; not too close to be inside the hull; but not too far away to destroy the illusion of being fired from your ship. I tried to come up with a formula that more or less works for most ships. But it fails for ships that are much longer than they are wide and high. In Oolite v. 1.77 scripts will be able to know the exact length of a ship, which will make things much easier.

In the meantime: open the file railgun-firing.js in the Scripts-folder (any text editor will do, but not Windows Notepad) of railgun.oxp and find line 80:

 this.projectile.position = player.ship.position.add(player.ship.heading.multiply(player.ship.collisionRadius + this.projectile.collisionRadius + 1));

Replace that line with this:

this.projectile.position = player.ship.position.add(player.ship.heading.multiply((player.ship.collisionRadius * 0.925) + 15 + 5 + (player.ship.speed / 50)));

If that doesn't work, you can increase one of the numbers (15 or 5) until the problem goes away.

Increase the "15" to a higher value (for instance "20"). Save the file and restart Oolite with "SHIFT" pressed.

If the projectile still explodes immediately, raise the value again. Repeat until you're satisfied.

The formula is: 92.5% of the ship's collision radius (this is the stand-in for the actual ship's length, because that's not known to JS; it's not ideal, because it has to work for both very long and very wide ships; as I said, starting from Oolite 1.77 we can use the actual length of the ship's bounding box, and don't have to guesstimate anymore)

plus 15 meters safety margin
plus another five meters safety margin for the projectile itself
plus some more meters, depending on the ship's current speed

A bit of trial and error shows that the minimum value of the offset needed in a Deep Space Dredger is (23 + 5). Commander McLane et al 2012

Quote

Try this: disable the laser fire button/key, install the [wiki]Railgun_OXP[/wiki] (assign it to the laser fire button/key, if you wish), then go out there and try some real, old-fashioned, dog-fighting. You only get 100 slugs per magazine, which costs money, and every shot eats a little energy! Extremely 'exciting', is that!

There is a knack to using it, though - with practice (and if you're good enough), you can hit a moving target at over 12km.

(Cody (2012))

Links