The reason of not calling "force.reset_technology_effects()" is because of my experience in using some other mods before. This command may remove those recipes, effects, modifiers, etc, which are introduced by script but not traditional data.raw code.
Any mod that controls values that way is purely setup to fail. Quite a few mods call force.reset_technology_effects()
.
By replacing as "(turret_modifier[tech_lv] or 1)", in some of the "Stronger explosives X" tech you will actually have "Rocket turret damage: +100%". This will be too much. Please check if this exist in some of the levels.
- Currently Schall's Rocket Turrets have a +10% Damage bonus.
- Currently "Stronger explosives 1" is researched (and was researched before the update and migration), the second one is not yet research.
- Currently Grenades have a +25% damage bonus.
The reason of not calling "force.reset_technology_effects()" is because of my experience in using some other mods before. This command may remove those recipes, effects, modifiers, etc, which are introduced by script but not traditional data.raw code. For example, "Creative Mode 0.16" tab will be removed by this command. (Not sure about current versions.) So compatible with other mods are reduced.
I read this somewhere ago (forgot where), so I learned it by heart. But I can give this up, if it ends up causing more trouble than what it benefits.
Checking in the current modpack for calls to reset_technology_effects
shows that all these mods call it on quite a few various occasions:
- angelsbioprocessing
- angelspetrochem
- angelsrefining
- angelssmelting
- AsphaltRoads
- boblogistics
- bobplates
- CharcoalBurner
- CompressedFluids
- OverMods
- pycoalprocessing
- PyCoalTBaA
- SantasNixieTubeDisplay
- scattergun_turret
- WhistleStopFactories
In addition, I do have Creative Mode for testing here in SP before deploying to the server and accessing it's Creative Items tab is trivial via its switch in its menu.
So it looks like quite a variety of mods call force.reset_technology_effects()
on a variety of conditions (some upon every load, every configuration change, etc...) so if some script did assume that the engine's determination of the bonuses was not correct then it seems that they would fail pretty poorly.
Within "Stronger explosives" techs, "Rocket turret damage: +x" should be 10% (lv 1-2), 20% (lv 3-5), 40% (lv 6), 70% (lv 7).
Indeed they are.
These values come exactly from corresponding "Gun turret damage: +x". Want to know if some other mods may have interfered with this.
Does not appear so, no mod but Schall's mods are listed as having touched those.
The migration script appears to be iterating over the physical-projectile-damage-#
technologies, looking for the turret-attack
effect type for gun-turret
's, then storing that modified value in the table under the given tech level. it then iterates over stronger-explosives-#
, seemingly looking for the highest researched technology of it from 1 to 7 and setting the binding named dmg_bonus
for each of those technologies. At the end of this loop it then calls force.set_turret_attack_modifier("Schall-rocket-turret", dmg_bonus)
, and this is the part that seems superfluous as force.reset_technology_effects()
will handle that properly and correctly already. As for why the turret_modifier[tech_lv]
is nil
just means that the value must not be found in the physical-projectile-damage-1
technologyas
stronger-explosives-1is the only researched one, and checking the
physical-projectile-damage-1technology seems to have an upgrade for bullet damage flat out, but nothing for
gun-turretspecifically (it does however have upgrades for
gun-turret-2and others though). Checking this modpack for any mod that touches
"gun-turret"as a modifier turret_id appears to be this mod as well as Rampant Arsenal, which removes the
gun-turretmodifier from the
physical-projectile-damage-#researches and puts them on a dedicated
gun-turret-damage-#` research.
Thus it appears that Rampant Arsenal is just moving the modifier that your migration is looking for to a dedicated research.
In addition, a noticed bug is the line elseif tech_lv == 7 then
in the migration, that will unconditionally add the value of tech level 7 since it is not testing if tech.researched
is true first like the first conditional is, so the corresponding force.set_turret_attack_modifier("Schall-rocket-turret", dmg_bonus)
call would be too high anyway if this migration worked to start with (which it does not seem it will considering the host of mods that are already calling force.reset_technology_effects()
on updates and other events anyway).