entity.direction

Things that already exist in the current mod API
Post Reply
User avatar
darius456
Fast Inserter
Fast Inserter
Posts: 222
Joined: Thu Jan 02, 2014 6:33 am
Contact:

entity.direction

Post 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.
Lenovo Y580 8GB Ram GF660m 128GB SSD W7

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: entity.direction

Post 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 3181 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:

User avatar
darius456
Fast Inserter
Fast Inserter
Posts: 222
Joined: Thu Jan 02, 2014 6:33 am
Contact:

Re: entity.direction

Post by darius456 »

You are my hero! Thank YOU! - it work perfectly. Oh my god im so blind, everything is on wiki. sorry.
Lenovo Y580 8GB Ram GF660m 128GB SSD W7

Post Reply

Return to “Already exists”