LB wants to do a check if the player had shot a mission ship. Best thing is to do that in the death_actions. With legacy script is is not possible, but in JS you can come close I think. It is worth to write this good as many other scripters, now and in the future, want to have a script that showed if it really was the player that shot the ship. If there is a working script, others could just copy it into their own source. I tried something below but really do not know if it can work. But better is even to test if the player was near and the victim was the primary target. Even better would be a check if it was the player that made the fatal shot, but that would need adding an additional check in the source-code as I think it is not stored at the moment.
Code: Select all
this.name = "player_near_script";
this.author = "Eric Walch";
this.copyright = "Jan2008";
this.description = "Untested";
this.version = "1.00";
this.shipDied = function()
{
this.ship.call("scanForNearestShipWithPrimaryRole:", "Player")
if(found_target == player)
{
//your stuff:
// e.g.
//missionVariables.player_is_near = "YES"
}
else
{
//your stuff 2:
// e.g.
//missionVariables.player_is_near = "NO"
}
}