Page 1 of 2

Can I find out what just killed me?

Posted: Sat Feb 23, 2013 7:05 pm
by rayner
Hi all,

Anyone know if it's possible to find out what just destroyed my ship?

I had a pretty ironassed Cobra Mk. III with nearly all the available equipment, including shield boosters, military shield enhancement, and an energy unit (not a naval energy unit, though, I hadn't got as far as that mission). I was chasing an Asp (offender) that was running away using its witchfuel injectors. A Krait and a Galcop Viper, also both with witchfuel injectors, were chasing it too. Then, completely unexpectedly, I exploded. My military laser was close to overheating, so my energy banks can't have been full, but my shields were still in the green (I think they were full, in fact) and I'm sure my energy level wasn't anywhere near red. I didn't hear any laser fire, and there were no missiles or space debris on the radar.

The only thing I can think of is that one of the other ships activated its witchfuel injectors and crashed into me. But it'd be nice to know what the heck happened. Are there any logs or debug messages that might tell me?

I'm using Oolite 1.76.1 on Windows XP with no OXPs installed.

Thanks for any ideas, or even vague clues!

Re: Can I find out what just killed me?

Posted: Sat Feb 23, 2013 7:37 pm
by Cody
Hi rayner, and welcome aboard. I think that would've required some specific logging and/or having the console running to identify the reason for your ship exploding. That's all boffinry, which I know zilch about. I would recommend updating to Oolite 1.77 though - well worth it.

Re: Can I find out what just killed me?

Posted: Sat Feb 23, 2013 9:27 pm
by another_commander
Paste the below in a file called script.js, save and then put script.js inside <OoliteInstallationFolder>/AddOns/Config (create the folder if it does not exist):

Code: Select all

this.shipTakingDamage = function(amount, comingFromEntity, damageType)
{
	log("jstest.shipTakingDamage", "Player ship taking " + amount + " damage by " + comingFromEntity + " by means of " + damageType);
}
Next time you take unexpected damage, look inside Latest.log. You will find the information you need written there. Note that taking 0 damage means that your shields are taking hits. Non-zero damage is when the hull gets damaged directly.

Re: Can I find out what just killed me?

Posted: Sat Feb 23, 2013 10:05 pm
by Cody
See... boffinry! As you're on XP, I'd add the usual caveat... best not to create/edit Oolite files in Windows Notepad.
Windows Wordpad is usable (I think), but Notepad++ is free and highly recommended.

Re: Can I find out what just killed me?

Posted: Sun Feb 24, 2013 5:11 am
by rayner
That looks really useful, thanks! I've created the script.js file and the damage reports are showing up in the log.

I suppose I'll never know for sure what wrote off my ship, but at least if anything like it happens again I'll be able to see why.

Now for attempt number 3 to get a commander to "Elite" rating without dying on the way... :-)

Thanks again to both of you!

Re: Can I find out what just killed me?

Posted: Sun Feb 24, 2013 8:42 am
by maaarcooose
El Viejo wrote:
See... boffinry! As you're on XP, I'd add the usual caveat... best not to create/edit Oolite files in Windows Notepad.
Windows Wordpad is usable (I think), but Notepad++ is free and highly recommended.
And thankfully unlike some others, you're not recommending vim to a windows user.

Notepad++ is a great tool.

!m!

Re: Can I find out what just killed me?

Posted: Sun Feb 24, 2013 3:03 pm
by GGShinobi
maaarcooose wrote:
And thankfully unlike some others, you're not recommending vim to a windows user.

Notepad++ is a great tool.

!m!
Hey, gvim is a great tool, too, and it's the most powerful editor I know (besides emacs perhaps)!

But I give you that it's perhaps not the most intuitive editor, especially not for people used to do everything with the mouse and in GUIs (like most windows-users probably are).

On the other hand - does Notepad++ offer such a fun way to learn it like vim has? :P

Re: Can I find out what just killed me?

Posted: Sun Feb 24, 2013 7:06 pm
by rayner
Funnily enough, I really like vim (although I'm certainly no power user). Never really got on with gvim on Windows, though - it just sort of makes me frustrated that everything else doesn't act Unix-like as well.

Anyway, eventually I'll figure out why my wi-fi card doesn't quite work with my Linux installation, and then all of the other problems go away too :-)

:wq

Re: Can I find out what just killed me?

Posted: Mon Feb 25, 2013 8:53 am
by maaarcooose
rayner wrote:
Funnily enough, I really like vim (although I'm certainly no power user). Never really got on with gvim on Windows, though - it just sort of makes me frustrated that everything else doesn't act Unix-like as well.
:wq
Exactly my point, and I still have to try and stop myself typeing :x or :q! in every other editor.

Hmmm, why doesn't my SQL query work, oh yeah that will be because it's got :x stuck in the middle of it.
GGShinobi wrote:
On the other hand - does Notepad++ offer such a fun way to learn it like vim has? :P
Of course not, it doesn't need it. :mrgreen:
That's great though, I'm gonna have a good go at that. I love the fact that the first thing it said was 'Oh okay, you can use the cursor keys.'

!m!

Re: Can I find out what just killed me?

Posted: Mon Feb 25, 2013 3:58 pm
by GGShinobi
maaarcooose wrote:
Of course not, it doesn't need it. :mrgreen:
Very good point! :mrgreen:
maaarcooose wrote:
That's great though, I'm gonna have a good go at that. I love the fact that the first thing it said was 'Oh okay, you can use the cursor keys.'
lol :lol: never saw that! That's cool! :mrgreen:

Re: Can I find out what just killed me?

Posted: Sat Mar 23, 2013 12:15 pm
by Eric Walch
GGShinobi wrote:
On the other hand - does Notepad++ offer such a fun way to learn it like vim has? :P
Very interesting manual. :D

The few times I used an editor on the command-line, it was nano, but I just discovered that the mac also has a vim editor installed. :P
(Syntax: vi path)

Re: Can I find out what just killed me?

Posted: Mon Mar 25, 2013 10:12 am
by Switeck
This is useful enough to know that I would love to see this incorporated into Oolite itself.
We could use it for debugging purposes as well.

An OXP for to do something similar for NPCs might help dig deeper into the issues with dead-but-still-targeted NPC ships.

Re: Can I find out what just killed me?

Posted: Sun Mar 31, 2013 9:05 pm
by Mara Jade
[quote="another_commander"]Paste the below in a file called script.js, save and then put script.js inside <OoliteInstallationFolder>/AddOns/Config (create the folder if it does not exist):

Code: Select all

this.shipTakingDamage = function(amount, comingFromEntity, damageType)
{
	log("jstest.shipTakingDamage", "Player ship taking " + amount + " damage by " + comingFromEntity + " by means of " + damageType);
}
Glad you posted that I added it last week.

I died mysteriously yesterday within the Station Aegis space, so I looked it up on the log.

Turns out that I flew into the Navigation buoy while I was looking at the market prices in another window! lol

Re: Can I find out what just killed me?

Posted: Sun Apr 07, 2013 10:28 pm
by Tricky
Mara Jade wrote:
another_commander wrote:
Paste the below in a file called script.js, save and then put script.js inside <OoliteInstallationFolder>/AddOns/Config (create the folder if it does not exist):

Code: Select all

this.shipTakingDamage = function(amount, comingFromEntity, damageType)
{
	log("jstest.shipTakingDamage", "Player ship taking " + amount + " damage by " + comingFromEntity + " by means of " + damageType);
}
Glad you posted that I added it last week.

I died mysteriously yesterday within the Station Aegis space, so I looked it up on the log.

Turns out that I flew into the Navigation buoy while I was looking at the market prices in another window! lol
:lol: Search for the Darwin Awards thread within this forum and submit that. It is more than worthy. :lol:

Re: Can I find out what just killed me?

Posted: Tue Apr 09, 2013 6:55 pm
by Mara Jade
Tricky wrote:
Mara Jade wrote:

Turns out that I flew into the Navigation buoy while I was looking at the market prices in another window! lol
:lol: Search for the Darwin Awards thread within this forum and submit that. It is more than worthy. :lol:
Thanks, I found the thread and will have fun reading it, but Cmdr McLane beat me to it three years ago with the second post. :D