Page 1 of 1

How do not create enemy bases

Posted: Thu Mar 10, 2016 5:05 pm
by maroder
I want make it for the mod: dot'n create enemy bases.

Code: Select all

data.raw["autoplace-control"]["enemy-base"] = nil

data.raw["unit-spawner"]["biter-spawner"] = nil
data.raw["unit-spawner"]["spitter-spawner"] = nil

data.raw["turret"]["small-worm-turret"] = nil
data.raw["turret"]["medium-worm-turret"] = nil
data.raw["turret"]["big-worm-turret"] = nil
It will crash the game?

It's perfect at map generating. I don't know how game creating new enemy-bases at free place, when chanks is already generated.

Re: How do not create enemy bases

Posted: Thu Mar 10, 2016 5:17 pm
by Klonan
I don't know why you need to mod, you can choose to not spawn bases at map generation,
If you want to remove spawners from a map thats already generated, you can use a sctipt like this:

Code: Select all

/c local s = game.local_player.surface
for c in s.get_chunks() do
  for key, b in pairs(s.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, force = enemy})) do
    b.destroy()
  end
end

Re: How do not create enemy bases

Posted: Thu Mar 10, 2016 6:34 pm
by orzelek
You will have no artifacts then - you'll need a mod to provide those.

Re: How do not create enemy bases

Posted: Fri Mar 11, 2016 4:50 am
by maroder
Klonan wrote:I don't know why you need to mod, you can choose to not spawn bases at map generation,
If you want to remove spawners from a map thats already generated, you can use a sctipt like this:
script
The mod requires a lot of resources of a PC. I'm working on optimisation of this mod, bases deleting when game generating a chank now.
script
OK, I found it. Creating new bases already off:

Code: Select all

data.raw["map-settings"]["map-settings"].enemy_expansion.enabled = false
Game still have crashes, I guss need to send reports...

My first question is still open: I want to delete ["autoplace-control"]["enemy-base"]. It will crash the game, when be check the enemy_expansion?