Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: origin on September 03, 2009, 07:58:33 am

Title: Linking primaries
Post by: origin on September 03, 2009, 07:58:33 am
How do you link the primary weapon banks to shoot at the same time?
Title: Re: Linking primaries
Post by: Dragon on September 03, 2009, 08:07:46 am
It was explained in main FS2 (and FS1) training, press "," or "." key twice.
Or any keys you assigned to cycling primaries.
Title: Re: Linking primaries
Post by: Commander Zane on September 03, 2009, 08:27:42 am
*Headdesk*

Someone doesn't play tutorial missions. :doubt:
Title: Re: Linking primaries
Post by: origin on September 03, 2009, 08:34:52 am
My bad - I did not give enough information...

I have a made a fighter with 2 primaries that has 2 guns per primary for a fred designed mission and I want that ship to be able to shoot both of its primaries at once.  It is not the ship that I am flying - it's the bad guys.  I can only get it to shoot one set of primaries at a time - I assume there is some flag or something to do this but I have not been able to find it.

Thanks
Title: Re: Linking primaries
Post by: Akalabeth Angel on September 03, 2009, 08:37:09 am
I would assume that has more to do with the AI behavior than anything else. Someone more familiar with the code may know what's up.
Title: Re: Linking primaries
Post by: The E on September 03, 2009, 08:49:14 am
Yep, that's something defined by the AI behaviour. The AI class may be too low, or the weapons energy usage may be too high for the AI to consider linking weapons a good choice.
Title: Re: Linking primaries
Post by: origin on September 03, 2009, 09:57:41 am
Really?  Hm... pretty smart AI - I make adjustments and see.
Title: Re: Linking primaries
Post by: Stormkeeper on September 03, 2009, 10:19:44 am
You know, if you don't finish training you don't get your wings? I played through FS2 once without getting my wings.
Title: Re: Linking primaries
Post by: Dragon on September 03, 2009, 11:39:44 am
Stormkeeper, read the whole thread before posting.
He wants to force linked primaries on AI ships.
Title: Re: Linking primaries
Post by: origin on September 03, 2009, 11:58:18 am
Yep, that's something defined by the AI behaviour. The AI class may be too low, or the weapons energy usage may be too high for the AI to consider linking weapons a good choice.

I lowered the power consumption for both weapons to just about nothing (0.1) and gradually increased the AI class all the way to General and still no luck - only one bank at a time will fire.  By switch the order of the default primaries between the 2 weapons in the ships.tbm, I am sure that both banks are operational but they just won't fire together.

Any ideas?
Title: Re: Linking primaries
Post by: chief1983 on September 03, 2009, 02:41:45 pm
You should be looking at editing the ai_profiles.tbl (http://www.hard-light.net/wiki/index.php?title=Ai_profiles.tbl).  Depending on the depth of your mod, you may want to make a new profile, and have your missions use that, or you may want to write a tbm and just modify the existing FS2_RETAIL profile.  Either way, you probably want to edit:

$AI Always Links Energy Weapons:
FS2 Open, 3.6.10 or earlier:

    * AI ships will link energy primaries if energy levels are greater than these percents.
    * Syntax: Float list
          o Default: 100, 80, 60, 40, 20


$AI Maybe Links Energy Weapons:
FS2 Open, 3.6.10 or earlier:

    * Defines the same as $AI Always Links Energy Weapons: but in situations when its hull is below 33 % of maximum hitpoints.
    * Syntax: Float list
          o Default: 90, 60, 40, 20, 10

Granted, it sounds like your ships should have already been linking up at least some of the time since they should be at full weapon energy, do you have the game on a higher difficulty as well?  Otherwise they will likely not link up weapons very often.
Title: Re: Linking primaries
Post by: origin on September 03, 2009, 04:17:44 pm
I have been very bad and taken a short cut which is bitting me in the butt....
I like the sounds and of effect of terrians so I have simply been putting terrian as the species for my bad guys and then made them hostile. 

Clearly I should make a new species in a tbm and customize them how I want.  I seem to recall when I tried to do this before I ran into some problem, so took the easy way which has clearly lead me to the dark side.

Thanks for all of the input guys - this should be a relatively (i hope) easy fix and will make the mod more robust to boot.
Title: Re: Linking primaries
Post by: General Battuta on September 03, 2009, 04:39:53 pm
Wait, does species actually matter at all here?
Title: Re: Linking primaries
Post by: The E on September 03, 2009, 04:44:35 pm
Nope. This is purely an AI matter, species-defs.tbl won't do anything here.
Title: Re: Linking primaries
Post by: Droid803 on September 03, 2009, 05:14:09 pm
It's AI Profiles not species defs.
Changing the species defs won't do anything.
Perhaps he read it wrong.
Title: Re: Linking primaries
Post by: chief1983 on September 03, 2009, 05:23:07 pm
Yeah there shouldn't even be anything wrong with hostile terrans.  It's done all the time in retail with the NTF, they should have no problem linking weapons against you.
Title: Re: Linking primaries
Post by: Stormkeeper on September 03, 2009, 06:06:16 pm
Actually, I can't remember the last time I remembered AIs linking weapons against me. My wingmen do it most of the time, but hostile AI doesn't seem to.
Title: Re: Linking primaries
Post by: chief1983 on September 03, 2009, 08:44:58 pm
Then there might be a bug at play here.
Title: Re: Linking primaries
Post by: Stormkeeper on September 03, 2009, 08:45:43 pm
Is there anyway to test this?
Title: Re: Linking primaries
Post by: Commander Zane on September 03, 2009, 09:04:55 pm
I usually see enemies using all their primary hardpoints, especially Seraphims.
Title: Re: Linking primaries
Post by: origin on September 03, 2009, 09:11:48 pm
glad I read this before making any changes.  I will reread chiefs post and see what changes I should make and see what happens...
Title: Re: Linking primaries
Post by: Stormkeeper on September 03, 2009, 09:46:46 pm
I usually see enemies using all their primary hardpoints, especially Seraphims.
Shivan primaries all look similar to me, though, and anyway in a firefight it's not like you're gonna close follow a Basilisk to see if its primaries are linked or not.
Title: Re: Linking primaries
Post by: origin on September 04, 2009, 05:46:45 am
You should be looking at editing the ai_profiles.tbl (http://www.hard-light.net/wiki/index.php?title=Ai_profiles.tbl).  Depending on the depth of your mod, you may want to make a new profile, and have your missions use that, or you may want to write a tbm and just modify the existing FS2_RETAIL profile. 

OK now I'm confused.  Where exactly is the ai_profiles.tbl?  I can find the ai.tbl but not the other one.  Should I make a stand alone ai_profile and put in the mod or data folder?
I tired a tbm and received an error saying that I already had a FS2_RETAIL profile and the entry would be ignored.
Title: Re: Linking primaries
Post by: Spoon on September 04, 2009, 05:52:32 am
You have to create the ai_profiles.tbl yourself (dont worry, its not hard)
open note pad, copy paste this

Code: [Select]
#AI Profiles

$Default Profile:                              FS2 RETAIL

$Profile Name:                                 FS2 RETAIL

$Player Afterburner Recharge Scale:            5,    3,    2,    1.5,  1
$Max Beam Friendly Fire Damage:                0,    5,    10,   20,   30
$Player Countermeasure Life Scale:             3,    2,    1.5,  1.25, 1
$AI Countermeasure Firing Chance:              0.2,  0.3,  0.5,  0.9,  1.1
$AI In Range Time:                             2,    1.4,  0.75, 0,    -1
$AI Always Links Ammo Weapons:                 95,   80,   60,   40,   20
$AI Maybe Links Ammo Weapons:                  90,   60,   40,   20,   10
$AI Always Links Energy Weapons:               100,  80,   60,   40,   20
$AI Maybe Links Energy Weapons:                90,   60,   40,   20,   10
$Max Missles Locked on Player:                 2,    3,    4,    7,    99
$Max Player Attackers:                         2,    3,    4,    5,    99
$Max Incoming Asteroids:                       3,    4,    5,    7,    10
$Player Damage Factor:                         0.25, 0.5,  0.65, 0.85, 1
$Player Subsys Damage Factor:                  0.2,  0.4,  0.6,  0.8,  1
$Predict Position Delay:                       2,    1.5,  1.33, 0.5,  0
$AI Shield Manage Delay:                       5,    4,    2.5,  1.2,  0.1
$Friendly AI Fire Delay Scale:                 2,    1.4,  1.25, 1.1,  1
$Hostile AI Fire Delay Scale:                  4,    2.5,  1.75, 1.25, 1
$AI Turn Time Scale:                           3,    2.2,  1.6,  1.3,  1
$Player Shield Recharge Scale:                 4,    2,    1.5,  1.25, 1
$Player Weapon Recharge Scale:                 10,   4,    2.5,  2,    1.5
$Max Turret Target Ownage:                     3,    4,    7,    12,   19
$Max Turret Player Ownage:                     3,    4,    7,    12,   19
$Percentage Required For Kill Scale:           0.30, 0.30, 0.30, 0.30, 0.30
$Percentage Required For Assist Scale:         0.15, 0.15, 0.15, 0.15, 0.15
$Percentage Awarded For Capship Assist:        0.5,  0.5,  0.5,  0.5,  0.5
$Repair Penalty:                               10,   20,   35,   50,   60
$Delay Before Allowing Bombs to Be Shot Down:  1.5,  1.5,  1.5,  1.5,  1.5

$big ships can attack beam turrets on untargeted ships:  NO
$smart primary weapon selection:                         NO
$smart secondary weapon selection:                       NO
$smart shield management:                                NO
$smart afterburner management:                           NO
$allow rapid secondary dumbfire:                         NO
$huge turret weapons ignore bombs:                       NO
$don't insert random turret fire delay:                  NO
$hack improve non-homing swarm turret fire accuracy:     NO
$shockwaves damage small ship subsystems:                NO
$navigation subsystem governs warpout capability:        NO
$ignore lower bound for minimum speed of docked ship:    NO
$disable linked fire penalty:                            NO
$disable weapon damage scaling:                          NO
$use additive weapon velocity:                           NO
$use newtonian dampening:                                NO
$include beams for kills and assists:                    NO
$score kills based on damage caused:                     NO
$score assists based on damage caused:                   NO
$allow event and goal scoring in multiplayer:            NO
$fix linked primary weapon decision bug:                 NO
$prevent turrets targeting too distant bombs:            NO
$smart subsystem targeting for turrets:                  NO
$fix heat seekers homing on stealth ships bug:           NO
$multi allow empty primaries:                            NO
$multi allow empty secondaries:                          NO
$allow turrets target weapons freely:                    NO
$use only single fov for turrets:                        NO
$allow vertical dodge:                                   NO

#End
And alter till your hearts content.
Then save it as ai_profiles.tbl in yourmod\data\tables
FS2_retail is the default one though, you'll have to assign your custom profile in FRED.
Title: Re: Linking primaries
Post by: Akalabeth Angel on September 04, 2009, 06:06:10 am
I usually see enemies using all their primary hardpoints, especially Seraphims.

Yes but Seraphims only mount one type of Shivan laser do they not?
Title: Re: Linking primaries
Post by: origin on September 04, 2009, 07:08:30 am
Thanks everyone for the help - lets see if this does the trick.

EDITED - oh yeah that did it - works just like I hoped.  So once again I thank all of you.  This really is by far the best modding community on the 'net.
Title: Re: Linking primaries
Post by: Commander Zane on September 04, 2009, 10:14:53 am
I usually see enemies using all their primary hardpoints, especially Seraphims.

Yes but Seraphims only mount one type of Shivan laser do they not?
They mount all Shivan Light Lasers, but it's on three seperate banks, each one is on a very noticable location i.e. wingtips, center, dorsal.