Okay I found a few other bugs, like tech wont get upgraded. - fixed it on my end
You forgot to set the welcome msg/which made me change the global variables to actually use the map settings.
Variables changed to: -- control.lua
"
local SAFE_ZONE_RADIUS = settings.global["tde-safe-zone-radius"].value -- 150-200 tiles safe zone
local NEST_SPACING = settings.global["tde-nest-spacing"].value -- 1 nest every 5 tiles
local WAVE_INTERVAL = settings.global["tde-wave-interval"].value * 60 * 60 -- 10 minutes in ticks (10 * 60 * 60 = 36000)
"
changed the line in show_welcome_messages(player)
to have
"
player.print(string.format("• Waves come every %d minutes, bosses every 10 waves",(WAVE_INTERVAL/60/60)), {r = 1, g = 0.8, b = 0})
"
so it shows the wave time
Research related, I did add
"
if game.tick % 600 == 0 then
local tech_t = game.forces.player.current_research
if (tech_t and not tech_t.researched) then
unlock_technology_with_dynamic_cost(tech_t.name)
end
end
"
to the nth 60 tick event
Added a simple:
"
script.on_event(defines.events.on_research_started, function(event)
local research = event.research -- This is a LuaTechnology object
local research_name = research.name
unlock_technology_with_dynamic_cost(research_name)
end)
"
I also changed the unlock_technology_with_dynamic_cost to be really strict, as in it will use ressources if you got it to research as far as it can or finish whatever research your currently doing
"
local inventory = base_heart.get_inventory(defines.inventory.chest)
-- Check prerequisites
for _, prereq in pairs(tech.prerequisites) do
if not prereq.researched then
return false, string.format("Missing prerequisite: %s", prereq.name)
end
end
if available_tokens <= 0 then
return false, string.format("No tokens available! Need %d.", required_tokens)
elseif available_tokens < required_tokens then
local prog = math.min(1, math.max(0, available_tokens / required_tokens))
game.forces.player.research_progress = game.forces.player.research_progress + prog
inventory.remove({name = "tde-dead-biter", count = available_tokens})
return false, string.format("Partial progress: Used %d / %d tokens.", available_tokens, required_tokens)
elseif available_tokens >= required_tokens then
-- Full research; handle completion here if needed
game.forces.player.research_progress = 1
inventory.remove({name = "tde-dead-biter", count = required_tokens})
-- Research the technology
tech.researched = true
-- Increment research count and show notifications
increment_research_count()
return true, string.format("Technology unlocked: %s (Cost: %d tokens)", tech_name, required_tokens)
end
" - this is more for inspiration if you want it :p