i build a mod to let ships in my sector jump in another sector if the health drops under a certain value. I have multiple ships following me, but i can't take care of all of them in a fight ;)
I put an onDamaged Callback on the Entity, and the script is working, but I'm not sure, if this is the best way to move a ship:
Question: Right way to let a ship jump to another sector
in Mods
Posted
Hi Guys,
i build a mod to let ships in my sector jump in another sector if the health drops under a certain value. I have multiple ships following me, but i can't take care of all of them in a fight ;)
I put an onDamaged Callback on the Entity, and the script is working, but I'm not sure, if this is the best way to move a ship:
...
ShipAI(Entity().id):setIdle()
ShipAI(Entity().id):setJump(xNew, yNew)
Galaxy():transferEntity(Entity(), xNew, yNew, 0)
EntityTransferrer(Entity().id)
...
Could you please confirm / optimize?
Thanks in advance!