mirror of
https://github.com/veden/Rampant.git
synced 2024-12-26 20:54:12 +02:00
see readme
This commit is contained in:
parent
dae6da6cb9
commit
26c3ceb66b
@ -48,6 +48,9 @@ Configure Options not in game menu:
|
|||||||
|
|
||||||
# Version History
|
# Version History
|
||||||
|
|
||||||
|
0.15.3 -
|
||||||
|
- Improvement: Added configuration for safe buildings. This will be improved after a bug fix in factorio
|
||||||
|
|
||||||
0.15.2 -
|
0.15.2 -
|
||||||
- Improvement: Created in game options for
|
- Improvement: Created in game options for
|
||||||
- Max biter wave size
|
- Max biter wave size
|
||||||
|
51
config.lua
51
config.lua
@ -5,56 +5,13 @@ local gaussianRandomRange = mathUtils.gaussianRandomRange
|
|||||||
|
|
||||||
--[[
|
--[[
|
||||||
Causes buildings to regenerate and become untargetable after they are destroyed by biters
|
Causes buildings to regenerate and become untargetable after they are destroyed by biters
|
||||||
Currently doesn't work **** IGNORE ****
|
|
||||||
--]]
|
--]]
|
||||||
config.safeBuildings = false
|
config.safeBuildings = settings.startup["rampant-safeBuildings"].value
|
||||||
config.safeEntities = {}
|
config.safeEntities = {}
|
||||||
config.safeEntityName = {}
|
config.safeEntityName = {}
|
||||||
config.safeEntities["curved-rail"] = true
|
config.safeEntities["curved-rail"] = settings.startup["rampant-safeBuildings-curvedRail"].value
|
||||||
config.safeEntities["straight-rail"] = true
|
config.safeEntities["straight-rail"] = settings.startup["rampant-safeBuildings-straightRail"].value
|
||||||
--config.safeEntities["electric-pole"] = true
|
config.safeEntityName["big-electric-pole"] = settings.startup["rampant-safeBuildings-bigElectricPole"].value
|
||||||
config.safeEntityName["big-electric-pole"] = true
|
|
||||||
|
|
||||||
-- --[[
|
|
||||||
-- turns off homing projectiles for worms and spitters
|
|
||||||
-- --]]
|
|
||||||
-- config.useDumbProjectiles = true
|
|
||||||
|
|
||||||
-- --[[
|
|
||||||
-- ONLY FOR USE WITH NATURAL EVOLUTION ENEMIES
|
|
||||||
-- use the NE unit launchers with medium and big worms.
|
|
||||||
-- if set to false this will still allow the dumb projectiles but without the unit spawning
|
|
||||||
-- A side effect of the dumb projectiles cause the units to be spawned as if two shots were fired
|
|
||||||
-- --]]
|
|
||||||
-- config.useNEUnitLaunchers = true
|
|
||||||
|
|
||||||
-- --[[
|
|
||||||
-- the attackWaveGenerationUse* options are used to score chunks with biter nests that will generate a Rampant attack wave.
|
|
||||||
-- Pollution, the vanilla pollution mechanic (shown on the minimap).
|
|
||||||
-- Player Proximity, if a player moves near a biter nest there is a chance for the nest to spawn attack waves (not shown on the minimap).
|
|
||||||
-- switching all to false will turn off Rampant biter waves
|
|
||||||
-- DOES NOT affect vanilla biters waves
|
|
||||||
-- --]]
|
|
||||||
-- config.attackWaveGenerationUsePollution = true
|
|
||||||
-- config.attackWaveGenerationUsePlayerProximity = true
|
|
||||||
|
|
||||||
-- --[[
|
|
||||||
-- attackWaveGenerationThreshold is the score that the attackWaveGenerationUse* has to reach in order for an attack wave to spawn.
|
|
||||||
-- increasing this will reduce the radius of attack wave generation.
|
|
||||||
-- DOES NOT affect vanilla biters waves
|
|
||||||
-- scaling linearly with evolution factor
|
|
||||||
-- starts 20 @ 0.0 evolution
|
|
||||||
-- ends 0 @ 100.0 evolution
|
|
||||||
-- default max is 20
|
|
||||||
-- default min is 0
|
|
||||||
-- --]]
|
|
||||||
-- config.attackWaveGenerationThresholdMax = 20
|
|
||||||
-- config.attackWaveGenerationThresholdMin = 0
|
|
||||||
|
|
||||||
-- --[[
|
|
||||||
-- attackWaveMaxSize is the largest size that can be initially spawned by Rampant
|
|
||||||
-- --]]
|
|
||||||
-- config.attackWaveMaxSize = 150
|
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
attackWaveScaling is used to calculate the attack wave size from the evolutionFactor
|
attackWaveScaling is used to calculate the attack wave size from the evolutionFactor
|
||||||
|
25
control.lua
25
control.lua
@ -30,6 +30,8 @@ local BONUS_RALLY_CHANCE = constants.BONUS_RALLY_CHANCE
|
|||||||
|
|
||||||
local RETREAT_MOVEMENT_PHEROMONE_LEVEL = constants.RETREAT_MOVEMENT_PHEROMONE_LEVEL
|
local RETREAT_MOVEMENT_PHEROMONE_LEVEL = constants.RETREAT_MOVEMENT_PHEROMONE_LEVEL
|
||||||
|
|
||||||
|
local CHUNK_SIZE = constants.CHUNK_SIZE
|
||||||
|
|
||||||
-- imported functions
|
-- imported functions
|
||||||
|
|
||||||
local getChunkByPosition = mapUtils.getChunkByPosition
|
local getChunkByPosition = mapUtils.getChunkByPosition
|
||||||
@ -279,14 +281,31 @@ local function onDeath(event)
|
|||||||
end
|
end
|
||||||
elseif (entity.force.name == "player") then
|
elseif (entity.force.name == "player") then
|
||||||
local creditNatives = false
|
local creditNatives = false
|
||||||
|
local entityPosition = entity.position
|
||||||
if (event.force ~= nil) and (event.force.name == "enemy") then
|
if (event.force ~= nil) and (event.force.name == "enemy") then
|
||||||
creditNatives = true
|
creditNatives = true
|
||||||
local entityPosition = entity.position
|
|
||||||
local victoryChunk = getChunkByPosition(regionMap, entityPosition.x, entityPosition.y)
|
local victoryChunk = getChunkByPosition(regionMap, entityPosition.x, entityPosition.y)
|
||||||
victoryScent(victoryChunk, entity.type)
|
victoryScent(victoryChunk, entity.type)
|
||||||
end
|
end
|
||||||
if config.safeBuildings and (config.safeEntities[entity.type] or config.safeEntityName[entity.name]) then
|
if creditNatives and config.safeBuildings and (config.safeEntities[entity.type] or config.safeEntityName[entity.name]) then
|
||||||
makeImmortalEntity(surface, entity)
|
-- makeImmortalEntity(surface, entity)
|
||||||
|
|
||||||
|
-- patch (Needs to be removed)
|
||||||
|
local repairPosition = entityPosition
|
||||||
|
local repairName = entity.name
|
||||||
|
local repairForce = entity.force
|
||||||
|
local repairDirection = entity.direction
|
||||||
|
entity.destroy()
|
||||||
|
surface.create_entity({position=repairPosition,
|
||||||
|
name=repairName,
|
||||||
|
direction=repairDirection,
|
||||||
|
force=repairForce})
|
||||||
|
-- forces enemy to disperse
|
||||||
|
local enemies = surface.find_enemy_units({repairPosition.x, repairPosition.y}, CHUNK_SIZE)
|
||||||
|
for i=1, #enemies do
|
||||||
|
enemies[i].set_command({type=defines.command.wander,
|
||||||
|
distraction=defines.distraction.by_enemy})
|
||||||
|
end
|
||||||
else
|
else
|
||||||
addRemoveEntity(regionMap, entity, natives, false, creditNatives)
|
addRemoveEntity(regionMap, entity, natives, false, creditNatives)
|
||||||
end
|
end
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name" : "Rampant",
|
"name" : "Rampant",
|
||||||
"factorio_version" : "0.15",
|
"factorio_version" : "0.15",
|
||||||
"version" : "0.15.2",
|
"version" : "0.15.3",
|
||||||
"title" : "Rampant AI",
|
"title" : "Rampant AI",
|
||||||
"author" : "Veden",
|
"author" : "Veden",
|
||||||
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",
|
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",
|
||||||
|
@ -14,6 +14,8 @@ local PLAYER_BASE_GENERATOR = constants.PLAYER_BASE_GENERATOR
|
|||||||
|
|
||||||
local ENEMY_BASE_PHEROMONE_GENERATOR_AMOUNT = constants.ENEMY_BASE_PHEROMONE_GENERATOR_AMOUNT
|
local ENEMY_BASE_PHEROMONE_GENERATOR_AMOUNT = constants.ENEMY_BASE_PHEROMONE_GENERATOR_AMOUNT
|
||||||
|
|
||||||
|
local CHUNK_SIZE = constants.CHUNK_SIZE
|
||||||
|
|
||||||
-- imported functions
|
-- imported functions
|
||||||
|
|
||||||
local getChunkByIndex = mapUtils.getChunkByIndex
|
local getChunkByIndex = mapUtils.getChunkByIndex
|
||||||
|
@ -28,6 +28,13 @@ rampant-attackWaveGenerationUsePlayerProximity=Use Player Proximity as attack tr
|
|||||||
rampant-attackWaveGenerationThresholdMax=Starting chunk attack threshold
|
rampant-attackWaveGenerationThresholdMax=Starting chunk attack threshold
|
||||||
rampant-attackWaveGenerationThresholdMin=Ending chunk attack threshold
|
rampant-attackWaveGenerationThresholdMin=Ending chunk attack threshold
|
||||||
rampant-attackWaveMaxSize=Max biter group size that can be directly formed
|
rampant-attackWaveMaxSize=Max biter group size that can be directly formed
|
||||||
|
rampant-safeBuildings=Make buildings safe from biters
|
||||||
|
rampant-safeBuildings-curvedRail=Make curved rails safe from biters
|
||||||
|
rampant-safeBuildings-straightRail=Make straight rails safe from biters
|
||||||
|
rampant-safeBuildings-bigElectricPole=Make big electric poles safe from biters
|
||||||
|
rampant-safeBuildings-railChainSignals=Make rail chain signals safe from biters
|
||||||
|
rampant-safeBuildings-railSignals=Make rail signals safe from biters
|
||||||
|
rampant-safeBuildings-trainStops=Make train stops safe from biters
|
||||||
|
|
||||||
[mod-setting-description]
|
[mod-setting-description]
|
||||||
rampant-useDumbProjectiles=Turns off homing projectiles for worms and spitters
|
rampant-useDumbProjectiles=Turns off homing projectiles for worms and spitters
|
||||||
@ -37,3 +44,10 @@ rampant-attackWaveGenerationUsePlayerProximity=Include player pheromones amount
|
|||||||
rampant-attackWaveGenerationThresholdMax=The score that a chunk must reach in order for an attack wave to spawn. DOES NOT affect vanilla biters waves. Scaling linearly with evolution factor (starting threshold @ 0.0 evolution)
|
rampant-attackWaveGenerationThresholdMax=The score that a chunk must reach in order for an attack wave to spawn. DOES NOT affect vanilla biters waves. Scaling linearly with evolution factor (starting threshold @ 0.0 evolution)
|
||||||
rampant-attackWaveGenerationThresholdMin=The score that a chunk must reach in order for an attack wave to spawn. DOES NOT affect vanilla biters waves. Scaling linearly with evolution factor (ending threshold @ 100.0 evolution)
|
rampant-attackWaveGenerationThresholdMin=The score that a chunk must reach in order for an attack wave to spawn. DOES NOT affect vanilla biters waves. Scaling linearly with evolution factor (ending threshold @ 100.0 evolution)
|
||||||
rampant-attackWaveMaxSize=If you wish to change how the attack wave scales with evolution you will need to modify the config.lua in the zip file.
|
rampant-attackWaveMaxSize=If you wish to change how the attack wave scales with evolution you will need to modify the config.lua in the zip file.
|
||||||
|
rampant-safeBuildings=This needs to be toggle for the safe building toggles to work. Understand this can cause weird behavior due to the fact that this is a stopgap until a bug is fixed in factorio.
|
||||||
|
rampant-safeBuildings-curvedRail=Make curved rails safe from biters
|
||||||
|
rampant-safeBuildings-straightRail=Make straight rails safe from biters
|
||||||
|
rampant-safeBuildings-bigElectricPole=Make big electric poles safe from biters
|
||||||
|
rampant-safeBuildings-railChainSignals=Make rail chain signals safe from biters
|
||||||
|
rampant-safeBuildings-railSignals=Make rail signals safe from biters
|
||||||
|
rampant-safeBuildings-trainStops=Make train stops safe from biters
|
65
settings.lua
65
settings.lua
@ -66,7 +66,70 @@ data:extend({
|
|||||||
default_value = 150,
|
default_value = 150,
|
||||||
order = "d[modifier]-a[wave]",
|
order = "d[modifier]-a[wave]",
|
||||||
per_user = false
|
per_user = false
|
||||||
}
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "rampant-safeBuildings",
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = false,
|
||||||
|
order = "e[modifier]-a[safe]",
|
||||||
|
per_user = false
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "rampant-safeBuildings-curvedRail",
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = false,
|
||||||
|
order = "e[modifier]-b[safe]",
|
||||||
|
per_user = false
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "rampant-safeBuildings-straightRail",
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = false,
|
||||||
|
order = "e[modifier]-c[safe]",
|
||||||
|
per_user = false
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "rampant-safeBuildings-bigElectricPole",
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = false,
|
||||||
|
order = "e[modifier]-d[safe]",
|
||||||
|
per_user = false
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "rampant-safeBuildings-railSignals",
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = false,
|
||||||
|
order = "e[modifier]-e[safe]",
|
||||||
|
per_user = false
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "rampant-safeBuildings-railChainSignals",
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = false,
|
||||||
|
order = "e[modifier]-f[safe]",
|
||||||
|
per_user = false
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "rampant-safeBuildings-trainStops",
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = false,
|
||||||
|
order = "e[modifier]-g[safe]",
|
||||||
|
per_user = false
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user