How do not create enemy bases

Place to get help with not working mods / modding interface.
Post Reply
User avatar
maroder
Inserter
Inserter
Posts: 47
Joined: Mon Apr 27, 2015 1:02 pm
Contact:

How do not create enemy bases

Post 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.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5153
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: How do not create enemy bases

Post 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

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: How do not create enemy bases

Post by orzelek »

You will have no artifacts then - you'll need a mod to provide those.

User avatar
maroder
Inserter
Inserter
Posts: 47
Joined: Mon Apr 27, 2015 1:02 pm
Contact:

Re: How do not create enemy bases

Post 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?

Post Reply

Return to “Modding help”