Page 1 of 1

entity.direction

Posted: Tue Jun 10, 2014 7:23 pm
by darius456
Simple request: give us entity.direction Read/write properties.
This cause bug in my mod teleinserter. When you place teleniserter, rotate it and then connect to output teleinserter, the input teleinserter is switch to the one with higher energy usage, but information about its direction is missing, because its read only and it will spawn in default position, this is very inconvenient.

Re: entity.direction

Posted: Tue Jun 10, 2014 7:35 pm
by FreeER
Hm, you can give createentity a direction to spawn it in, I'll check the wiki and add that info if it's not there.
Here's a screenshot of what

Code: Select all

for i=0,6,2 do 
    game.createentity{name="basic-inserter", position={game.player.position.x+i,game.player.position.y+i}, direction=i} 
end 
does (the direction should actually be defines.direction, but I wanted a quick way to get the main four directions so...yeah).
direction.png
direction.png (626.98 KiB) Viewed 3195 times
edit: in fact the other directions work as well, I didn't think they would with inserters (since you can't rotate them at an angle manually) :lol:

Re: entity.direction

Posted: Tue Jun 10, 2014 7:45 pm
by darius456
You are my hero! Thank YOU! - it work perfectly. Oh my god im so blind, everything is on wiki. sorry.