Quick NPC weapon mount question

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2272
Joined: Tue Jan 02, 2007 12:38 pm

Quick NPC weapon mount question

Post 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
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Quick NPC weapon mount question

Post 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.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Quick NPC weapon mount question

Post 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).
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Quick NPC weapon mount question

Post 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.
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2272
Joined: Tue Jan 02, 2007 12:38 pm

Re: Quick NPC weapon mount question

Post 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?
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Quick NPC weapon mount question

Post 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.
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2272
Joined: Tue Jan 02, 2007 12:38 pm

Re: Quick NPC weapon mount question

Post by Killer Wolf »

cheers bud. i thought it odd they'd have the posn but not the weapon.
Post Reply