Add argument EntityWithQualityID to .create_cargo_pod()

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Puke
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Jun 13, 2016 7:00 pm
Contact:

Add argument EntityWithQualityID to .create_cargo_pod()

Post by Puke »

Hello !

The method LuaEntity.create_cargo_pod() :
https://lua-api.factorio.com/2.0.73/cla ... _cargo_pod
https://lua-api.factorio.com/2.0.73/cla ... _cargo_pod

Does not allow to specify which pod.
However, we are already capable of making modded cargo pods by adding a CargoPodPrototype.
It would be nice to have the ability to "summon" such pods with the .create_cargo_pod(), this would allow way more flexibility using real cargo pods.

Thank you !
Best regards
Rseding91
Factorio Staff
Factorio Staff
Posts: 16568
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Add argument EntityWithQualityID to .create_cargo_pod()

Post by Rseding91 »

Isn't that just surface.create_entity() ?
If you want to get ahold of me I'm almost always on Discord.
Puke
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Jun 13, 2016 7:00 pm
Contact:

Re: Add argument EntityWithQualityID to .create_cargo_pod()

Post by Puke »

I tried that, but it doesn't look like the cargo pod created with create_entity() behaves like the one created with create_cargo_pod(),
it doesn't belong to a hatch (therefore, doesn't play its animation nor does it occupy the hatch).
Create_cargo_pod() seems like a helper that does several things under the hood, and especially, create the cargo pod at the right position, and play the correct animations for the hatch.
My request is to be able to leverage all this, and override the cargo pod it uses.
Puke
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Jun 13, 2016 7:00 pm
Contact:

Re: Add argument EntityWithQualityID to .create_cargo_pod()

Post by Puke »

I tinkered a bit more with create_entity() and unfortunately, it really doesn't match what create_cargo_pod() does.

Here is the current situation :
- A hatch prototype can only send one type of unit. (This makes sense, I'm not discussing this point).
- A cargo bay can have multiple hatches prototypes, that is true, but I would like to be able to use a single "launcher" to send different cargo pods types at runtime. (Because multiple prototypes mean multiple animations, therefore, we cannot really use the same "hole + sliding door" for multiple hatch on a single bay).

The create cargo pod method utilises the hatch animation properly.
The create_entity simply creates a pod. It is functional, but it doesn't "rise from the inside of the hatch" and isn't automatically setup like a "normal" cargo pod would be (no origin, for instance).

Being able to use create_cargo_pod() with a "cargo-pod-prototype override" would allow to just reuse all the functionalities of the create_cargo_pod() command (proper animation, proper initializaiton of what the owner of the pad is).
Post Reply

Return to “Modding interface requests”