Page 1 of 1

Quick NPC weapon mount question

Posted: Tue Apr 26, 2011 12:02 pm
by Killer Wolf
when looking through the Shipdata for 1.75, there's a lot of craft that have all weapon mounts listed, but only the forward weapon type is named : i take it this means that that weapon type is duped for all mounts? Are weapon types for the other facings not allowed, or could you have, say, forward Beams and a rear Pulses etc?

cheers

Re: Quick NPC weapon mount question

Posted: Tue Apr 26, 2011 12:28 pm
by Commander McLane
Killer Wolf wrote:
when looking through the Shipdata for 1.75, there's a lot of craft that have all weapon mounts listed, but only the forward weapon type is named : i take it this means that that weapon type is duped for all mounts? Are weapon types for the other facings not allowed, or could you have, say, forward Beams and a rear Pulses etc?
I assume you're asking about NPCs.

They have only the equipment explicitly given to them in shipdata. Thus: if it says

Code: Select all

"forward_weapon_type" = "WEAPON_PULSE_LASER";
the ship has a forward pulse laser. If it says

Code: Select all

"aft_weapon_type" = "WEAPON_MILITARY_LASER";
it has a rear military laser.

All ships in the original set (with the exception of the Thargoid Warship) have only forward lasers, mostly pulse lasers. But a lot of OXP ships also feature a weapon at the rear side.

Oops: I should've looked first and written later. The bigger ships (Anaconda and Boas) actually do have rear weapons, and had them forever (at least since 1.65). However, I think route1traderAI didn't actually make use of them for most of the time. Perhaps it currently does?

Forward and aft weapon doesn't need to be the same, just like for the player. They're completely independent of each other.

And of course you know that NPCs can't have side weapons, so if an OXP writer happens to add a line like

Code: Select all

"port_weapon_type" = "WEAPON_BEAM_LASER";
he's only writing rubbish without any effect or meaning at all.

Re: Quick NPC weapon mount question

Posted: Tue Apr 26, 2011 12:43 pm
by Switeck
I've seen freighter-type ships (Anacondas/Boas/Boa2s/Pythons) making good use of their rear laser in Oolite v1.75.
In my mod, I gave rear lasers to Asps, Fer de Lances, and some Cobra 3's...as well as others. (But certainly not to everything -- Sidewinders, Mambas, Worms, Transports, etc...have never had support for anything other than a front laser, if that!)

I guess it is even possible to give a station missiles it can fire even if it has no lasers. That would certainly discourage ships from shooting at it. The upper limit for an NPC ship as far as I know is 32 missiles without using special tricks.

Lastly, there are plasma turrets -- such as found on the Behemoth OXP or various station OXPs (Black Monks, Random Hits Space Bar, etc).

Re: Quick NPC weapon mount question

Posted: Tue Apr 26, 2011 12:59 pm
by Eric Walch
Commander McLane wrote:
[Oops: I should've looked first and written later. The bigger ships (Anaconda and Boas) actually do have rear weapons, and had them forever (at least since 1.65). However, I think route1traderAI didn't actually make use of them for most of the time. Perhaps it currently does?
Indeed, this has changed since 1.75. There was a bug in the code that when re-issued a 'performAttack' command, the ship switched from using rear weapon to retreating mode. And because most AI code did call a 'performAttack' after hitting the ship, this often mend that most ships very soon forgot that they had a rear laser. Since 1.75 this is fixed.

Re: Quick NPC weapon mount question

Posted: Tue Apr 26, 2011 2:01 pm
by Killer Wolf
"And of course you know that NPCs can't have side weapons, so if an OXP writer happens to add a line like
Code:
"port_weapon_type" = "WEAPON_BEAM_LASER";

he's only writing rubbish without any effect or meaning at all."


heh, well some of the core ships have port/starboard position notes, so i guess that's no use either.
my point was, if i put an aft weapon position, would it acutally do something if i didn't put an aft weapon TYPE?

Re: Quick NPC weapon mount question

Posted: Tue Apr 26, 2011 2:10 pm
by Commander McLane
Killer Wolf wrote:
"And of course you know that NPCs can't have side weapons, so if an OXP writer happens to add a line like
Code:
"port_weapon_type" = "WEAPON_BEAM_LASER";

he's only writing rubbish without any effect or meaning at all."


heh, well some of the core ships have port/starboard position notes, so i guess that's no use either.
my point was, if i put an aft weapon position, would it acutally do something if i didn't put an aft weapon TYPE?
No. The position only says where a laser beam—if any—originates from. If not specified, it defaults to (0, 0, 0). Therefore, in a sense all ships have weapon_position_foo keys for all directions.

Specifying where something has to be attached, and actually attaching the something are two completely different things.

Re: Quick NPC weapon mount question

Posted: Wed Apr 27, 2011 5:59 am
by Killer Wolf
cheers bud. i thought it odd they'd have the posn but not the weapon.