Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Goober5000 on November 18, 2002, 04:55:19 pm

Title: Primary Weapons with Ammunition
Post by: Goober5000 on November 18, 2002, 04:55:19 pm
Well since I got only one response to the last thread, I started a new one. :) Here is what I am thinking of: Machine Guns.  I know this has been discussed before for primaries (with ammunition that runs out) but I thought that much the same effect could be achieved using secondaries.  If you ignore the in the primary weapon slot, you can pretend that your secondary weapon is a primary.

For the T-V War Project, one of the options that we're floating is that energy-based weapons weren't developed until the begining of the T-V War.  This means that the Unification War will have machine guns and all that cool stuff. :cool:

I posted an attachment of a basic test of what I was thinking of.  It works wonderfully.  Alpha 1 now has a machine gun. :cool:

BUT THE ONLY PROBLEM IS THAT IT DOESN'T WORK FOR AI!!!

Run the mission.  Shoot the cargo.  Shoot the Fenris.  Nice.  Now press 1 to call in an enemy wing.  You can sit there as long as you like, but the AI will never fire its machine gun at you. :mad: :mad: :mad:

I tried hacking around in the table, and if I set the reactor power to 0 and the max gun energy to 0, I can get the AI to fire its machine gun...but only once every several seconds.  This is no fun!  How can I get the AI to lean on the firing trigger?
Title: Primary Weapons with Ammunition
Post by: Solatar on November 18, 2002, 05:01:25 pm
What skill level are you playing on, ai is more agressive at higher skill levels.
Title: Primary Weapons with Ammunition
Post by: Goober5000 on November 18, 2002, 05:11:24 pm
Medium.  But I just tried it on Insane with Generals, and got nearly the same result. :(
Title: Primary Weapons with Ammunition
Post by: Solatar on November 18, 2002, 05:12:57 pm
let me try it on insane with Admirals.
Title: Primary Weapons with Ammunition
Post by: Goober5000 on November 18, 2002, 06:02:14 pm
That's not the point - it shouldn't make any difference what AI level you use.  I need to know why the AI doesn't fire the machine gun in a machine gun fashion.  Can it be hacked by editing the table or editing the mission, or must it require a source code change?

Source code uber-gurus, please post something. :)
Title: Primary Weapons with Ammunition
Post by: EdrickV on November 18, 2002, 06:41:22 pm
I think you'd have to re-write the AI code for something like that, or just use primaries and say the ships have enough ammo that you won't run out in a typical mission. (I know I wouldn't find a mission where you can completely run out of ammo very fun, especially if you have to use the missile button to fire.)
Title: Primary Weapons with Ammunition
Post by: Goober5000 on November 18, 2002, 09:39:08 pm
Okay, here's one for the SCP folks (Bobboau? ;7)...

How much work would it be to convert the primary weapon banks into secondaries?

So the primary slots would allow secondaries, deplete like secondaries, and reload like secondaries.  There could be some sort of flag as to which is used in a particular ship: energy-based primaries or ammunition-based primaries.
Title: Primary Weapons with Ammunition
Post by: aldo_14 on November 19, 2002, 05:46:57 am
How would you link 'powered' and ammo secondaries, though?
Title: Primary Weapons with Ammunition
Post by: Stunaep on November 19, 2002, 05:53:19 am
you could always use the ammo based ones for Alpha 1, and the modified-for-ai ones for AI. It's not like the player's gonna know, if they look identical
Title: Primary Weapons with Ammunition
Post by: Solatar on November 19, 2002, 05:54:18 am
We'd have to make it so that the player couldn't change his wingmen's loadout.

EDIT: In the UW, a wing of fighters containes two fighters. A wing of bombers contains one bomber, and two fighters with orders to cover it.
Title: Primary Weapons with Ammunition
Post by: IceFire on November 19, 2002, 09:19:06 am
I think this is a case where the AI needs a primary weapon to aim.  Had this trouble myself once....with a beam equipped fighter.
Title: Primary Weapons with Ammunition
Post by: Goober5000 on November 19, 2002, 09:56:44 am
I don't think that's the problem.  I tried equipping a fighter with a training laser as well as the machine gun, and it didn't work.  The AI fired the laser like it should, but it only fired one round every second or two.  This despite having 40000 rounds of ammunition and a fire delay of 1/100 sec.

Were you able to fix the beam problem?

aldo: I wouldn't allow a fighter to equip energy and ammunition primaries at the same time.  If I wanted to do that, I'd put two copies of the fighter in ships.tbl...one with the conventional laser primaries, and one with the flag for ammunition primaries.

Only two people have downloaded my original attachment.  Please, download it and try it out.  It consists of just two tables, a POF, and a sample mission, and it should take only a few minutes to load and see what I'm talking about.
Title: Primary Weapons with Ammunition
Post by: EdrickV on November 19, 2002, 12:57:04 pm
Quote
Originally posted by Goober5000
I don't think that's the problem.  I tried equipping a fighter with a training laser as well as the machine gun, and it didn't work.  The AI fired the laser like it should, but it only fired one round every second or two.  This despite having 40000 rounds of ammunition and a fire delay of 1/100 sec.


The game is doing exactly what it is supposed to do. The AI was not designed for using things like a machine gun as a secondary weapon. To the AI, secondary weapons are missiles and bombs. Period. That's how it will treat them. If you want a machine gun, you'll have to make it a primary weapon. And the only difference I can see about a primary weapon with ammo and a primary weapon without ammo is that with the first you could (and I likely would) run out of ammo and then you'd be defenseless.
Title: Primary Weapons with Ammunition
Post by: Goober5000 on November 19, 2002, 01:42:26 pm
It adds another strategic element to the game - conservation of ammunition.  Today's fighter pilots need to deal with limited ammunition.

But there's always the support ship.  And there's nothing stopping someone from giving a fighter a capacity of 40,000 bullets or more.  Look at your per-mission statistics and check how many times you fire your primary during the course of a battle. :)
Title: Primary Weapons with Ammunition
Post by: EdrickV on November 19, 2002, 02:02:28 pm
Having a support ship give you more ammo for a primary weapon would require even more source code changes, and it can be very hard to actually get rearmed in the middle of a mission. (I remember going through 3 or more support ships one time trying to get rearmed in a mission. They kept dying before they even got to me.) And FS2 isn't a strategy game, it's an action game.
Title: Primary Weapons with Ammunition
Post by: Goober5000 on November 19, 2002, 02:09:07 pm
Then no support ships - just give the fighters tons of ammo.

And there is strategy in Freespace.  Some of the most fun missions are those where you have to make strategic decisions at key points.  But it's a matter of taste - if you don't like it, you don't have to play it. :)
Title: Primary Weapons with Ammunition
Post by: diamondgeezer on November 19, 2002, 02:32:41 pm
And let's not forget, a machinegun-with-ammo combination would be handy if a S:AAB TC ever got off the flight deck... ;7
Title: Primary Weapons with Ammunition
Post by: Solatar on November 19, 2002, 02:55:27 pm
You really think a number with more that many digits would fit on the HUD? It would look extremely stupid.

EDIT: We could add something to the weapons table, say
$Ammo:                                    40000 ;; determines the amount
;;of ammunition in a primary weapon. If you want unlimited rounds, don't put in this tag.
Title: Sounds good
Post by: Star Dragon on November 19, 2002, 07:13:09 pm
I DL'ed it and will try it after work... in about 13 hours!!!

Oh and DG. Warlock is still working on SAAB right? long as we can get someone to convert the models we all can keep working "unofficially" on SAAB right? I've gotten bored, lazy, and distracted, but if someone makes some finished POFs available I'll get back to tweaking stuff and doing SAAB voice captures...
Title: Re: Sounds good
Post by: diamondgeezer on November 19, 2002, 08:32:03 pm
Quote
Originally posted by Star Dragon
Warlock is still working on SAAB right?


Er... was he? To be honest, I assumed that anyone who was serious wabout a TC would have told me (since it was my proposal this time around), but I've not heard from him.