1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-11 14:49:32 +02:00

checking unit behaviour

This commit is contained in:
Aaron Veden 2019-10-06 11:57:33 -07:00
parent 7f22a29b22
commit e96ae3759b
5 changed files with 1038 additions and 1022 deletions

View File

@ -53,6 +53,7 @@ local DEFINES_COMMAND_ATTACK_AREA = defines.command.attack_area
local DEFINES_COMMAND_GO_TO_LOCATION = defines.command.go_to_location
local DEFINES_COMMMAD_COMPOUND = defines.command.compound
local DEFINES_COMMAND_FLEE = defines.command.flee
local DEFINES_COMMAND_STOP = defines.command.stop
local DEFINES_COMPOUND_COMMAND_RETURN_LAST = defines.compound_command.return_last
@ -313,7 +314,7 @@ local function rebuildMap()
map.moveCommand = {
type = DEFINES_COMMAND_GO_TO_LOCATION,
destination = map.position,
radius = 2,
radius = 6,
pathfind_flags = { prefer_straight_paths = true },
distraction = DEFINES_DISTRACTION_BY_ENEMY
}
@ -332,6 +333,10 @@ local function rebuildMap()
ticks_to_wait = 360
}
map.stopCommand = {
type = DEFINES_COMMAND_STOP
}
map.compoundSettleCommand = {
type = DEFINES_COMMMAD_COMPOUND,
structure_type = DEFINES_COMPOUND_COMMAND_RETURN_LAST,

View File

@ -81,9 +81,16 @@ if settings.startup["rampant-enableSwarm"].value then
for k, unit in pairs(data.raw["unit"]) do
if (string.find(k, "biter") or string.find(k, "spitter")) and unit.collision_box then
unit.collision_box = {
{unit.collision_box[1][1] * 0.40, unit.collision_box[1][2] * 0.40},
{unit.collision_box[2][1] * 0.40, unit.collision_box[2][2] * 0.40}
{unit.collision_box[1][1] * 0.20, unit.collision_box[1][2] * 0.20},
{unit.collision_box[2][1] * 0.20, unit.collision_box[2][2] * 0.20}
}
-- if unit.collision_mask == nil then
-- unit.collision_mask = {"player-layer", "train-layer", "not-colliding-with-itself"}
-- else
-- unit.collision_mask[#unit.collision_mask+1] = "not-colliding-with-itself"
-- end
unit.ai_settings = { destroy_when_commands_fail = false, allow_try_return_to_spawner = false, path_resolution_modifier = -8, do_seperation = false }
end
end
end
@ -91,10 +98,11 @@ end
if settings.startup["rampant-enableShrinkNestsAndWorms"].value then
for k, unit in pairs(data.raw["unit-spawner"]) do
if (string.find(k, "biter") or string.find(k, "spitter")) and unit.collision_box then
unit.collision_mask = {"player-layer", "train-layer", "not-colliding-with-itself"}
unit.collision_box = {
{unit.collision_box[1][1] * 0.50, unit.collision_box[1][2] * 0.50},
{unit.collision_box[2][1] * 0.50, unit.collision_box[2][2] * 0.50}
}
}
end
end

View File

@ -73,4 +73,7 @@ mapSettings.unit_group.max_member_slowdown_when_ahead = constants.UNIT_GROUP_MAX
mapSettings.unit_group.max_group_slowdown_factor = constants.UNIT_GROUP_SLOWDOWN_FACTOR
data.raw["utility-constants"]["default"].unit_group_pathfinding_resolution = -8
data.raw["utility-constants"]["default"].unit_group_collision_mask = {"player-layer", "train-layer", "not-colliding-with-itself"}

View File

@ -1,7 +1,7 @@
{
"name" : "Rampant",
"factorio_version" : "0.17",
"version" : "0.17.28",
"version" : "0.17.29",
"title" : "Rampant",
"author" : "Veden",
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",

File diff suppressed because it is too large Load Diff