Profile image

[Tutorial] My* Method for Colored Ejected Brass/Tank Round Casing -- With one part and NO Machineguns

4,287 Formula350  3.1 years ago

DISCLAIMER* I say "My", out of ignorance of knowing whether this SPECIFIC way has been done before!

If it has been, I in no way claim to be the creator, only that I came up with it completely out of my own necessity for something that looked/behaved better than using the Machinegun bullets.


[This was originally going to be a comment on a build by @JuanNotAnAlt but concluded it was a bit lengthy and better suited as a forum post; context, his tank cannon autoloader system]

I've seen people use normal Machingun/Miniguns to simulate the mass brass ejecta to match the firing rate of their primary guns, but I had some issues with that.
(1) They have no Bullet Tracer or Bullet Color settings to change (that I could find), so you're forced to deal with those damn long tracer trails even when your ejecta is slow moving.
(2) They disappear upon contact with anything (ie the ground).
(3) They can only travel in a straight line.

Whereas what I've* come up with is a nice, big (modeled) object with optionally no tracer and you can color, will persist after ground contact, and... best of all in my opinion... it obeys physics! Meaning it can travel in an arc thanks to gravity, or be swept away by fast moving air :D

I figured this all out and implemented it into a previous build I had done, should anyone want to see it in action. Just arm the two cannons as per that plane's instructions (ideally, just shoot it while on the runway).


THE SETUP:

Remember, this is a single-part system, so all the steps pertain to the newly placed Cannon from the step below. This is all intended to be performed after you've place a Cannon already, so that this one's PartID is numerically higher, as I think[?] that determines which gun fires first.
_(There is no specific 'order' you have to perform this in after you add the Cannon in step 1

NOTE: In the below text, theseType are XML settings, use Overload to change them. Whereas "These Type" are Part Settings that you change through the menu (the Gear button).

-- Grab a "Cannon" from the Weapons menu
-- Set the "Caliber" to a size suitable for your project; ideally something a little bigger than your main gun's actual caliber.
-- Change its Base and Barrel length sliders to minimum (50%)
-- Change its Barrel Recoil and Recoil Force to 0% [Optional: Disable the "Muzzle Brake" to help with potential clipping while hiding it.]
-- Change its scale super-low so it isn't as obtrusive (but not so small that you can't see/find/click it later)
-- Set disableAircraftCollisions to True [Extra Important]
-- Make the projectileType as Basic [Extra Important]
-- Change its projectileVelocity to a *negative * value; say
-- Set the firingDelay, flashScale, volume, impactDamageScalar all to 0
-- Put the projectileLifetime to something you find suitable to the build: quick moving airplane? low, like 5; slow moving tank? moderate, like 20)
-- Paint Trim 3 to a dull silver for steel, or nice deep semi-reflective gold for brass (745700 with 64% Metallic, 50% Smoothness)
-- Then orient this cannon part in the SAME _ direction that your build's functioning gun barrel faces _(I'll explain why in a moment)

Now when you fire the main gun, if you hold the trigger down a micro-second longer, this second cannon fires and... 1-Part-Ejector-System! :D
Which sure, isn't perfectly modeled, but it IS Simple(tm)!


EXPLANATION

So... Why the negative velocity and why you need it pointing in the same direction as the barrel?
Because it shoots the bullet out the back (breach) of the cannon with reverse momentum, while maintaining the forward orientation of the bullet; therefore, preserving some of the realism of a necked-down shell casing! :D

Mind you, the "aim it in the direction of your main gun's barrel" is a quick rule-of-thumb to get you started. From there it matters that you aim it to suit your build.
For example, on Juan's build: for the angled T-72/T-90's ejector, you'll need to orient this "ejector" Cannon's barrel down towards the ground, so the breach is pointing up, allowing it to launch it out at the desired angle.

Same is to be said about the location of the "ejector" Cannon. There's not much reason that it HAS to be at the breach of the "real" Cannon, only unless you intend there to be an inside view where realistically you'd see this happen -- plausibly the case in the tank's autoloader.

BUT if you do need it located a distance away from where it'll 'exit' your build then you'll want to make sure to change the projectileVelocity to account for that distance, AND the angle it's lobbing it at. Just remember, we're dealing with negative velocity, so a "lower" value is faster in this case.
--Sticking with the Tank example: If you start with -5, then a value of 0 is standing still, 3 is traveling the wrong way out the barrel; therefore, -10 may be better.
--If used in a plane, and you feel the ejected round is falling away too fast, that's because you need to consider your plane's forward velocity when flying, and in that case, -5 may be too much and -2.5might work better! In other words,-5` might look perfect while testing it sitting still on the runway, but will be different in the air.

ADDITIONAL INFO:

-- CAVEAT: The main, semi-annoying issue with this system, is the way SP handles the gun firing order. As I mentioned above, I think the PartID -- which is an XML identifier which counts-up for every new part added but does not subtract, and, I also don't think Overload can handle changing (or so my experience seems to have resulted in) -- is what plays a role in which Cannon shoots first, then second, and so on. However, my Cerberus Naval Turret build seems to contradict that thinking, as each 'gun' on the turret actually incorporated like 6 additional cannons, used simply for their added Flash visual (bullet instantly despawns). Sometimes one of the "Flash-only" Cannons will trigger instead of the real (primary, bullet-firing) Cannon, and a follow-up attempt will trigger the right one.... or.... rarely, may skip it and trigger another flash-only, then fire a real one. :\
-- The UNKNOWN: Whether this can be addressed. If it can, whether it's a simple fix or something more involved. Or it could be there's flat out nothing we can do about it, that it could be up to the random number gods, and we have to 'live' with that.
-- The GOOD NEWS: If you only have 1 "real" Cannon, and 1 "Ejector" Cannon, then there's nothing to bounce around between except your gun and the ejector. So while you may get one "dud" at the beginning, the next shot should be from your "real" Cannon. (Granted, you may have missed your opportunity to hit the target by that point, which would suck...)
-- ANOTHER UNKNOWN: Whether or not, in all circumstances, the Ejector's zero firing delay will cause SP to decide and skip the "real" cannon, thereby Ejecting another round. As well as the potential for a loop of this until the "real" Cannon's delay time is up. (However, in my experience, at least with the aforementioned Cerberus turret and its "flash" Cannons, is they wait their turn, but I can't guarantee that outcome for everyone.)


Questions?
Comments?
Something I missed?
Leave it downbelow! :D