Thanks for your suggestions! I may consider them for the future, but it will probably take a while until I get it done. The problem is that I've never played a game with SA yet, so I'm familiar only with things I've read in the Lua API documentation.
I have one car per planet and I want to click to teleport that car without having to own a planet's vehicle every time. A cars ownership could optionally be dependent on the planet it is on.
As far as I can see, each planet can have one or more surfaces associated to it. It seems when the player is using the car keys to claim a vehicle, we should mark the vehicle to be owned by the player on LuaPlayer::surface.planet. So, each player could own several vehicles, but only one per planet. If the player is using the keys to summon a vehicle, we must check which planet the player's current surface is associated with, and get the vehicle that is marked as owned by the player on that planet (even if it is on another surface than the player).
There could be a key in the inventory, like the mod used to do a long time ago, and that key item could have an associated vehicle.
Associating keys (inventory items) with a particular vehicle is bound to cause problems: what if you've lost the key? If you've dropped it on the ground, or put it in a chest that is not accessible (e.g. because it has been destroyed, or you don't remember its location), you couldn't summon the vehicle anymore. That's why I've agreed to get rid of the physical key items and use the shortcut instead.
I believe it would be possible to keep the shortcut if we stored the planet with the vehicle data. However, that would be a major change requiring restructuring of the mod's storage table, and ascertaining compatibility with other mods. Additionally, I wouldn't want the mod to depend on SA – players without it should still be able to use GCKI, so I'd have to add compatibility code for that as well. It's not impossible to do that, but it will mean a lot of time spent on planning, rewriting, and testing. That's definitely a long-term project, not something I could finish in a month or two! :-)
I like the latter solution since player inventory has to stay on the planet with the associated vehicle.
Really? How does that work exactly? Do you lose all items in your inventory when you enter/leave a space ship (LuaSpacePlatform)?