shipTakingDamage

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

Moderators: winston, another_commander, Getafix

Post Reply
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:

shipTakingDamage

Post by Commander McLane »

The Wiki claims that the shipTakingDamage handler for the player ship only fires after shields are down. This appears not to be the case. I have it firing with my shields full as well.

So, is it a bug, or is the Wiki just wrong or outdated? (I'd prefer the latter, because it makes sense to catch all cases when something is hitting your ship.)
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: shipTakingDamage

Post by cim »

Commander McLane wrote:
So, is it a bug, or is the Wiki just wrong or outdated?
The Wiki is wrong - and now changed, which was the bit which was forgotten the last few times this question came up...
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: shipTakingDamage

Post by Eric Walch »

It was indeed always firing. I always handled it in my test script as:

Code: Select all

this.shipTakingDamage = function (amount, whom, type)
{
    if (amount> 0) log(this.name, "Player is sustaining " + amount + " units of " + type + " from: " + (whom?whom.name:"unknown"));
}
So checking if damage was > 0. In the other cases the shields absorbed the hit. :lol:
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: shipTakingDamage

Post by Commander McLane »

Thanks for the answers (and the correction in the Wiki). :D
Post Reply