Page 1 of 1

How to call script when ship is destroyed

Posted: Sat Jul 09, 2011 1:38 am
by Dragonfire
Hi all, I decided to take up the Dark Sky Enterprises mission after all.

I need to call a script when a specific ship (a Black Wyvern) is destroyed by the player. This script should simply raise a mission variable of the number of Black Wyverns destroyed total, and of a mission variable of the number of BWs destroyed in this stage of the mission.

How exactly do I do that?

Re: How to call script when ship is destroyed

Posted: Sat Jul 09, 2011 2:26 am
by Mauiby de Fug
Call the shipDied event handler from the Black Wyvern's ship script.

You'll find the wiki javascript reference pages very useful...

Re: How to call script when ship is destroyed

Posted: Sat Jul 09, 2011 3:19 am
by Dragonfire
Thank you. Yup, I've been hunting through those. Not easy to trudge through everything at this point, but I'll become more familiar with it in time.

Re: How to call script when ship is destroyed

Posted: Sat Jul 09, 2011 2:53 pm
by Mauiby de Fug
Don't worry. When I get around to doing bits of scripting or looking through other peoples' scripts, I always have them open as a reference. I usually know where to look and what I'm looking for, but I don't recall specific details about things. You get more familiar with them the more you do.