Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Reprobator on April 23, 2009, 01:38:31 am

Title: Capital ships with primary weapon
Post by: Reprobator on April 23, 2009, 01:38:31 am
Hi all,
I've made a carrier ship , (cruiser sized) Who have few defending turret (flak) and as only offensive option : forward cannon.

But it seems that ingame, the ai do not use its primary weapon and just show its flank to a hostiles cap's ships.
is this a normal behavior for the ai when you set "capital" in the ships flag?

Is there a way to avoid that ( because as it has no offensive turret i expect him to face the hostile's cap ship to attack)?

Title: Re: Capital ships with primary weapon
Post by: General Battuta on April 23, 2009, 02:05:11 am
Capital ships should never use the 'attack' command.

Instead, script AI capital ship battles using waypoints for both sides.
Title: Re: Capital ships with primary weapon
Post by: Reprobator on April 23, 2009, 02:10:34 am
Ok thank you, i'll try that this evening, but is there anything preventing cap ship from using primary weapon?
Title: Re: Capital ships with primary weapon
Post by: Dragon on April 23, 2009, 04:20:28 am
I know this problem and even found solution for it.
This is caused by "+attempt broadsides" flag in objecttypes.tbl ,and makes ship turn and engage enemy using broadside tactics. It can be useful for battleships like Colossus ,but fails with attack units such as Aeolus ,Deimos or your ship. The solution for this behaviour is: Create "carrier-obt.tbm" in your data folder ,put there this lines:
Code: [Select]
#Ship types

$Name:                  Carrier
$Counts for Alone:      YES
$Praise Destruction:    YES
$On Hotkey List:        YES
$Target as Threat:      YES
$Show Attack Direction: YES
$Max Debris Speed:      150
$FF Multiplier:         1.0
$EMP Multiplier:        0.9
$Beams Easily Hit:      YES
$Fog:
   +Start dist:            10.0
   +Compl dist:            600.0
   +Disappear factor:      2.0
$AI:
   +Valid goals:           (  "fly to ship"
                              "attack ship"
                              "attack wing"
                              "dock"
                              "waypoints"
                              "waypoints once"
                              "depart"
                              "undock"
                              "stay still"
                              "play dead"
                              "stay near ship" )
   +Accept Player Orders:  YES
   +Player Orders:         (  "attack ship"
                              "depart" )
   +Auto attacks:          YES
   +Attempt Broadside:     NO
   +Actively Pursues:      (  "transport"
                              "freighter"
                              "awacs"
                              "gas miner"
                              "cruiser"
                              "corvette"
                              "capital"
                              "supercap"
                              "drydock"
                              "knossos" )
   +Guards attack this:    YES
   +Turrets attack this:   YES
   +Can Form Wing:         YES
   +Passive docks:         (  "support" )

#End

It's modified retail "Cruiser" profile without enabled broadside.
Now ,assuming you flagged it as "Cruiser" ,remove "Cruiser" from ship flags and put "Carrier" in it's place.
It should attack with forward weapon now ,the thing that prevented it from using it's main cannon was most likely the fact the target got out of firing arc too soon (it happend to me with modified INFA Zargeus).
Title: Re: Capital ships with primary weapon
Post by: Reprobator on April 23, 2009, 06:56:06 am
Excellent!
Thank you very much, it'll be hard to wait till i finish my work today  ;7
Title: Re: Capital ships with primary weapon
Post by: Reprobator on April 23, 2009, 03:33:23 pm
Ok, i m back to report, that works (at least for the broadside) but it still can't manage to shoot a bigger and static target (a colossus) with its primaries... i don't understand why, also the ship just pass through the colossus, seems i have collision detection error somewhere (i don't have problem when i hurt my fighter with my carrier)

Hmmm stange  :nervous:
Title: Re: Capital ships with primary weapon
Post by: Angelus on April 23, 2009, 03:37:23 pm
Ok, i m back to report, that works (at least for the broadside) but it still can't manage to shoot a bigger and static target (a colossus) with its primaries... i don't understand why, also the ship just pass through the colossus, seems i have collision detection error somewhere (i don't have problem when i hurt my fighter with my carrier)

Hmmm stange  :nervous:

Is your primary weapon a forward firing turret?

Or did you add a primary weapon bank in PCS2? Those work only on Fighters/ Bombers, iirc.
Title: Re: Capital ships with primary weapon
Post by: General Battuta on April 23, 2009, 03:45:50 pm
Yes. All capital ship weapons must be turrets. You can create a fixed turret with a very narrow firing arc, I believe, but it still has to be a turret, not a primary.
Title: Re: Capital ships with primary weapon
Post by: Reprobator on April 23, 2009, 04:07:50 pm
i see, it works when i pilot the cap ships but not when the ai use it.

Hmmm i ll try as a fixed turret so.