Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: HotSnoJ on December 10, 2002, 08:09:11 am

Title: seperated SBanks
Post by: HotSnoJ on December 10, 2002, 08:09:11 am
I posted about this when the source code was very new.

[current tbl entry]

$Allowed SBanks:   ( "MX-50" "D-Missile" "Fury" "Interceptor" "Hornet" "Hornet#Weak" "Interceptor#Weak")
$Default SBanks:   ( "MX-50" "MX-50" )
$SBank Capacity:   ( 40, 40 )


[what could be done]

$Allowed SBanks:   ( "MX-50" "D-Missile" "Fury" ) ("Interceptor" "Hornet")
$Default SBanks:   ( "MX-50" ) ( "Hornet" )
$SBank Capacity:   ( 40 ) ( 35 )

In the second SBank only the Interceptor and Hornet are allowed.

do you get this? if not I'll post more.
Title: seperated SBanks
Post by: Sesquipedalian on December 10, 2002, 01:22:03 pm
But why would we want to do such a thing?
Title: seperated SBanks
Post by: Galemp on December 10, 2002, 01:23:14 pm
Interesting. This has possibilities, like the Y-Wing only being able to mount ion cannons on the top and lasers on the main guns.
Title: seperated SBanks
Post by: Joey_21 on December 10, 2002, 01:31:21 pm
How about an option to make this turn on or off if we want? Perhaps with some source tweaking the guys might be able to make it changable in FRED2 and in the mission source there can be something addable (similar to the beam-free-all default option).
Title: seperated SBanks
Post by: Sesquipedalian on December 10, 2002, 01:46:16 pm
Well, the way HotSnoJ has outlined it, it wouldn't be an optional thing.  If we change the table parser to read that way, the old way won't work any more.  Sounds like bad news to me. :no:
Title: seperated SBanks
Post by: HotSnoJ on December 10, 2002, 02:39:56 pm
hehe forgot to add something.

Well if there wasn't a second () set then it would go for both of the weapon banks.

[if there was three SBanks, like on the Ursa]

$Allowed SBanks: ( "MX-50" "D-Missile" "Fury" "Interceptor" "Hornet") ("Bigbomb")
$Default SBanks: ( "MX-50" "Interceptor"  ) ( "Bigbomb" )
$SBank Capacity: ( 40, 35 ) ( 20 )

First two SBanks are in one () set while the last () set is for bombs
Title: seperated SBanks
Post by: WMCoolmon on December 10, 2002, 05:13:07 pm
:yes: Just set the parser to repeat the allowed secondaries if none are specified for other banks. For example:
Quote

$Allowed SBanks: ( "MX-50" "D-Missile" "Fury" ) ("Interceptor" "Hornet")
$Default SBanks: ( "MX-50" ) ( "Hornet" ) ("Fury") ("Interceptor")
$SBank Capacity: ( 40 ) ( 35 ) ( 50 ) ( 20 )

Would have the following allowed:

Secondary bank 1: ( "MX-50" "D-Missile" "Fury" )
Secondary bank 2: ("Interceptor" "Hornet")
Secondary bank 3: ( "MX-50" "D-Missile" "Fury" )
Secondary bank 4: ("Interceptor" "Hornet")
Title: seperated SBanks
Post by: Sesquipedalian on December 10, 2002, 05:38:22 pm
:doubt:
If someone wants to try it, fine.  But it better not break backwards compatibility.
Title: seperated SBanks
Post by: Shrike on December 11, 2002, 11:52:35 am
Quote
Originally posted by Sesquipedalian
But why would we want to do such a thing?
I've always wanted to make ships that carried weapons in specific locations, for example a ship that carries a single very heavy weapon and a set of normal weapons.
Title: seperated SBanks
Post by: Zarax on December 11, 2002, 12:19:20 pm
Good.
This is a feature i've always been looking for...
Now, would be great if it could be done also for primaries...
I'll be really pleased if i could have a fixed 3rd primary with aketons, ala B-wing...
Title: seperated SBanks
Post by: IceFire on December 11, 2002, 01:15:54 pm
Provided that it doesn't prevent us from doing things the other way...this is a great feature.
Title: seperated SBanks
Post by: Inquisitor on December 11, 2002, 01:55:22 pm
That is the philosphy :)
Title: seperated SBanks
Post by: WMCoolmon on December 11, 2002, 05:27:35 pm
Quote
Originally posted by IceFire
Provided that it doesn't prevent us from doing things the other way...this is a great feature.

Does anyone read my posts, or was I just not clear on that? :confused:

What I'm saying if that there are less sections of allowed weapons than there are banks, then the parser repeats the existing allowed weapons for the rest of the SBanks. So if your fighter has four secondary banks, and you entered one group of allowed weapons, all four banks would have the allowed weapons specified in that group. If there were 2 groups, then banks 1 & 3 would use the first group of allowed weapons, and 2 & 4 would use the second group of allowed missiles.

This would imitate how the original tbls handled allowed weapons. The parser, though, would have to check to see which way it was set, which could be a pain :blah:

Perhaps FS2_open TBL files could have a version header at the top to denote what FS2_Open version is required?
Title: seperated SBanks
Post by: Goober5000 on December 11, 2002, 05:44:18 pm
Quote
Originally posted by WMCoolmon
The parser, though, would have to check to see which way it was set, which could be a pain :blah:

Perhaps FS2_open TBL files could have a version header at the top to denote what FS2_Open version is required?


Although it might be a bit of work (I don't think it would be a pain) to have the parser check which way the table entry was set up, it would be well worth it.  User-friendliness is A-1 SUPAR. :)  Version headers aren't necessary, methinks, and everyone is going to want to use the latest version anyway.
Title: seperated SBanks
Post by: Bobboau on December 11, 2002, 11:47:35 pm
I'm gona give this a shot, if you don't give compatability for a bank it will set that bank to what ever the first one was
Title: seperated SBanks
Post by: Bobboau on December 11, 2002, 11:52:28 pm
ok how are we going to handel the load out screen? this needs a totaly new system seing as weapons are given a flag as being used or not for the entire ship
Title: seperated SBanks
Post by: HotSnoJ on December 12, 2002, 05:39:23 am
I was sorta thinking dropdown menus.

Or if it doesn't stay in the slot then it must not be able to go there (that somewhat from a gamers view).

Anyway I thought of a new-er system to support older tables (back compatability).

[ship with three SBanks]

$Allowed SBanks: ( "MX-50" "D-Missile" "Fury" "Interceptor" "Hornet")
        +SBank0: ("Fury" "MX50")   ;;if not set (written) then unwitten bank can hold weapons flaged in "$Allowed SBanks"
        +SBank2: ("Bigbomb")
$Default SBanks: ( "MX-50" "Hornet" "Fury")
        +Sbank1: ("Interceptor")
$SBank Capacity: ( 40 ) ( 35 )


So as you can see the second bank (SBank1, not written) can hold all of the weapons flaged in $Allowed SBanks:, and $Default SBanks: would acst somewhat the same.


BTW Bobboau think you could try this with primarys too?
Title: seperated SBanks
Post by: Goober5000 on December 12, 2002, 12:14:46 pm
It shouldn't need a totally new system.

Simply duplicated the "allowed weapons" array for each bank, and leave the loadout screen as it was before.  If a player tries to drop a weapon on the wrong bank, pop up a message that says "This bank is unable to carry [blank] weaponry."  Should be straightforward.
Title: seperated SBanks
Post by: Sesquipedalian on December 12, 2002, 01:16:39 pm
*Warming to the idea now that it's been thought through a little better*
Title: seperated SBanks
Post by: HotSnoJ on December 12, 2002, 02:35:46 pm
Quote
Originally posted by Goober5000
It shouldn't need a totally new system.

Simply duplicated the "allowed weapons" array for each bank, and leave the loadout screen as it was before.  If a player tries to drop a weapon on the wrong bank, pop up a message that says "This bank is unable to carry [blank] weaponry."  Should be straightforward.


Thats exactly what I was thinking!
Title: seperated SBanks
Post by: Goober5000 on December 13, 2002, 01:51:24 am
Quote
Originally posted by Bobboau
ok how are we going to handel the load out screen? this needs a totaly new system seing as weapons are given a flag as being used or not for the entire ship


I just took a look at the code, and I realized that this will turn into a huge amount of work if the code isn't written carefully.  Done correctly, however, only one or two functions will need changing.

Keep the existing table entries as they are.  Then add a new entry, like HotSnoj said, specifying the allowed weapons for each bank.  Don't modify the existing loadout code (it'll require massive code rewriting); instead, add a new subroutine to check for if a weapon is allowed on a bank.

So the new table entry will read as follows:
$Allowed PBanks:    ( "blah1" "blah2" "blah3" )
+Allowed PBank:  1  ( "blah1" )
+Allowed PBank:  2  ( "blah2" "blah3" )

To the ship_info structure, add
Code: [Select]
int restricted_loadout_flag[MAX_SHIP_WEAPONS]
int allowed_bank_restricted_weapons[MAX_SHIP_WEAPONS]
               [MAX_WEAPON_TYPES]


Inside the ship parser, set restricted_loadout_flag[bank] whenever a "+Allowed PBank: X" or "+Allowed SBank: X" line is encountered.

The loadout screen will only restrict the loadout on a bank if it sees that restricted_loadout is set for that bank.

This way, you can let the existing loadout code handle just about all of the work.  All that needs to be changed (aside from the parser and ship structure) is a little something added to the function drop_weapon_on_slot, saying that this weapon is not allowed if this is the wrong slot.
Title: seperated SBanks
Post by: diamondgeezer on December 13, 2002, 02:15:26 am
Now all we need is to be able to arm a fighter with as many different primaries as we can fit in the weapons table! Booyah!

Probable use for this project - make sure bombers use bombs only in what are blatantly the big bombs bays. The Boanerges, for example, can currently accomodate a single Helios in its small missile bay. This is a bit daft. OK, in this example it's a cosmetic thing more than anything else, but since I'm not the one doing the work... :cool:
Title: seperated SBanks
Post by: Bobboau on December 13, 2002, 03:59:25 am
well I've gotten the ship info stuff loading right, but the mission UI stuff is... complicated :eek2:
Title: Hugs his folder...
Post by: Star Dragon on December 13, 2002, 06:57:11 am
"Don't worry little folder. I'll keep the nasty SCP people from you"... :wink:

   I use almost every weapon made (released of curse) BUT if this system were to implement then I would have to re-edit all the ship tables to allow all weapons again... Is this correct..... FOR EVERY SHIP!... Bad enough I eventually will have to enable them as it is cause each set is programmed with certain weapons anyway..now they HAVE to be in certain places..... I think that primaries on the left and secondaries on the right are good enough.... But that is just my humble opinion...
Title: seperated SBanks
Post by: HotSnoJ on December 13, 2002, 07:06:55 am
Quote
Anyway I thought of a new-er system to support older tables (back compatability).

[ship with three SBanks]

$Allowed SBanks: ( "MX-50" "D-Missile" "Fury" "Interceptor" "Hornet")
+SBank0: ("Fury" "MX50") ;;if not set (written) then unwitten bank can hold weapons flaged in "$Allowed SBanks"
+SBank2: ("Bigbomb")
$Default SBanks: ( "MX-50" "Hornet" "Fury")
+Sbank1: ("Interceptor")
$SBank Capacity: ( 40 ) ( 35 )


So as you can see the second bank (SBank1, not written) can hold all of the weapons flaged in $Allowed SBanks:, and $Default SBanks: would act somewhat the same.


READ IT!
Title: Re: Hugs his folder...
Post by: Bobboau on December 13, 2002, 07:27:00 am
Quote
Originally posted by Star Dragon
"Don't worry little folder. I'll keep the nasty SCP people from you"... :wink:

   I use almost every weapon made (released of curse) BUT if this system were to implement then I would have to re-edit all the ship tables to allow all weapons again... Is this correct..... FOR EVERY SHIP!... Bad enough I eventually will have to enable them as it is cause each set is programmed with certain weapons anyway..now they HAVE to be in certain places..... I think that primaries on the left and secondaries on the right are good enough.... But that is just my humble opinion...


no that is not corect, if the parser doesn't see that you have specificly given a bank custom compatability it will asign that bank the same compatability as the first bank,
meaning that if you don't want this just don't implement it and you won't see any diference,
if you do then there's a bug
you know reading the second half of your mesage, I am realy starting to wonder what you're talking about

I'm starting to get the hang of the weird way this bit of code works, if i get good enough, I'll be able to implement some of the cool things I've wanted to do, like selectable counter measures, and tactical systems (tag, targeting lasers, sessor enhancements, ect...)

on a related note I've nearly gotten it working, in addition to substitutable textures I'm just doing a bit of teasting...
you know why don't I let you test, you should note that the chances of major bugs is high seeing as I have three half done little tested features that are WIP includeing

crap... WV servers are down...
I'll tell you when I have it uploaded
Title: Re: Re: Hugs his folder...
Post by: diamondgeezer on December 13, 2002, 07:31:33 am
Quote
Originally posted by Bobboau
... if i get good enough, I'll be able to implement some of the cool things I've wanted to do, like selectable counter measures, and tactical systems (tag, targeting lasers, sessor enhancements, ect...)


:eek2:

Dear God... my face just had the exact same expression as the eek2 smily for a good ten seconds...
Title: You realize I was just joking...
Post by: Star Dragon on December 13, 2002, 07:56:05 am
I was just reminded of that Mccoy quote, "You know engineers, they just LOVE to change things."

    I fully respect/admire the efforts of the SCP individuals and look forward to us all benefitting from your, improvements.

    BTW side note... If I use the Aurora cannon, it AUTOMATICALLY summons the SSM's if I stay on target too long (Messy for fighters, but GREAT for larger ships!) a REAL 2 FOR 1 WEAPON!

  :nod:
Title: seperated SBanks
Post by: Bobboau on December 13, 2002, 08:27:12 am
my old Aurora cannon, heh, I didn't know anyone ever looked at that old weapon pack :),
do you like the pirate beams ;7

ehh, it shouldn't be calling an SSM strike (in any recent FSO exe) unless the table has been changed, targeting beams now need to be tag 3 and be given a SSM index (yes I do like to change things, but this was for the better), tag 3 missles also now call forth an SSM strike
Title: seperated SBanks
Post by: HotSnoJ on January 07, 2003, 07:01:46 am
has anyone put this in the code? or must I revive it? :drevil:
Title: seperated SBanks
Post by: Bobboau on January 07, 2003, 08:16:38 am
I had some problems and I sort of lost the code, I still have it but there are a lot of bugs (unreleted to this), I can copy my changes once I get some current bugs fixed
Title: seperated SBanks
Post by: IceFire on January 07, 2003, 09:08:07 am
Quote
Originally posted by WMCoolmon

Does anyone read my posts, or was I just not clear on that? :confused:

Just ensuring that there was no confusion.  Not the other way around.  No worries.
Title: seperated SBanks
Post by: HotSnoJ on April 25, 2003, 04:42:17 am
:bump: :D

Long time no checkup! How goes the coding or has it been dropped?

BTW could this be done for primarys too?
Title: seperated SBanks
Post by: Goober5000 on April 25, 2003, 05:14:01 am
It has been done, bugged, and bugfixed.  Haven't you kept track?
Title: seperated SBanks
Post by: redmenace on April 25, 2003, 06:47:18 am
hahaha the one thing we really need though right now is new interfaces to go with the new feature.
Title: seperated SBanks
Post by: Goober5000 on April 25, 2003, 08:47:00 am
:wtf: What new interfaces?
Title: seperated SBanks
Post by: redmenace on April 25, 2003, 09:57:21 am
sorry thinking of bank specific load outs in the load out screen when you select your weapons the areas which you place them in are just silly. They look like they don't belong with the rest of the load out screen.
Title: seperated SBanks
Post by: HotSnoJ on April 26, 2003, 05:10:15 am
Quote
Originally posted by Goober5000
It has been done, bugged, and bugfixed.  Haven't you kept track?


Actully no. I just installed FS2 on my new computer (which doesn't have internet access) and so before I just wasn't all that interested in reading so much for something I couldn't use. But now I'm going to download it.