The Ruins Mod 2.0 deprecated


This mod is now deprecated and merged with `AbandonedRuins_updated_fork`.

Content
a month ago
2.0
3.15K
Environment

b Enemy not recognized.

5 months ago

I tried out your Ruins port after using Keysivi's version for a while, and something I noticed quite quickly is that turrets, land mines and player character doesn't recognize enemies as enemies anymore. I saw them walking across my landmines, and inside the range of my turrets, and made a hole in my wall, ran over to the miners, and just started walking around there while ignoring me, the miners and my bots. And when I tried shooting them holding only spacebar, it didn't work. I needed to also hold the button to forcefully shoot. They still ignored me as I killed them. I then disabled the mod and loaded the save from before I installed it, and everything appeared to be working correctly again, so it is safe to say something in the mod messes up relations between forces.

5 months ago

Hmm, here my personal laser defense is attacking enemy turrets once they come in range. The LUA code this (I have not changed it):

  local force = extra_options.force or "neutral"
  if force == "enemy" then
    force = util.get_enemy_force()
  end

In function spawn_entity(). I have to go sleep now, I have to take more time to investigate this.

5 months ago

I do have the setting to make turrets passive. Maybe that can be what makes my force not recognize biters as enemies anymore?

5 months ago

I have no idea here, sorry.

5 months ago

In last two functions of utilities.lua code was incorrectly updated to 2.0:
global.enemy_force to game.forces.enemy
As a result the mod is using biters force every time it means to use AbandonedRuins:enemy force.
Instead it should be storage.enemy_force
There are 4 instances of game.forces.enemy in the place stated above.

5 months ago
local function setup_enemy_force()
  local enemy_force = game.forces["AbandonedRuins:enemy"] or game.create_force("AbandonedRuins:enemy")

  util.set_enemy_force_diplomacy(enemy_force, false)

  storage.enemy_force = enemy_force
  return enemy_force
end

util.get_enemy_force = function()
  if (storage.enemy_force and storage.enemy_force.valid) then
    return storage.enemy_force
  end
  return setup_enemy_force()
end
5 months ago
(updated 5 months ago)

In last two functions of utilities.lua code was incorrectly updated to 2.0:
global.enemy_force to game.forces.enemy
As a result the mod is using biters force every time it means to use AbandonedRuins:enemy force.
Instead it should be storage.enemy_force
There are 4 instances of game.forces.enemy in the place stated above.

Ah, that's making totally sense. Thank you for your help. I will note that down again.

5 months ago
(updated 5 months ago)

Your change will be included in 1.2.0. Closing topic now. 1.1.23 was never released.

This thread has been locked.