This is the spawning script
Code: Select all
$enemy = [PLAYERSHIP]->find nearest enemy ship: max.dist=1000000
$curtarget = get player tracking aim
if $enemy->exists
if not $enemy == $curtarget
set player tracking aim to $enemy
end
end
$victim = [PLAYERSHIP]->find nearest enemy ship: max.dist=10000
$victim=$curtarget
if $victim->exists
$pmissile = [PLAYERSHIP]->find best missile for target $victim
skip if not $pmissile == {Boarding Pod}
$pmissile = null
if $pmissile
$sector=[PLAYERSHIP]->get sector
$px=[PLAYERSHIP]-> get x position
$py=[PLAYERSHIP]-> get y position
$pz=[PLAYERSHIP]-> get z position
$ex=$victim-> get x position
$ey=$victim-> get y position
$ez=$victim-> get z position
$x=$px+($ex-$px)/5
$y=$py+($ey-$py)/5
$z=$pz+($ez-$pz)/5
$drone= create ship: type={Argon Buster Vanguard} owner={player} addto= $sector x=$x y=$y z=$z
$drone->ignore collisions:[TRUE]
$drone -> force position: x=$x y=$y z=$z
* FIRE AND REFILL MISSILE
*if [PLAYERSHIP]->is missile $pmissile ready to fire
*end
= $drone->add 1 units of $pmissile
$drone->set local variable: name='missile' value=$pmissile
$drone->set local variable: name='victim' value=$victim
=$drone->call script 'jr.missilearm' :
end
end
return null
Code: Select all
$missile=[THIS]->get local variable: name='missile'
$victim=[THIS]->get local variable: name='victim'
=[THIS]->fire missile $missile on $victim
$text = 'Firing ' + $missile + ' on ' + $victim
display subtitle text: text=$text duration=1000 ms
return null
the subtitle shows the missile to be used and the correct target, but the drone never actually fires a missile.
I have modified the Buster Vanguard to be able to mount any/every missle.
I can jump out of my ship and into one of the drones, and manually fire the missile fine.
BTW, I have deliberately over-ridden the closest enemy detection in favour of the current target for testing only, as well as the bit of the script that removes the drone afterwards.
ideas?