How to place enemy units?
-
- Manual Inserter
- Posts: 4
- Joined: Tue Jan 17, 2017 1:18 am
- Contact:
How to place enemy units?
i want to place Units in game, like Biters. Wrote a mod for this, but they are friendly. Want them to be enemies. But how? Cant get it.
Re: How to place enemy units?
How did you even do that? By default created entities belong to "enemy" force.
Among the parameters to create-entity there is an argument "force", you can specify it.
http://lua-api.factorio.com/0.14.21/Lua ... ate_entity
Among the parameters to create-entity there is an argument "force", you can specify it.
http://lua-api.factorio.com/0.14.21/Lua ... ate_entity
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
-
- Manual Inserter
- Posts: 4
- Joined: Tue Jan 17, 2017 1:18 am
- Contact:
Re: How to place enemy units?
I just used "place_result = unit[name]" in the "type = item". Yes, easy. Too easy.
And the "force = enemy" placed in the "type = unit", does nothing.
So, think you re right, i have to use more lua code. But i hoped for a more easy way.
And the "force = enemy" placed in the "type = unit", does nothing.
So, think you re right, i have to use more lua code. But i hoped for a more easy way.
-
- Manual Inserter
- Posts: 4
- Joined: Tue Jan 17, 2017 1:18 am
- Contact:
Re: How to place enemy units?
i just want to spawn some enemies around me or somewhere, at begin of a game, just to see how it works. What do i have to do?
spawn_enemy(name, surf, pos)
ok, that sounds good, but how can i set the "pos", and what want that "surf"?
spawn_enemy(name, surf, pos)
ok, that sounds good, but how can i set the "pos", and what want that "surf"?