How to launch landed ships using AI?

Post Reply
clausimu
Posts: 111
Joined: Tue Jan 06, 2015 8:31 pm

How to launch landed ships using AI?

Post 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!
impaktor
Posts: 1008
Joined: Fri Dec 20, 2013 9:54 am
Location: Tellus
Contact:

Re: How to launch landed ships using AI?

Post 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.)
clausimu
Posts: 111
Joined: Tue Jan 06, 2015 8:31 pm

Re: How to launch landed ships using AI?

Post 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...
impaktor
Posts: 1008
Joined: Fri Dec 20, 2013 9:54 am
Location: Tellus
Contact:

Re: How to launch landed ships using AI?

Post 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?
Post Reply