Page 1 of 1

Change entity's force

Posted: Sun Mar 17, 2013 8:52 am
by drs9999
Is there a method or something else I can do to change the force a entity belongs to?

Re: Change entity's force

Posted: Sun Mar 17, 2013 2:27 pm
by slpwnd
No, the force is only readonly atm.

Re: Change entity's force

Posted: Sun Mar 17, 2013 2:41 pm
by drs9999
Thanks for the info.

Then see this as a suggestion for future updates ;)

Re: Change entity's force

Posted: Sun Mar 17, 2013 2:58 pm
by ficolas
destroy and create it back

Re: Change entity's force

Posted: Sun Mar 17, 2013 3:04 pm
by drs9999
Exactly this is the problem.
It seems like that the entities which you spawn with create() belong to the neutral-force.

At first I thought that this is not a big problem, because you are able to interact with them.
But then I spawned a Lab next to some turrets that I built regularly. And the lab was destroyed instantly by the turrets.

Re: Change entity's force

Posted: Sun Mar 17, 2013 3:11 pm
by ficolas
You need to specify the field "force" in the table you used to create the entity

Re: Change entity's force

Posted: Sun Mar 17, 2013 3:49 pm
by drs9999
Not sure if I undestand..
Can you give me an example, please?

Re: Change entity's force

Posted: Sun Mar 17, 2013 4:06 pm
by ficolas

Code: Select all

game.createentity{name="electric-turret", position={x=0, y=0}, force="enemy"} 
But im not sure so test it.

Re: Change entity's force

Posted: Sun Mar 17, 2013 4:48 pm
by slpwnd
You can't specify the force at the moment either :| It is in our issue list now.

Re: Change entity's force

Posted: Sun Mar 17, 2013 4:51 pm
by ficolas
Will it be available for 0.3? :)

Edit: yay im the first filter inserter :D

Re: Change entity's force

Posted: Tue Mar 19, 2013 11:35 am
by slpwnd
ficolas wrote:Will it be available for 0.3? :)
Yes it will.