Page 1 of 1

Bonus GUI not grouping some turret types

Posted: Sat Aug 18, 2018 6:32 pm
by Reika
As seen here:
https://github.com/ReikaKalseki/Reika_F ... /issues/91
Image


Bilka seems to think this is a bug in the base game:
Image

Re: Bonus GUI not grouping some turret types

Posted: Sat Aug 18, 2018 7:58 pm
by Rseding91
Thanks for the report however that's working as intended.

Ammo bonuses stack up all of the different entities that use that ammo type. Turret bonuses only apply to a specific entity so it shows that specific entity. You appear to be using the turret bonus instead of the ammo bonus.

https://lua-api.factorio.com/latest/Lua ... e_modifier

vs

https://lua-api.factorio.com/latest/Lua ... k_modifier

Re: Bonus GUI not grouping some turret types

Posted: Sat Aug 18, 2018 8:31 pm
by Reika
Rseding91 wrote:Thanks for the report however that's working as intended.

Ammo bonuses stack up all of the different entities that use that ammo type. Turret bonuses only apply to a specific entity so it shows that specific entity. You appear to be using the turret bonus instead of the ammo bonus.

https://lua-api.factorio.com/latest/Lua ... e_modifier

vs

https://lua-api.factorio.com/latest/Lua ... k_modifier
I am table.deepcopy'ing the effects from the vanilla gun/laser turret damage technologies, though; why does it only half-work (ie only splits the gun-type ones)?

Code: Select all

for _,tech in pairs(data.raw.technology) do
	if tech.effects then
		local effectsToAdd = {}
		for _,effect in pairs(tech.effects) do
			if effect.type == "turret-attack" and effect.turret_id then
				local base = data.raw["ammo-turret"][effect.turret_id]
				if not base then
					base = data.raw["fluid-turret"][effect.turret_id]
				end
				if not base then
					base = data.raw["electric-turret"][effect.turret_id]
				end
				if not base then
					base = data.raw["artillery-turret"][effect.turret_id]
				end
				if not base then
					base = data.raw["artillery-wagon"][effect.turret_id]
				end
				if not base then Config.error("Tech " .. tech.name .. " set to boost turret '" .. effect.turret_id .. "', which does not exist! This is a bug in that mod!") end
				if base then
					if shouldCreateRangeTurret(base) then
						for i=1,10 do
							local effectcp = table.deepcopy(effect)--{type="turret-attack", turret_id=base.name .. "-rangeboost-" .. i, modifier=effect.modifier}
							effectcp.turret_id = base.name .. "-rangeboost-" .. i
							effectcp.effect_key = {"modifier-description." .. effect.turret_id .. "-attack-bonus"}
							table.insert(effectsToAdd, effectcp)
						end
					end
				end
			end
		end
		for _,effect in pairs(effectsToAdd) do
			table.insert(tech.effects, effect)
		end
	end
end

Re: Bonus GUI not grouping some turret types

Posted: Sat Aug 18, 2018 9:58 pm
by Rseding91
Because gun turrets use that damage bonus system and laser turrets don't.

Re: Bonus GUI not grouping some turret types

Posted: Sat Aug 18, 2018 10:34 pm
by Reika
Rseding91 wrote:Because gun turrets use that damage bonus system and laser turrets don't.
Does that mean I cannot make the "gun turret" damage upgrades affect all the rangeboost ones directly, without having them be marked separately?

Re: Bonus GUI not grouping some turret types

Posted: Sun Aug 19, 2018 1:40 am
by Rseding91
Reika wrote:
Rseding91 wrote:Because gun turrets use that damage bonus system and laser turrets don't.
Does that mean I cannot make the "gun turret" damage upgrades affect all the rangeboost ones directly, without having them be marked separately?
If you use the turret_damage system yes.