Page 1 of 1

How to launch landed ships using AI?

Posted: Fri Oct 02, 2015 7:47 pm
by clausimu
I'm having some issues launching ships that have been spawned as landed ("SpawnShipLanded"). As expected, ship:Undock() does not work. But just providing the ship with a target and telling it to fly there (AIFlyTo) or dock there (AIDockWith) does not do anything. I figure I have to launch it in the air first. I'm sure I'm just blind, but I've dug through the lua API and just can't find the right way to do it. Any pointers?

I would like to have stranded ships ("out of fuel") fly off once the player has provided them with fuel. It works in space - but landed ships are glued to the ground...

Thank you!

Re: How to launch landed ships using AI?

Posted: Sat Oct 03, 2015 10:09 am
by impaktor
For me, spawning a docked ship, then ship:Undock(), then ship:AIKill(someship) works for me.
Have a look in SpaceStation:LaunchPolice in: https://github.com/impaktor/pioneer/blo ... tation.lua

(I think there might be potential problem if all landingpads are taken, which is more probable to occur in scout+ and other mods which decreases the loneliness of space.)

Re: How to launch landed ships using AI?

Posted: Sat Oct 03, 2015 11:39 pm
by clausimu
No - I don't mean docked to a space station. I mean landed on a planet (using SpawnShipLanded). I can undock and fly around ships using the AI just fine. Only when they have landed on a planet's surface I can't get them up in the air again...

Re: How to launch landed ships using AI?

Posted: Mon Oct 05, 2015 4:58 pm
by impaktor
Opened this for you: #3479

I think this exposes a potential issue: What is the expected behaviour of AIFlyTo for a landed or docked ship?