Skip to content

Commit

Permalink
Version 1.1.1 Patch 1 (#738)
Browse files Browse the repository at this point in the history
  • Loading branch information
LovelySanta authored Dec 23, 2021
2 parents 6e8239e + c93aab4 commit a2345e1
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 176 deletions.
11 changes: 11 additions & 0 deletions angelsexploration/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
---------------------------------------------------------------------------------------------------
Version: 0.3.13
Date: 23.12.2021
Bugfixes:
- Fixed crash when the bob enemies do not drop artifacts (setting disabled)
- Fixed crash when there are too many types of spawners or biters/spawner (737)
- Fixed crash when a spawner spawns something else than a unit (737)
- Fixed gathering turrets would remain idle after they all deactivated
- Fixed incorrect tips and tricks information when bob enemies do not drop artifacts
- Fixed crash when tips and tricks localisation would be too long
- Fixed crash when AAI is processing configuration changes when exploration is not initialized
---------------------------------------------------------------------------------------------------
Version: 0.3.12
Date: 19.12.2021
Changes:
Expand Down
2 changes: 1 addition & 1 deletion angelsexploration/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angelsexploration",
"version": "0.3.12",
"version": "0.3.13",
"factorio_version": "1.1",
"title": "Angel's Exploration (BETA)",
"author": "Arch666Angel",
Expand Down
7 changes: 6 additions & 1 deletion angelsexploration/prototypes/entities/biter-builder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,12 @@ function angelsmods.functions.compile_alien_data() -- creates an overview of the
for _,spawner in pairs(data.raw["unit-spawner"]) do
spawners[spawner.name] = {}
for _,spawn in pairs(spawner.result_units) do
spawners[spawner.name][spawn.unit or spawn[1]] = combine_spawn_data(spawners[spawner.name][spawn.unit or spawn[1]], calculate_spawn_data(spawn.spawn_points or spawn[2]))
local spawn_name = spawn.unit or spawn[1]
if data.raw['unit'][spawn_name] then
spawners[spawner.name][spawn_name] = combine_spawn_data(spawners[spawner.name][spawn_name], calculate_spawn_data(spawn.spawn_points or spawn[2]))
else
--log(spawn_name)
end
end
end

Expand Down
6 changes: 6 additions & 0 deletions angelsexploration/prototypes/entities/gathering-turret.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ data:extend(
offsets = {{0, 1}},
damage_type_filters = "fire"
},
trigger_target_mask =
{
"common",
"ground-unit",
"angels_gathering_turret_start_collecting_trigger"
},

open_sound = sounds.machine_open,
close_sound = sounds.machine_close,
Expand Down
2 changes: 1 addition & 1 deletion angelsexploration/prototypes/overrides/biter-updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ if mods["bobenemies"] then
for _, biter in pairs({"behemoth-biter", "behemoth-spitter"}) do
local unit = data.raw.unit[biter]
if biter then
for _,loot in pairs(unit.loot) do
for _,loot in pairs(unit.loot or {}) do
if loot.item == "small-alien-artifact" then
loot.count_min = ((loot.count_min == nil and 1) or loot.count_min) / 4 -- 4 -> 1
loot.count_max = ((loot.count_max == nil and 1) or loot.count_max) / 4 -- 12 -> 3
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
local tnt = angelsmods.functions.TNT

local function compress_localised_string(localised_string)
if type(localised_string)~='table' or localised_string[1]~="" then return localised_string end
local compressed_localised_string = {""}
for idx=2,#localised_string,19 do
local compressed_string_section = {""}
for i=idx,math.min(#localised_string, idx+19) do
table.insert(compressed_string_section, util.table.deepcopy(localised_string[i]))
end
table.insert(compressed_localised_string, compressed_string_section)
end
if #compressed_localised_string>20 then
return compress_localised_string(compressed_localised_string)
end
return compressed_localised_string
end

return function(spawner_name, spawn_data)
local spawner = data.raw["unit-spawner"][spawner_name]
if not spawner then return "Unknown entity '"..(spawner_name or 'nil').."'." end
Expand All @@ -26,11 +42,11 @@ return function(spawner_name, spawn_data)
table.insert(spawn_description, spawn_unit)
end
end
table.insert(description, spawn_description)
table.insert(description, compress_localised_string(spawn_description))

-- LOOT INFO
local loot = spawner.loot
if loot then
if loot and (#loot>0) then
local loot_description = {"", {"tips-and-tricks-description.angels-native-inhabitants-spawner-loot"}}
for _,drop in pairs(loot) do
local min = tnt.number_to_string(drop.count_min or 1)
Expand Down Expand Up @@ -64,7 +80,7 @@ return function(spawner_name, spawn_data)
table.insert(drop_description, (data.raw.item[drop.item] or {}).localised_name or {"tips-and-tricks-description.angels-native-inhabitants-spawner-loot-item-name", "__ITEM__"..drop.item.."__"})
table.insert(loot_description, drop_description)
end
table.insert(description, loot_description)
table.insert(description, compress_localised_string(loot_description))
end

return description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local create_description = require "prototypes.tips-and-tricks.1-2-x-native-hous
local navive_data = angelsmods.functions.compile_alien_data()

for spawner_idx, spawner_data in pairs(navive_data) do
local spawner_char = string.char(string.byte("a")+spawner_idx-1)
local spawner_char = string.char(string.byte("a")+math.floor(spawner_idx/26)) .. string.char(string.byte("a")+(spawner_idx%26)-1)
local spawner_name, spawn_data = next(spawner_data)
data:extend(
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
local tnt = angelsmods.functions.TNT

local function compress_localised_string(localised_string)
if type(localised_string)~='table' or localised_string[1]~="" then return localised_string end
local compressed_localised_string = {""}
for idx=2,#localised_string,19 do
local compressed_string_section = {""}
for i=idx,math.min(#localised_string, idx+19) do
table.insert(compressed_string_section, util.table.deepcopy(localised_string[i]))
end
table.insert(compressed_localised_string, compressed_string_section)
end
if #compressed_localised_string>20 then
return compress_localised_string(compressed_localised_string)
end
return compressed_localised_string
end

local deals_area_damage = function(attack_parameters)
-- checks if these attack parameters deal damange in an area around the target
return true -- TODO
Expand Down Expand Up @@ -35,7 +51,7 @@ return function(spawner_name, unit_name, evolution_factor)

-- LOOT INFO
local loot = unit.loot
if loot then
if loot and (#loot>0) then
local loot_description = {"", {"tips-and-tricks-description.angels-native-inhabitants-unit-loot"}}
for _,drop in pairs(loot) do
local min = tnt.number_to_string(drop.count_min or 1)
Expand Down Expand Up @@ -67,7 +83,7 @@ return function(spawner_name, unit_name, evolution_factor)
end
table.insert(drop_description, "[img=item."..drop.item.."]")
table.insert(drop_description, (data.raw.item[drop.item] or {}).localised_name or {"tips-and-tricks-description.angels-native-inhabitants-unit-loot-item-name", "__ITEM__"..drop.item.."__"})
table.insert(loot_description, drop_description)
table.insert(loot_description, compress_localised_string(drop_description))
end
table.insert(description, loot_description)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ local create_description = require "prototypes.tips-and-tricks.1-2-x-x-native-al
local navive_data = angelsmods.functions.compile_alien_data()

for spawner_idx, spawner_data in pairs(navive_data) do
local spawner_char = string.char(string.byte("a")+spawner_idx-1)
local spawner_char = string.char(string.byte("a")+math.floor(spawner_idx/26)) .. string.char(string.byte("a")+(spawner_idx%26)-1)
local spawner_name, spawn_data = next(spawner_data)
for unit_idx, unit_data in pairs(spawn_data) do
local unit_char = string.char(string.byte("a")+unit_idx-1)
local unit_char = string.char(string.byte("a")+math.floor(unit_idx/26)) .. string.char(string.byte("a")+(unit_idx%26)-1)
local unit_name, evolution_factor = next(unit_data)
data:extend(
{
Expand Down
16 changes: 9 additions & 7 deletions angelsexploration/src/gathering-turret.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ function gathering_turret:init_force_data(force_name)
return force_whitelist
end

global.GT_data.force_data[force_name] =
{
["turret_range"] = self:get_gathering_radius(), -- the actual gathering range of the turret
["turret_speed"] = self:get_gathering_speed(), -- the actual gathering speed (tiles/s) of this turret
["turret_whitelist"] = create_whitelist_for_force(), -- the list of items whitelisted to be collected
}
if global.GT_data and global.GT_data.force_data then
global.GT_data.force_data[force_name] =
{
["turret_range"] = self:get_gathering_radius(), -- the actual gathering range of the turret
["turret_speed"] = self:get_gathering_speed(), -- the actual gathering speed (tiles/s) of this turret
["turret_whitelist"] = create_whitelist_for_force(), -- the list of items whitelisted to be collected
}
end
end


Expand Down Expand Up @@ -422,7 +424,7 @@ end

function gathering_turret:update_gathering_target_whitelist(force_name, technology_name, allow_gathering)
-- This function updates the gathering whitelist depending on which items are researched
local force_data = global.GT_data.force_data[force_name]
local force_data = global.GT_data and global.GT_data.force_data and global.GT_data.force_data[force_name]
if force_data then
local gathering_items = self:get_whitelisted_gathering_items()
local force_whitelist = force_data["turret_whitelist"]
Expand Down
2 changes: 1 addition & 1 deletion angelsexploration/src/tips-and-tricks-triggers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ end
-- Setter functions to alter data into the data structure
-------------------------------------------------------------------------------
function tips_and_tricks_triggers:remove_trigger(force_name, trigger_name)
if force_name and global.TNT_data.force_data[force_name] then
if force_name and global.TNT_data and global.TNT_data.force_data[force_name] then
local force_triggers = global.TNT_data.force_data[force_name]["trigger_data"]
local triggers_to_remove = {}
for trigger_key,trigger_value in pairs(force_triggers) do
Expand Down

0 comments on commit a2345e1

Please sign in to comment.