Sending (fake) cargo-pod by script

Place to get help with not working mods / modding interface.
User avatar
y.petremann
Filter Inserter
Filter Inserter
Posts: 423
Joined: Mon Mar 17, 2014 4:24 pm
Contact:

Sending (fake) cargo-pod by script

Post by y.petremann »

I have two cargo pod owned by the same force "merchants", one is on nauvis (storage.merchants.nauvis.surface.player), the other is in orbit of nauvis (storage.merchants.nauvis.orbit)

I would like to launch a cargo-pod from orbit to surface with animations and everything

For now I tried :

Code: Select all

local pod=storage.market.nauvis.orbit.create_cargo_pod()
pod.cargo_pod_destination={type=defines.cargo_destination.surface, surface="nauvis" }
The cargo pod instantly disapear,
I need the animation and optionnaly to trigger something when the cargo arrive at destination (I don't mind to have a real inventory transfer)
s6x
Inserter
Inserter
Posts: 41
Joined: Fri Nov 15, 2024 8:22 pm
Contact:

Re: Sending (fake) cargo-pod by script

Post by s6x »

Is storage.market.nauvis.orbit a space platform hub?

I typed the following while in Nauvis orbit:

Code: Select all

/c HUB = game.player.surface.find_entities_filtered({name="space-platform-hub"}) POD = HUB[1].create_cargo_pod() game.print(POD) POD.cargo_pod_destination = {type=defines.cargo_destination.surface, surface="nauvis"}
A cargo pod popped out (and its information printed to the console) and landed on the planet as expected.

Edit: Just to confirm that it wasn't doing some default thing, I changed "nauvis" to "fulgora" and the pod did indeed land on Fulgora directly from Nauvis orbit. :mrgreen:
Post Reply

Return to “Modding help”