I fixed it by reapplying all updates in the player-joined event:
lib.events =
...
[defines.events.on_player_joined_game] = player_join_meta_event,
...
local player_join_meta_event = function(event, player_index)
-- reapply upgrades
-- the names are weird around?
local conversion_table = {
["physical-projectile-damage"] = "physical_projectile_damage",
["weapon-shooting-speed"] = "weapon_shooting_speed",
["stronger-explosives"] = "stronger_explosives",
["refined-flammables"] = "refined_flammables",
["energy-weapons-damage"] = "energy_weapons_damage",
["laser-turret-speed"] = "laser_turret_shooting_speed",
["follower-robot-count"] = "following_robot_count",
["artillery-shell-range"] = "artillery_shell_range",
["artillery-shell-speed"] = "artillery_shell_speed",
["mining-productivity"] = "mining_productivity",
["inserter-capacity-bonus"] = "inserter_stack_size",
["braking-force"] = "braking_force",
["worker-robots-speed"] = "worker_robot_speed",
["worker-robots-storage"] = "worker_robot_storage",
["research-speed"] = "research_speed",
["bounty_bonus"] = "bounty_bonus",
}
local list = get_upgrades()
for name, upgrade_level in pairs (script_data.team_upgrades) do
log(string.format("Increasing %s %d times...", name, upgrade_level))
for i=1,upgrade_level do
for k, effect in pairs (list[conversion_table[name]].effect) do
effect(event)
end
end
end
refresh_player_gui_event(event)
end
additionally, I needed to change global.non_wave_defense to global_wave_defense in the non_wave_defense_upgrades.lua:397. Idk why :/
Thanks for the gun-speed, I did not notice that before :)
Same with inserters, I did not check them yet to where they are broken, but I'll take fixes if you do ;)