Jump to content

Question: Right way to let a ship jump to another sector


Schroeder

Recommended Posts

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!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...