Capsule robots that follow entity

Place to get help with not working mods / modding interface.
Post Reply
sore68
Fast Inserter
Fast Inserter
Posts: 123
Joined: Mon May 02, 2016 8:39 am
Contact:

Capsule robots that follow entity

Post by sore68 »

Hi
I have a capsule shooting turret. and use create_entity{} (destroyer-capsule)
However, these capsules do not follow the turret.

If I want the capsule to follow the turret, do I have to make a group? Or is there another way?

User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: Capsule robots that follow entity

Post by Adil »

You create combat robot via surface.create_entity and specify its target during creation.
You can only set robots target during its creation.
Here's example from my old mod:

Code: Select all

local companion=ent.surface.create_entity{position=ent.position, name=robot_name, force=ent.force, target=ent}
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.

sore68
Fast Inserter
Fast Inserter
Posts: 123
Joined: Mon May 02, 2016 8:39 am
Contact:

Re: Capsule robots that follow entity

Post by sore68 »

Adil wrote:You create combat robot via surface.create_entity and specify its target during creation.
You can only set robots target during its creation.
Here's example from my old mod:

Code: Select all

local companion=ent.surface.create_entity{position=ent.position, name=robot_name, force=ent.force, target=ent}
Oh thank you. :)
But I don't control why robots not following with command...

I decided to copy it to "ammo" type capsules and use it.

Post Reply

Return to “Modding help”