Is there any way to prevent Enemies from being permitted to attack a certain type of entity
Setting Hp to zero breaks the game if you mine the entity again, and even a script can't fix it, and setting destructable to false doesn't stop enemies from attacking, but prevents damage, resulting in a bunch of really stupid looking biters and spitters.
Invulnerable Entity
- Ranakastrasz
- Smart Inserter
- Posts: 2179
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Invulnerable Entity
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: Invulnerable Entity
Setting to destructible=false should prevent anything from targeting the entity. It doesn't however clear things already targeting it when it's set.
If it's not working please explain in what situations it's not working.
If it's not working please explain in what situations it's not working.
If you want to get ahold of me I'm almost always on Discord.
- Ranakastrasz
- Smart Inserter
- Posts: 2179
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Invulnerable Entity
Using Rampant AI. Entity is indestructible. Enemies attack it, but do nothing.
Rampant AI might force an attach, but I kinda expected it to reject the order.
Managed to fix it, sort of. The entity is now owned by "neutral" force once placed, and the biters now ignore it. That plus indestructible seems to work, but unlike a prototype change, takes some work if you want to be able to reverse it.
Rampant AI might force an attach, but I kinda expected it to reject the order.
Managed to fix it, sort of. The entity is now owned by "neutral" force once placed, and the biters now ignore it. That plus indestructible seems to work, but unlike a prototype change, takes some work if you want to be able to reverse it.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: Invulnerable Entity
The situation is:
***NOTE When I say biter I mean a unit group with at least one unit.
A biter kills a chunk of rail, the on death fires with the entity
The biter that killed the rail moves to the next rail until all in the area are gone, at which point the rails have all been remade with destructible=false.
The next unit group of biters passes by the indestructible rails and begins attacking them.
I control biter movement through attack area commands with distraction by_enemy or by_anything and never set individual targets.
***NOTE When I say biter I mean a unit group with at least one unit.
A biter kills a chunk of rail, the on death fires with the entity
Code: Select all
local repairPosition = entity.position
local repairName = entity.name
local repairForce = entity.force
local repairDirection = entity.direction
entity.destroy()
local entityRepaired = surface.create_entity({position=repairPosition,
name=repairName,
direction=repairDirection,
force=repairForce})
entityRepaired.destructible = false
The next unit group of biters passes by the indestructible rails and begins attacking them.
I control biter movement through attack area commands with distraction by_enemy or by_anything and never set individual targets.