Spawn item

Place to get help with not working mods / modding interface.
Nirahiel
Filter Inserter
Filter Inserter
Posts: 351
Joined: Mon Sep 23, 2013 2:18 pm
Contact:

Spawn item

Post by Nirahiel »

Hi, i'd like to use lua to spawn an item, two options :
Either spawn it in water, or directly spawn it in an inserter's hand.

Is it possible ?

Thanks
ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Spawn item

Post by ficolas »

Wrong forum
https://forums.factorio.com/forum/viewforum.php?f=25
and yea it is, same as you can spawn any entity, with game.placeentity, the name is item-on-the-ground and the table should have another var, stack.
Nirahiel
Filter Inserter
Filter Inserter
Posts: 351
Joined: Mon Sep 23, 2013 2:18 pm
Contact:

Re: Spawn item

Post by Nirahiel »

Oh yeah wrong forum, posted too fast :)
Anyway, i figured out myself, but thanks for the info :)

Know if I can spawn an item in an inserter's hand ? (And fail if the inserter is full / out of power) ?
ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Spawn item

Post by ficolas »

Nirahiel wrote:Oh yeah wrong forum, posted too fast :)
Anyway, i figured out myself, but thanks for the info :)

Know if I can spawn an item in an inserter's hand ? (And fail if the inserter is full / out of power) ?
I dont think you can spawn it in the inserter hand but you can spawn it for sure on the inserter pick up area.
Nirahiel
Filter Inserter
Filter Inserter
Posts: 351
Joined: Mon Sep 23, 2013 2:18 pm
Contact:

Re: Spawn item

Post by Nirahiel »

I know but if there is already some items / a belt, it could not work the way I want :)
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Spawn item

Post by kovarex »

You can remove the item from the inserter hand by calling inserter.clearitemsinside().
But there is no way to put something to the arm using script, we might add it.
Nirahiel
Filter Inserter
Filter Inserter
Posts: 351
Joined: Mon Sep 23, 2013 2:18 pm
Contact:

Re: Spawn item

Post by Nirahiel »

kovarex wrote:You can remove the item from the inserter hand by calling inserter.clearitemsinside().
But there is no way to put something to the arm using script, we might add it.
Oh yeah please add this, I'll need it for my mod !
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Spawn item

Post by kovarex »

Ok, added the interface for item in inserter hand for 0.7.1
https://forums.factorio.com/wiki/inde ... a/Inserter
Nirahiel
Filter Inserter
Filter Inserter
Posts: 351
Joined: Mon Sep 23, 2013 2:18 pm
Contact:

Re: Spawn item

Post by Nirahiel »

Yay kovarex, you rock :D
Post Reply

Return to “Modding help”