Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Goober5000 on December 10, 2002, 12:22:50 am

Title: Primary Weapons with Ammunition!!!
Post by: Goober5000 on December 10, 2002, 12:22:50 am
For real this time. :cool: I finally worked through all the code, sorted through all the bugs, and implemented ballistic primary weapons. :D

To make your own missions with ballistic primaries, make the following table changes:

Ships.tbl
--Add "ballistic primaries" to the fighter flags
--Add +Pbank Capacity: ( x, ... ) right after $Default Pbanks (in the same vein as for secondaries)

Weapons.tbl
--Add "ballistic" to the weapon flags
--Include $Rearm Rate: x immediately before $Flags (again, just like with secondaries)

Sounds.tbl
--In the Game Sounds section, copy entries 33 and 34 to spaces 165 and 166.  These will be the sounds for when the ballistic primaries rearm.  You may want to change them, or you may want to leave them the same sounds as for secondaries.  (I know, 165 and 166 aren't asthetically the best place to put them, but I wanted to make them conspicuous.  If someone wants to suggest a better location in the Game Sounds section, I'm all ears.)

That's it.  Here (http://www.geocities.com/ipw47/ballisticprimaries.zip) is a link (I tried an attachment, but it didn't work - yeah, I know, GeoCities :rolleyes: ) to the newest SCP build, as well as a sample mission with the required POF and TBL files so you can try it out. :)  Have fun shooting stuff, and press the 1 key to summon some dogfighting opponents.

Please note that the ETS system does not appear on your HUD, nor does the weapon energy gauge.  This is because your ship has neither shields nor weapon energy storage, and there's no point in modifying engine energy when the other two are not present.  I added this functionality because now we have the option of using energy-less primary weapons.  To bring back the ETS display, either enable shields or set Max Weapon Eng to a value greater than zero (or both).  To bring back the weapon energy gauge, just set Max Weapon Eng.

You'll also note that the primary weapon ammunition readouts spill over past the left side of their place in the HUD display.  Obviously, Volition didn't anticipate this SCP addition. :) I'll have to make a new weapon box that'll be shown on a ballistic-primary-enabled ship, big enough for 4 digits of ammo.  I'm thinking kinda like this...

Code: [Select]
        ________________
[WEAPONS]                \
|                        |
|                        |
|------------------------|
|                        |
|                        |
\________________________|


Once I make that (it should only take a short while in the Photoshop lab) I'll be able to implement it pretty quickly, I think.

Next job after this is the distance-from-subsystem SEXP.  Should be a piece of cake after this. :lol:
Title: Primary Weapons with Ammunition!!!
Post by: Bobboau on December 10, 2002, 12:37:14 am
if you figure out the hud,
there are a few things I'd like to do

this looks prety good, I am sure there are quite a few peole that will be made very happy by this
Title: Primary Weapons with Ammunition!!!
Post by: WMCoolmon on December 10, 2002, 12:40:21 am
Temporary alternate download site (http://members.cox.net/~wmcoolmon/ballisticprimaries.zip)

:yes: :yes: I imagine the TVWP and AP teams will find this useful, just to name a couple.
Title: Primary Weapons with Ammunition!!!
Post by: Goober5000 on December 10, 2002, 12:45:33 am
Ooh, thanks for the mirror. :yes:

I'm eager to see what will come of this - imagine, a training mission where they introduce lasers and the ETS as "brand new technology". ;7
Title: Primary Weapons with Ammunition!!!
Post by: Inquisitor on December 10, 2002, 07:47:34 am
Goober: Since youare taking a more active role on the team, I canget you the FTP stuff so you can upload things to the warpcore site.
Title: Primary Weapons with Ammunition!!!
Post by: Goober5000 on December 10, 2002, 11:50:25 am
That'll be cool; thanks.  What things do you have in mind?
Title: Primary Weapons with Ammunition!!!
Post by: Inquisitor on December 10, 2002, 12:26:47 pm
Thing like built exes :)
Title: Primary Weapons with Ammunition!!!
Post by: Sesquipedalian on December 10, 2002, 01:38:28 pm
Good job, Goober!

Questions:

1) If we are copying entries 33 and 34, why not just code it to reference entries 33 and 34 in the first place???

2) Can we have weapons that use both energy and ammo?  The Maxim is what I particularly have in mind here, as it should always have been an ammuntion based weapon, but since it has always used energy I wouldn't want to change that, or it would throw off gameplay (as opposed to nicely enhancing it).
Title: Primary Weapons with Ammunition!!!
Post by: Goober5000 on December 10, 2002, 02:04:30 pm
Quote
Originally posted by Inquisitor
Thing like built exes :)


Aha.  Good thinking. :)

Quote
Originally posted by Sesquipedalian
Good job, Goober!


Thanks. :)

Quote
Questions:

1) If we are copying entries 33 and 34, why not just code it to reference entries 33 and 34 in the first place???


Because someone may want to use a different sound for loading ballistic primaries.  Think of the sound a magazine makes when it's loaded - something like that.  By making ballistic primaries and conventional secondaries reference two different rearming sound sets, they will be able to sound different.  If people don't want the sounds to be different, they can simply copy the existing sound entries.

Quote
2) Can we have weapons that use both energy and ammo?  The Maxim is what I particularly have in mind here, as it should always have been an ammuntion based weapon, but since it has always used energy I wouldn't want to change that, or it would throw off gameplay (as opposed to nicely enhancing it).


Absolutely.  All primaries can still consume energy.  I even left a comment in the code saying that people may want to have ballistic primaries consume energy in addition to ammo - say, to simulate overheating if you fire it too rapidly.


Note to everyone on the subject of ammunition: Since machine guns and other primary weapons are conceptually different from missiles, here is what I had in mind for keeping track of ammo.  Set the Pbank Capacity for ballistic-enabled fighters to ( 1 ), or ( 1, 1 ).  Then set the primary weapon cargo size to the reciprocal of its total capacity.  In other words, if you need it to have 2000 rounds, set the size to .0005.

This puts the onus on the weapon designer for determination of ammo capacity, as opposed to the ship designer.  By having every ship have a Pbank Capacity of 1, you enforce consistency.  All ballistic primary weapons will come with a predetermined number of rounds (notice that the tech description of the M-72 says "Standard Issue - 2000 Rounds").  So you can have 10-round bazookas or 8000-round machine guns.

I was going to hard-code it this way, but I thought I'd leave it flexible so that modders could make their own judgement calls.  Thoughts?
Title: Primary Weapons with Ammunition!!!
Post by: ZylonBane on December 10, 2002, 02:55:29 pm
Why do you keep using the word "ballistic" to describe this modification? In weapons terminology (http://college.hmco.com/history/readerscomp/mil/html/ml_005400_ballisticwea.htm), ballistic just means "a projectile whose point of impact is determined by the direction and velocity with which it is launched". So FS2's primary weapons are already ballistic.
Title: Primary Weapons with Ammunition!!!
Post by: Goober5000 on December 10, 2002, 03:07:19 pm
Because projectiles have mass, and existing FS2 primaries are energy based.

From your link:
Quote
Examples of ballistic projectiles include sling stones, arrows, and thrown spears in antiquity, and cannon balls, rifle and machine-gun bullets, and conventional artillery shells in modern times.

Do you suggest an alternative term?
Title: Primary Weapons with Ammunition!!!
Post by: diamondgeezer on December 10, 2002, 03:11:56 pm
Course he doesn't. He's ZylonBane. He's here to ***** and whine, and he does a damn good job of it to.

Go Zylon!
Title: Primary Weapons with Ammunition!!!
Post by: Fetty on December 10, 2002, 03:28:29 pm
as far as i know ballistics also have to do with the projectile "riding" the air and gravity or something (never pay much attention to physics im affraid :nervous: )



erm dunno call it massdriver :) or "thing that goes bum very rapid"
Title: Primary Weapons with Ammunition!!!
Post by: Inquisitor on December 10, 2002, 05:59:49 pm
Ballistics is fine.

A projectile is a solid object. Solid objects have mass. Ballistics is the study of projectile motion.

;)

Come on, you people are all supposed to be budding physics afficianodos ;)

Make it really cool, and have them be affected by gravity :)
Title: Primary Weapons with Ammunition!!!
Post by: ZylonBane on December 10, 2002, 06:14:38 pm
Quote
Originally posted by Goober5000
Because projectiles have mass, and existing FS2 primaries are energy based.
Completely irrelevant. "Ballistic" refers to trajectory (specifically, an unpowered trajectory), not whether or not something has mass.

Don't see why this source code mod has to have a catchy name anyway. "Primaries use ammo" seems more than sufficient. But if you're going to just make up a meaning for an existing and well-defined word, why not go with something more snazzy, like "Nanotech Primaries" or "Electric Dance Boogaloo Primaries"?  :p
Title: Primary Weapons with Ammunition!!!
Post by: Goober5000 on December 10, 2002, 06:34:22 pm
Quote
Originally posted by ZylonBane
Completely irrelevant. "Ballistic" refers to trajectory (specifically, an unpowered trajectory), not whether or not something has mass.


Your "ballistic" definition (from a book on ammunition) cited all kinds of things that had mass.

Quote
Don't see why this source code mod has to have a catchy name anyway. "Primaries use ammo" seems more than sufficient. But if you're going to just make up a meaning for an existing and well-defined word, why not go with something more snazzy, like "Nanotech Primaries" or "Electric Dance Boogaloo Primaries"?  :p


:wtf: Trolling is Z-26 STUPAD... :wtf:

This thread is called "Primary Weapons with Ammunition".  Ballistics is just a term I decided to use to enforce consistency.  It's concise, descriptive, and doesn't cause confusion with secondary weapons (whereas "ammo" might).

Just go with what Inquisitor said. :)
Title: Primary Weapons with Ammunition!!!
Post by: Bobboau on December 10, 2002, 07:47:43 pm
Quote
Note to everyone on the subject of ammunition: Since machine guns and other primary weapons are conceptually different from missiles, here is what I had in mind for keeping track of ammo. Set the Pbank Capacity for ballistic-enabled fighters to ( 1 ), or ( 1, 1 ). Then set the primary weapon cargo size to the reciprocal of its total capacity. In other words, if you need it to have 2000 rounds, set the size to .0005.

This puts the onus on the weapon designer for determination of ammo capacity, as opposed to the ship designer. By having every ship have a Pbank Capacity of 1, you enforce consistency. All ballistic primary weapons will come with a predetermined number of rounds (notice that the tech description of the M-72 says "Standard Issue - 2000 Rounds"). So you can have 10-round bazookas or 8000-round machine guns.
quote]

why in the name of hades whould you want to do it like that, balencing would be better for ships if you could vary the amount of ammo they could store, it's like saying all ships should have the same secondary storage, it is obvious that some ships would have more storage than others. (wich is why you left us with the flexability to do it the way we see fit ;) )
could there be some sort of trade off for not useing the extra storage (not useing these types of weapons) like more weapon energy, maybe a per bank energy bonus that if that bank doesn't use "balistic" ( :D ) weapons it has the bonus added to the energy reserves
Title: Primary Weapons with Ammunition!!!
Post by: Goober5000 on December 10, 2002, 08:09:33 pm
Quote
Originally posted by Bobboau
why would you want to do it like that, balancing would be better for ships if you could vary the amount of ammo they could store, it's like saying all ships should have the same secondary storage, it is obvious that some ships would have more storage than others. (which is why you left us with the flexibility to do it the way we see fit ;))


Because it's intrinsic to the weapon itself how much ammo to carry.  Say a rifle magazine holds nine bullets (I don't know, I'm guessing. ;))  If you mount a rifle on your Jeep, it's going to carry nine bullets, no matter how big your Jeep is.  If you want more ammo, you'll have to reload it with another nine-bullet magazine.  If you want to fire more bullets before reloading, you'll have to put a second rifle on your Jeep.  It's a weird analogy, but do you see what I'm saying?  Yeah, I left it flexible because I figured not everyone would want to do it that way, but I think it makes so much more sense for primaries to do it like that.

Quote
could there be some sort of trade off for not using the extra storage (not using these types of weapons) like more weapon energy, maybe a per bank energy bonus that if that bank doesn't use "ballistic" (:D) weapons it has the bonus added to the energy reserves


Eh, you'd need a particle accelerator to convert mass into energy, which would be far too much to put on a single fighter. ;)
Title: Primary Weapons with Ammunition!!!
Post by: ZylonBane on December 10, 2002, 08:46:19 pm
Quote
Originally posted by Goober5000
Your "ballistic" definition (from a book on ammunition) cited all kinds of things that had mass.
Hello, McFly? Helllooo??? Energy-based non-beam weapons haven't been invented yet. Of course a book on real-world ammo is only going to cite examples with mass.

Where did you get the notion that mass made a difference to the definition anyway? A ballistic trajectory is a ballistic trajectory, no matter what the projectile. Anyway, FS2 primaries DO have mass. If they didn't, they'd travel at lightspeed.

Oh and BTW--

Quote
Because it's intrinsic to the weapon itself how much ammo to carry.
Well... no. In the real world, aircraft guns are mated with ammunition systems of widely varying capacities and delivery rates (as someone who spent 2 years as a weapons loader for the USAF, you might want to trust me on this one).
Title: Primary Weapons with Ammunition!!!
Post by: Goober5000 on December 10, 2002, 08:57:09 pm
Quote
Originally posted by ZylonBane
Energy-based non-beam weapons haven't been invented yet. Of course a book on real-world ammo is only going to cite examples with mass.


:lol: Yeah, but then also they haven't decided whether or not to extend the definition.

Quote
Anyway, FS2 primaries DO have mass. If they didn't, they'd travel at lightspeed.


Hmm... can't argue with that. :)

Quote
In the real world, aircraft guns are mated with ammunition systems of widely varying capacities and delivery rates (as someone who spent 2 years as a weapons loader for the USAF, you might want to trust me on this one).


But doesn't that have more to do with the weapon module, as opposed to the fighter itself?  I.e., the weapon can be mounted on different aircraft regardless of the aircraft's size.
Title: Primary Weapons with Ammunition!!!
Post by: ZylonBane on December 10, 2002, 09:30:03 pm
Quote
Originally posted by Goober5000
But doesn't that have more to do with the weapon module, as opposed to the fighter itself?
Nope.

Let's take the venerable M61 A1 Vulcan cannon. This gun has been used in numerous (http://www.wpafb.af.mil/museum/arm/arm8.htm) US jets, including the F-18, F-15, and F-16. Here's the relevant bit from f-16.net (http://www.f-16.net/reference/armament/m61a1.html)--
Quote
In the F-16 and some other installations (M61A1 installations are tailor-made to each aircraft type)...

So the F-16 carries 500 rounds, the F-15C 940 rounds, F-18 412 rounds, and so on.
Title: Primary Weapons with Ammunition!!!
Post by: Goober5000 on December 10, 2002, 09:45:54 pm
Mmm...interesting.  Okay, I concede your point. :)
Title: Primary Weapons with Ammunition!!!
Post by: HotSnoJ on December 11, 2002, 05:26:08 am
Quote
F-16 carries 500 rounds


WWII fighters carried more then that...I know one kind did at least.
Title: Primary Weapons with Ammunition!!!
Post by: ZylonBane on December 11, 2002, 10:27:45 am
But on the other hand, we know that weapons in FS are insanely modularized, to the point where pilots can pick and choose which fricken' guns are installed in their fighters only a short while before the things actually launch.

So, y'know, it could go either way.  :nervous:
Title: Primary Weapons with Ammunition!!!
Post by: Goober5000 on December 11, 2002, 11:21:02 am
Quote
Originally posted by ZylonBane
But on the other hand, we know that weapons in FS are insanely modularized, to the point where pilots can pick and choose which fricken' guns are installed in their fighters only a short while before the things actually launch.

So, y'know, it could go either way.  :nervous:


What the - you're not supposed to change your mind after winning the argument! :lol: :lol: :lol:

That was my original thought. :) Since they're modularized, the primary weapon ammo capacity is determined more by the weapon itself than the ship.
Title: Primary Weapons with Ammunition!!!
Post by: Bobboau on December 11, 2002, 12:38:03 pm
yes but if things are modularized could it not go down to the ammo modules them slves, were you have a diferent ammo module for each fighter.

and if you don't use a ammo gun then there is more space for added capasitors, wich would mean more weapon energy ;7
Title: Primary Weapons with Ammunition!!!
Post by: ZylonBane on December 11, 2002, 01:11:28 pm
I guess at a certain point you realize that the way FS handles certain things is just plain silly. In the real world, squadrons are composed of ONE aircraft type. Period. Try to imagine a scene from a present-day movie--

"Okay, I'll be flying an F-15. Goose, you and Ice-Man are in B-17s. Deadmeat, you're in a Mirage. Beta wing will be Harriers. Delta wing will be crop dusters. Gamma wing will be Sopwith Camels."
Title: Primary Weapons with Ammunition!!!
Post by: EdrickV on December 14, 2002, 05:36:47 am
FYI, a little info on what exactly ballistic means.

Main Entry: bal·lis·tic
Pronunciation: b&-'lis-tik
Function: adjective
Etymology: Latin ballista
Date: circa 1775
1 : of or relating to ballistics or to a body in motion according to the laws of ballistics
2 : suddenly and extremely upset or angry : WILD — usually used with go
- bal·lis·ti·cal·ly /-ti-k(&-)lE/ adverb
Title: Primary Weapons with Ammunition!!!
Post by: Solatar on December 15, 2002, 01:39:55 pm
Well, ballistic sounds better than "non-laser".
Title: Primary Weapons with Ammunition!!!
Post by: ZylonBane on December 16, 2002, 05:45:50 am
None of the existing FS2 fighter weapons are lasers.
Title: Primary Weapons with Ammunition!!!
Post by: Bobboau on December 16, 2002, 05:54:36 am
well ya, there actualy a colection of lit pixels in a computer screen representing two or four triangles with an addative alpha blended transparency mask, meant to resemplep pulse weapons.

laser is the termonology used in all the code and tables, though it would probly be more acrurate to describe them as plasma weapons or just pulse weapons.
Title: Primary Weapons with Ammunition!!!
Post by: Goober5000 on December 16, 2002, 05:56:06 am
Even the ballistic primaries use the flag "WF_LASER" in the Source Code. :) WF_LASER means primary, and WF_MISSILE means secondary - it's just how they did it.
Title: Primary Weapons with Ammunition!!!
Post by: Petrarch of the VBB on December 16, 2002, 06:41:44 am
This could be useful to we tappers, for the Mass Drivers is the ships.
Title: Primary Weapons with Ammunition!!!
Post by: Inquisitor on December 16, 2002, 07:57:40 am
The semantics discussion fascinating and all, but can we move on from it. As Bobboau pointed out, it IS fiction ;)
Title: Primary Weapons with Ammunition!!!
Post by: elorran on December 16, 2002, 09:54:18 am
Regardless of wether primary ammo counts would be good or not, they would be useful to some people and the additional feature would actually be used by some.  We could also use it in a simple rework of the original FS2 campaign to rebalance the game and change the maxim into a munitions based weapon rather than using energy.
Title: Primary Weapons with Ammunition!!!
Post by: Eishtmo on December 16, 2002, 11:07:07 am
Question:  Can you reload these weapons?  Call in a support ship and get a reload just like for missiles.  Probably a reduntant question, but an important one.
Title: Primary Weapons with Ammunition!!!
Post by: Petrarch of the VBB on December 16, 2002, 01:17:40 pm
It would be safe to assume so, as goober talks of the rearm rate flag in the tbl.
Title: Primary Weapons with Ammunition!!!
Post by: Goober5000 on December 16, 2002, 03:27:14 pm
Yes, you can. :nod:

*777 posts!*