I am working on a little mod making EI100s really carrying goods. But of course this shouldn't be a welcome to players to shot down freighters en masse to loot them. So I thought that the Corporation should send a gunship as a enforcer, when a freighter is shot down.
I tried to make it with a onDestroy-Event taking the code from the intCorporateOnDestroy, but sadly it doesn't work. I get a 'content missing'-error for the sysCreateShip. Has anyone an idea, why it doesn't work? Is onDestory valid for <ship> anyways?
My Code:
*** At this position the parser says content missing.<Events>
<OnDestroy>
(block (corporateHunter)
; Create a corporate hunter to avenge the freighter
(setq corporateHunter
(sysCreateShip &scCenturion; (objGetNearestStargate gPlayerShip) &svIndependent;) ***
)
; If someone destroyed the freighter, avenge
(if aDestroyer
(block Nil
(objSendMessage gSource gPlayerShip "Security alert! Deploy corporate enforcer!")
(shpOrderAttack corporateHunter (objGetOrderGiver aDestroyer))
)
)
; Take all the items from the freighter (so that others won't loot it)
(shpOrderLoot corporateHunter gSource)
; Gate out
(shpOrderGate corporateHunter)
)
</OnDestroy>
</Events>