Direction of new entity? and many more questions...
Posted: Tue May 28, 2013 9:22 am
Hello,
The Problem
in my mod I create a set of entities via function. Including a transport-belt is created. But, the transport-belt always oriented north.
By definition (in the Entity.lua File) the transport-belt has a property "direction-count = 12".
I suspect, so it should give a direction property that you can set. Expected "direction = X".
But fail... i can't rotate created entity´s.
What I want
The player create a inserter, and a transport-belt will create via function...Direction to East
Here is the code...
The Code
EDIT!
>> I find the Solution by myself:
>> the magic word is >orientation< :-8 boah - too easy
>> Example, inserter from right to left:
>> game.createentity{name="fast-inserter", position = position, orientation = 6}
>> This are the 8-way directions:
>> 3 4 5
>> \ | /
>> 2 -- -- 6
>> / | \
>> 1 0 7
More questions..
By the way, I have a lot of questions about the structure of the Objects and the (maybe) hardcoded properties.
for example,
I try to create a new Gui for the requester-chest - but it seems that the interfaces hard coded to the etitie`s. Is that correct?
I try to copy functions like >providing item´s< like the provider-chest to an new entity with type "mining-drill" - not possible,
seems that functions hardcoded do entitie`s too.
I try to create a assembly.machine without animation - only picture, no way - and the other way a chest with animation - the same.
The animation png`s have different sizes. 141x120, 32 x 32 and so on - but the screen graphics always fit in a block?
Can a animation has any size?
The accumulator has both: pictures, and two kind of animation. Other entities have only pictures or only one animation.
Changes are not possible. Hardcoded, too?
Wouldn't be better, that each entity would have the possibility to set specific properties?
And, if any type of entitie's has different properties and parameter - is there a list of ALL the properties. I belive the Wiki only shows generall parameter from some kind of entities, right?
Thx for reading and hope for answer
Frank
thx Frank
EDIT - Format
The Problem
in my mod I create a set of entities via function. Including a transport-belt is created. But, the transport-belt always oriented north.
By definition (in the Entity.lua File) the transport-belt has a property "direction-count = 12".
I suspect, so it should give a direction property that you can set. Expected "direction = X".
But fail... i can't rotate created entity´s.
What I want
The player create a inserter, and a transport-belt will create via function...Direction to East
Here is the code...
The Code
Code: Select all
game.onevent(defines.events.onbuiltentity, function(event)
if event.createdentity.name == "fast-inserter" then
local position = {x = event.createdentity.position.x, y = event.createdentity.position.y}
position = {x=position.x + 1.5, y=position.y}
game.createentity{name="ref-inserter", position = position, direction =3}
end
end)
>> I find the Solution by myself:
>> the magic word is >orientation< :-8 boah - too easy
>> Example, inserter from right to left:
>> game.createentity{name="fast-inserter", position = position, orientation = 6}
>> This are the 8-way directions:
>> 3 4 5
>> \ | /
>> 2 -- -- 6
>> / | \
>> 1 0 7
More questions..
By the way, I have a lot of questions about the structure of the Objects and the (maybe) hardcoded properties.
for example,
I try to create a new Gui for the requester-chest - but it seems that the interfaces hard coded to the etitie`s. Is that correct?
I try to copy functions like >providing item´s< like the provider-chest to an new entity with type "mining-drill" - not possible,
seems that functions hardcoded do entitie`s too.
I try to create a assembly.machine without animation - only picture, no way - and the other way a chest with animation - the same.
The animation png`s have different sizes. 141x120, 32 x 32 and so on - but the screen graphics always fit in a block?
Can a animation has any size?
The accumulator has both: pictures, and two kind of animation. Other entities have only pictures or only one animation.
Changes are not possible. Hardcoded, too?
Wouldn't be better, that each entity would have the possibility to set specific properties?
And, if any type of entitie's has different properties and parameter - is there a list of ALL the properties. I belive the Wiki only shows generall parameter from some kind of entities, right?
Thx for reading and hope for answer
Frank
thx Frank
EDIT - Format