I'm working on a mod with flying attack drones, which are basically unmanned cars driven around by script.
My problem is: biters and worms ignore those entities. The drone entity and also for example the rockets used for the attack are both created with force = player.force, but that doesn't seem to be enough. How do I make the bugs attack my drones?
This is how they are created:
Code: Select all
-- create plane
local created_plane
created_plane = player.surface.create_entity({
name = drone_name,
position = hangar.spawn_position,
force = player.force,
direction = spawn_direction
})
created_plane.get_fuel_inventory().insert({name="rocket-fuel", count=1})