Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: gevatter Lars on August 24, 2002, 05:43:26 am

Title: Weapon loadout changeable?
Post by: gevatter Lars on August 24, 2002, 05:43:26 am
I want to ask if its possible to change the weapon loadout so that it is possible to have more then 2 typs of guns and more than 3 types of rockets.

For example I want to have a ship 2 Photoncanons, 2 Mesonblasters and 2 Plasmaguns. Is this possible to make?

I need that for the Wing Commander mod, because some of the Wing Commander ships have more than 2 different guns, or Rockets.

Like the Thunderbold or the Longbow...

If there is a possibility tell me we from the Wing Commander mod could realy use this info.
Title: Weapon loadout changeable?
Post by: Bobboau on August 24, 2002, 05:52:55 am
possible... yes, it is... possible
Title: Weapon loadout changeable?
Post by: gevatter Lars on August 24, 2002, 05:55:22 am
What is needed to be changed? Could you make this for the Wing Commander Mod?
Or even tell us what we have to do.
Title: Weapon loadout changeable?
Post by: Bobboau on August 24, 2002, 06:02:48 am
well it would be quite dificult a lot of stuff, from UI control to in game weapon management there is a lot of code that assumes there are only two primaries and three secondaries,
all of wich we could change, but I don't think anyone has done a lot of work on this sort of thing
Title: Weapon loadout changeable?
Post by: gevatter Lars on August 24, 2002, 06:35:43 am
OK, well then this is my official request for someone to help the Mod and change the source code so that we can have more than two weapon systems.

That would be 4 different guns and 4 different rocket ports.
Title: Weapon loadout changeable?
Post by: penguin on August 24, 2002, 06:59:56 am
To clarify:

You want (up to) 4 primary and 4 seconday banks?

This would require changes to a few things, as Bobboau pointed out:Dunno if any changes would need to be made to any "external" tools like PCS.  FRED would probably need changes though.

This request has been posted before, but that's OK.  One of the big sticking points has been the "double-fire primary" issue.  Currently it works like this, as we all probably know:[list=1]
... and then cycle back up to the top[/list]
The easist way would probably be:[list=1]Discussions have been about how to link arbitrary weapons, but this would be adequate, IMHO.  Too much flight control reworking otherwise.  If you want two weapons to be linked, pick them as primaries 1 and 2...

Sorry if this is a dumb question, but I want to make sure I'm not missreading your post.  It kinda sounds like you want another "type" of bank: primary, secondary and 2 more (tertiary and quaternary?)  This would obviously be a lot more work -- to the point of being unfeasable.
Title: Weapon loadout changeable?
Post by: gevatter Lars on August 24, 2002, 07:24:52 am
Weapon linking
It should be so that you can have primary 1 or 2 or 3 or 4 or all linked together.

others
Loadout screen-> Since the Primarys are fixed in WC that shouldn't be that problem.
Hud-> Have never changed it, but I have seen that its possible.
Player controls->Same as the old one I think.
External->PCS could need a change and FRED dosn't need one if I think, because you have a fixed Primary loadout and this could be set in the TBL files, dosn't it?

Any other questions?
Title: Weapon loadout changeable?
Post by: penguin on August 24, 2002, 07:59:51 am
Oddly enough, looking at the source and at data/Hud/WeaponLoadout-m.PCX (in sparky-fs2.vp), it looks to me like 3 primaries and 4 secondaries are currently supported!  (not just in fs2_open, but in the retail Freespace2).

Someone w/ more modding expertise that I have should try to make a ship w/ 3 primary banks and 4 secondary banks and see if this works....
Title: Weapon loadout changeable?
Post by: gevatter Lars on August 24, 2002, 09:37:58 am
Mh you are right it seems as if you could use 3 prim and 4 sec, but thats only a pic. Has anyone tried to make a ship with 3 prim and 4 sec?

If its possible tell me.
Title: Weapon loadout changeable?
Post by: gevatter Lars on August 24, 2002, 10:08:02 am
Mh good and bad news

Good news is that we don't have to change FRED2 it supports 3 prim and 4 sec banks. click on a ship and set the weapon loud.
Modelview support more banks.
I have just tested a Thunderbold with 3 prim banks. The prog dosn't crash...and here comes the bad news
In the loadout screnn are only 2 prim and  2 sec shown and ingame you also have only the 2 / 2 loadout.

I don't know if this helps you in making a modification to the codes, but I felt I should post it.
Title: Weapon loadout changeable?
Post by: Zarax on August 24, 2002, 10:54:18 am
loadout screen is easy to fix...
just add another box into the model load pcx and it's ok...
Title: Weapon loadout changeable?
Post by: penguin on August 24, 2002, 11:00:17 am
Quote
Originally posted by Zarax
loadout screen is easy to fix...
just add another box into the model load pcx and it's ok...
That would allow the "undocumented" 3Pri/4Sec weapons to work, but to add a 4th primary would require code changes and changes to the *weaponloadout*-M.pcx mask bitmaps.
Title: Weapon loadout changeable?
Post by: Zarax on August 24, 2002, 11:04:03 am
Ouch... aren't 4 primaries a bit too many?
I don't remember any game with 4 different primaries...
They would also fire pretty slow...
Title: Weapon loadout changeable?
Post by: gevatter Lars on August 24, 2002, 01:44:20 pm
Well three are ok.
Look at Wing Commander, there are some "special" weapons, thats why I asked if there could be more, but three will also work very good.
What about the problem that the third gun dosn't fire and you can't select them in the HUD.
Any way to solve that problem?
Title: Weapon loadout changeable?
Post by: penguin on August 24, 2002, 02:21:58 pm
Quote
Originally posted by gevatter Lars
Well three are ok.
Look at Wing Commander, there are some "special" weapons, thats why I asked if there could be more, but three will also work very good.
What about the problem that the third gun dosn't fire and you can't select them in the HUD.
Any way to solve that problem?
I stand corrected:
Code: [Select]
code/ship/ship.h:279:
#define MAX_SHIP_WEAPONS 5
So you might be able to get away (w/ no code changes) with 1p+4s, or 3p+2s.  Anything else will require source code changes, I'm looking into how big an impact...
Title: Weapon loadout changeable?
Post by: Solatar on August 24, 2002, 03:08:04 pm
Wouldn't it be cool to have Primaries, Secondaries, and then a SuperWeapon (i.e.-Nuke, beam, something like that)That would cause massive damage, but only fire once?
Title: Weapon loadout changeable?
Post by: LtNarol on August 24, 2002, 03:12:44 pm
posted many a time before but since i cant seem to find the previous ones here it is again:

My solution to Primary weapon banks linking:

5 buttons involved:

button 1: toggles first bank between "on" and "off"
button 2: toggles second bank between "on" and "off"
button 3: toggles third bank between "on" and "off"
button 4: toggles forth bank between "on" and "off"

button 5: cycles between all 4 banks, selects only bank 1 the first time it is pressed, then the second, then third, then fourth, and on the fifth time it is pressed it links all 4 banks.  Press it a sixth time and it reverts to bank1.

and there we have the NarolSuggestion™ of the day ;)
Title: Weapon loadout changeable?
Post by: Anaz on August 24, 2002, 03:45:25 pm
could use number keys above letter keys for that...
Title: Weapon loadout changeable?
Post by: gevatter Lars on August 24, 2002, 03:50:11 pm
Yup using the numberkeys for selecting and shift or other key to link them.
Like in the older Mechwarrior games...
but back to the topic.
I only need the all or one stuff.
Penguin told me that its more complicatet then he first thought. So it seems as if  I have to wait a little bit longer...
damm it I have to much to do to learn programing, beside the other stuff.
Title: Weapon loadout changeable?
Post by: penguin on August 24, 2002, 04:33:27 pm
Just to post what gevatter Lars and I PM'ed each other about:  The 2pri/3sec is kinda hardcoded in several places in the code -- actually turns
out that MAX_SHIP_WEAPONS is never used...

So adding additional primary & secondary weapons is non-trivial :(  Even though it's apparently in FRED...

Hades: good suggestion re "superweapon," but it would require MASSIVE code changes... there are so many assumptions about having just primary & secondary -- from the HUD all the way to stats...
Title: Weapon loadout changeable?
Post by: Martinus on August 24, 2002, 05:50:30 pm
All primary weapons drain energy (unless you intend to incorporate weapons with physical ammo of course) so why not simply have an on/off switch for each bank and no cycling?

Sure you could fire all banks at once but it would only last for one or two shots overall before you needed a recharge.
Why over-complicate things? It's hard enough to mess with key pressing during heated combat in any case (or at least it is for me).
Title: Weapon loadout changeable?
Post by: Vasudan Admiral on August 24, 2002, 05:58:30 pm
Quote
Originally posted by penguin
Just to post what gevatter Lars and I PM'ed each other about:  The 2pri/3sec is kinda hardcoded in several places in the code -- actually turns
out that MAX_SHIP_WEAPONS is never used...

So adding additional primary & secondary weapons is non-trivial :(  Even though it's apparently in FRED...

ahh. so that's why my attempts didn't work. :nod: (i was trying to add 6 gun slots for turrets :nervous:. would that have the same effect as trying to add primaries?)
Title: More weapons
Post by: Star Dragon on August 24, 2002, 07:31:17 pm
IT would be cool if you guys figure out a way to add more. Till then we just have to make do with what we got. Make more weapons but be more creative on the load-outs (remember mission specific loads?) like in WC. BTW for voice commands 'Strike' is my Alpha Strike MW. IT will fire all weapons but they have to be chosen already and on dual fire. Just allows you to aim while other hand occupied.

This would be so important to the robot mod. Cause you have so many different weapons to choose from. Would a rocket punch be considered a Secondary Weapon cause it is fired like a missile and you need a lock? (unless you choose to dumbfire)...
Title: Weapon loadout changeable?
Post by: WMCoolmon on August 24, 2002, 11:18:18 pm
How about this:
1-4 selects the primary
shift 1-4 adds a primary to the ones currently firing
5 cycles through primaries

6-9 selects a secondary weapon
shift 6-9 toggles doublefire on/off
0 cycles through secondaries

It sounds complex, but seems pretty intuitive to me.
Title: Weapon loadout changeable?
Post by: Anaz on August 24, 2002, 11:25:53 pm
sounds great...I really don't mind the extra keys because I can touch type, so I kinda know where everything is...
Title: Weapon loadout changeable?
Post by: gevatter Lars on August 25, 2002, 12:05:38 am
Dosn't sound so much complicated. I have played games with a quite more difficult key configuration!
Title: Weapon loadout changeable?
Post by: penguin on August 25, 2002, 09:45:28 am
Quote
Originally posted by WMCoolmon
How about this:
1-4 selects the primary
shift 1-4 adds a primary to the ones currently firing
5 cycles through primaries

6-9 selects a secondary weapon
shift 6-9 toggles doublefire on/off
0 cycles through secondaries

It sounds complex, but seems pretty intuitive to me.
It's certainly intuitive if you've played Descent before ;7

We can add these keymaps, but here are my recommendations:We could eliminate the keys you have as 5, 0 and shift+6-9 that way and keep all backward compatibility...  That way we can leave 5 and 0 for your 5th primary and secondary, respectively... as long as we're going to the hassle of adding slots, might as well make it 5 for each ;)

You can always remap the keys in the options config.
Title: Weapon loadout changeable?
Post by: LtNarol on August 25, 2002, 11:05:21 am
number keys are currently used for messaging, shift keys are used for alternate stuff, shift > for example changes the time compression.  I would suggest using the F keys but im not sure which ones are used at this time.  We can still use the < and > keys fro cycling, so all we need is 4 keys for the individual banks.
Title: Weapon loadout changeable?
Post by: gevatter Lars on August 25, 2002, 12:04:20 pm
It has been a long time since I played Freespace so are the F and G key in use?
In Wing Commander you can cycle through the weapons with G and F selects all.
Quite easy to use isn't it?
Beside that I think you should keep the numbers of slots by 3 primary and 4 secondary, because FRED2 supports it and so you don't have to change something in FRED2. Making this modification much easyer, dosn't it?
Title: Weapon loadout changeable?
Post by: Fozzy on August 25, 2002, 01:14:05 pm
Select primarys as normal, but to link them first select the first primary you want then hold down shift. Now select the next primary you want to link. Repeat untill all the primarys you want linked are.

alternatavly to link all primarys press Shift and L
Title: Weapon loadout changeable?
Post by: Galemp on August 25, 2002, 07:10:34 pm
Quote
Originally posted by Vasudan Admiral
ahh. so that's why my attempts didn't work. :nod: (i was trying to add 6 gun slots for turrets :nervous:. would that have the same effect as trying to add primaries?)


Hang on. The Terran Huge Turrets on the Orion have three primary banks... and the SB Seraphim and SB Nahema have 3 primaries and 4 secondary banks. So the code DOES support it, but not for player ships. I don't know how the Shivans manage weapons linking, though.
Title: Weapon loadout changeable?
Post by: Solatar on August 25, 2002, 07:15:27 pm
Do you even notice it when the ai links there weapons (VERY rarely have I thought I've seen them). So if they don't ever link them, you wouldn't notice it.
Title: Weapon loadout changeable?
Post by: Vasudan Admiral on August 26, 2002, 01:10:56 am
Quote
Originally posted by GalacticEmperor


Hang on. The Terran Huge Turrets on the Orion have three primary banks... and the SB Seraphim and SB Nahema have 3 primaries and 4 secondary banks. So the code DOES support it, but not for player ships. I don't know how the Shivans manage weapons linking, though.

it supports it alright. i think it would be much easier just to enable those three for the player for now, as there is probably quite a bit of code that assumes the player has only two weapons. but if the bombers will work with three, it shouldn't be too hard to enable that for the player......would it? :nervous:
Title: Weapon loadout changeable?
Post by: gevatter Lars on August 26, 2002, 06:07:40 pm
I hope its not to difficult, because we could realy use it in the Wing Commander mod we are making. Without it some ships get realy in trouble.
If it dosn't take to much time would someone do it?
I will also make sure that you will get some credits for your work ^__^
Title: Weapon loadout changeable?
Post by: gevatter Lars on September 03, 2002, 03:20:53 am
Is still someone working on this idea for more primarys and secondarys?
Title: Weapon loadout changeable?
Post by: KARMA on September 04, 2002, 06:03:51 am
i don't know if this is something going to be done, in case you are going to build a "new" system heavily modifying the code this is my suggestion for a system that may cover almost any possible situation, not too different from the other solution proposed:

you have n number of primary weapons (that consume energy)
you have n number of secondary weapons (missles)
we have banks and firing points, different banks means different primary weapon, any bank has its own number of firing points(like now)
1 we use a button to cycle between banks
2 we use a button to switch between primary or secondary cycling selection (this is necessary to have only one "bank activation" button instead of two)
3 we use a button to activate/deactivate selected bank
4 (its optional, it just may be useful for the sw-fs2 mod)we use a button to toggle between different way the firing points of selected bank are used (so you have for example 2 firing points for the selected bank, you can choose if having the two firing points linked or if having them firing alternatively one after the other, with a different rate of fire)

number of buttons required: 4 (3)
Title: Weapon loadout changeable?
Post by: gevatter Lars on September 04, 2002, 07:00:32 am
Oh not so complicated, I need just the 4 Prim and 3 sec that are allready supported by FRED2 in FS2 so that I can select them in two ways. All primarys togheter or single. For secondarys just that I can select them.
I don't want anything more than that.
The problem is that I can tell FRED2 to let the fighter have more different primarys then 2, but you can select them ingame, so only 2 primarys are fireing. Thats what should be changed...I hope you undestand what I try to say.

Could someone make this possible?
Title: Weapon loadout changeable?
Post by: KARMA on September 04, 2002, 01:20:31 pm
the point is, whenever someone will put hand deeply on weapon selection, to have a system that will allow almost any combination that won't require further changes to fit other requests
Title: Weapon loadout changeable?
Post by: Sesquipedalian on September 11, 2002, 02:08:34 am
Being someone who brought up this issue before, I'll try to summarise the issues involved (insofar as I understand them):

FS2 (and Fred2, obviously) support up to 3 primaries and 4 secondaries for any fighter or bomber.  However, player-flyable ships can only have 2 primaries and 3 secondaries.  Adding support for 3/4 instead of 2/3 involves changing all code relating to the HUD and player ships generally, as well as altering the HUD images as required to accomodate an extra bank in each section.

No alteration of the AI is required, as it already supports 3/4 weapon configurations.

Weapon control key configurations require coding changes to implement the added primary bank.  The simplest known method is to change the current forward/backward (i.e. ,/.) cycling system to a on/off toggle system as follows:This system makes each bank independent of the other two insofar as its on/off status is concerned.  If the player wishes to use banks 1 and 3 to begin with, he presses , and ; respectively to turn them on.  If he later wishes to use banks 2 and 3, he turns off bank 1 (,) and turns on bank 2 (.).  A cycling system would not be used any longer, since it would be complicated, time-consuming, less intuitive, and ultimately annoying.

The apparent functionality of the secondary weapon key config system would not need to be changed, since only one type of secondary can be selected at a time in FS2.  The only change required would be having the code altered to cause the cycle to include the fourth bank, if present.

Adding support for four primaries would be a much, much, much larger task than for three, as support for that many primaries is not to be found in the engine in any way whatsoever.  Reams of code that I haven't even thought of would have to be ripped out and replaced to do such a thing.

If anyone decides to undertake the coding to allow 3/4 weapons support for player ships, I will be more than willing to collaborate with them in making the new HUD graphics that will be required.
Title: Weapon loadout changeable?
Post by: Bobboau on September 11, 2002, 02:28:12 am
actualy the way FS handels cycling and linking of primaries is that it only has one selected primary bank (0, 1, and 2), unless the ship is flagged that it's primaries are linked, so the togling idea would be more dificult to implement than you sudgest, though over all it would probly be the best system
Title: Weapon loadout changeable?
Post by: gevatter Lars on September 11, 2002, 02:39:01 am
Sesquipedalian  3/4 idea is what we need. Can anyone do this?
Would be great if we have it.
Sesquipedalian could you make the HUD, its a crasy idea of me, but what if only that has to be changed?
Its against every logic, but sometimes such things work.
Title: Weapon loadout changeable?
Post by: Sesquipedalian on September 11, 2002, 02:40:40 am
I didn't know that, bob. :)  By simple, however, I meant simple to use, not simple to implement.  I can only take vague guesses about coding work.

g lars, I can do the images, but I need to work with a coder to make things work.  There are changes that would have to be made to the HUD code for my images to be of any use.
Title: Weapon loadout changeable?
Post by: gevatter Lars on September 11, 2002, 04:56:34 am
I hope that we will find a coder soon, so that we could use this for our Wing Commander mod.