Page 1 of 1

Spawn item

Posted: Mon Oct 07, 2013 1:30 pm
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

Re: Spawn item

Posted: Mon Oct 07, 2013 1:58 pm
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.

Re: Spawn item

Posted: Mon Oct 07, 2013 2:00 pm
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) ?

Re: Spawn item

Posted: Mon Oct 07, 2013 2:27 pm
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.

Re: Spawn item

Posted: Mon Oct 07, 2013 2:45 pm
by Nirahiel
I know but if there is already some items / a belt, it could not work the way I want :)

Re: Spawn item

Posted: Mon Oct 07, 2013 4:57 pm
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.

Re: Spawn item

Posted: Mon Oct 07, 2013 5:01 pm
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 !

Re: Spawn item

Posted: Mon Oct 07, 2013 6:00 pm
by kovarex
Ok, added the interface for item in inserter hand for 0.7.1
https://forums.factorio.com/wiki/inde ... a/Inserter

Re: Spawn item

Posted: Mon Oct 07, 2013 6:05 pm
by Nirahiel
Yay kovarex, you rock :D