this.shipFiredMissile oddity

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

this.shipFiredMissile oddity

Post by Thargoid »

I've just come across an odd thing with the this.shipFiredMissile ship script event. I'm not sure if it classes as a bug or not, hence why I'm reporting it here rather than Berlios for the moment.

Anyway if I have a ship with a new missile type that isn't scanclass "CLASS_MISSILE" (in this case it's a new Thargoid warship with different Thargons, defined as new equipment EQ_SWARM_MISSILE but with scanclass CLASS_THARGOID) then the this.shipFiredMissile event doesn't fire. However if I change the Thargon scanclass from CLASS_THARGOID to CLASS_MISSILE then the event fires.

I'm going to work around it by setting CLASS_MISSILE and then changing the scanner colours to red/green, but it seemed odd that something that is a missile (by the normal equipment definitions) isn't triggering the event unless it has the specific scanclass.

For reference EQ_THARGON also doesn't seem to trigger the event?

Test case OXP available on request.

Editted to add - it's a non-ideal solution though, as now the mothership tends to attack its own drones (even though they're in the same shipgroup) as scanForNonThargoids picks them up.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: this.shipFiredMissile oddity

Post by Kaks »

Well, the same applies with firing qmines, etc...

Ok, it looks like we'll have a 'pylonFired' 'shipReleasedEquipment' event (name to be finalised) that will be activated if the ship's launching a non-missile pylon-mounted piece of equipment! :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: this.shipFiredMissile oddity

Post by JensAyton »

Kaks wrote:
Well, the same applies with firing qmines, etc...
Hey, you! Stop hanging around here and respond on the mailing list. :-p
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: this.shipFiredMissile oddity

Post by Kaks »

Okie-dokie! :D
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: this.shipFiredMissile oddity

Post by Thargoid »

Kaks wrote:
Well, the same applies with firing qmines, etc...

Ok, it looks like we'll have a 'pylonFired' 'shipReleasedEquipment' event (name to be finalised) that will be activated if the ship's launching a non-missile pylon-mounted piece of equipment! :)
It's still a little odd, as far as equipment is concerned, it is a missile (it's defined as EQ_SWARM_MISSILE, so is pylon based, needs a target, is set-up using missile_role and missiles in shipdata etc). It just doesn't have the missile scanclass. It's not quite the same, as if it's lumped in with mines then we won't be able to have the target as a parameter (as they don't have one, whereas my missile does).

The shipReleasedEquipment event is still very much desirable (so we can detect mine launches), but for me it's still not logical as fundamentally what I'm launching by equipment definition is a missile...
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

Re: this.shipFiredMissile oddity

Post by CommonSenseOTB »

Kaks wrote:
Well, the same applies with firing qmines, etc...

Ok, it looks like we'll have a 'pylonFired' 'shipReleasedEquipment' event (name to be finalised) that will be activated if the ship's launching a non-missile pylon-mounted piece of equipment! :)
Thankyou! :D
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: this.shipFiredMissile oddity

Post by Kaks »

Thargoid, I've already tweaked it locally & it should appear in 1.76.1 and above: if it's isMissile==true and it's got a target, the firedMissile event will fire anyway.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: this.shipFiredMissile oddity

Post by Thargoid »

Sounds good to me, thanks.

I'll grab a nightly build in a day or two, once it goes in and test it out.
Post Reply