Droped items?
Droped items?
Can we spawn items on the floor by the code? I think this was added in 0.3, but im not sure how or if we can do it.
Re: Droped items?
Code: Select all
game.createentity{name="item-on-ground", position=game.player.character.position, stack={name="iron-plate"}}
Re: Droped items?
haha thanx
In my opinion, the best way to documentate things, is to write them in a note on your desktop while you are making it, because I allways forget something.
In my opinion, the best way to documentate things, is to write them in a note on your desktop while you are making it, because I allways forget something.
Re: Droped items?
game.findentities doesnt find droped items
This makes transport belts be stuck when the code places more than one item at the same place
This makes transport belts be stuck when the code places more than one item at the same place
Re: Droped items?
I can check later, but I doubt it.ficolas wrote:game.findentities doesnt find droped items
This makes transport belts be stuck when the code places more than one item at the same place
To avoid collisions, it is better (and faster) to use game.canplaceentity
Re: Droped items?
But will that work with transport belts?kovarex wrote:I can check later, but I doubt it.ficolas wrote:game.findentities doesnt find droped items
This makes transport belts be stuck when the code places more than one item at the same place
To avoid collisions, it is better (and faster) to use game.canplaceentity
Re: Droped items?
Also, how do I use canplaceentity? I tried by using a table ({x,y}) and it says string expected, got nil.
How can you tell if you can place an entity with just a string? dont you need a table with the position and the name of the entity? :S
How can you tell if you can place an entity with just a string? dont you need a table with the position and the name of the entity? :S
Re: Droped items?
Same way you create entity.
Code: Select all
if game.canplaceentity({ name = "iron-chest", position = {0,0}}) then
game.createentity({ name = "iron-chest", position = {0,0}, force=game.player.force})
end
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela