Bonus GUI not grouping some turret types

Bugs that are actually features.
Post Reply
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Bonus GUI not grouping some turret types

Post 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
Image

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Bonus GUI not grouping some turret types

Post 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
If you want to get ahold of me I'm almost always on Discord.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Bonus GUI not grouping some turret types

Post 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
Image

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Bonus GUI not grouping some turret types

Post by Rseding91 »

Because gun turrets use that damage bonus system and laser turrets don't.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Bonus GUI not grouping some turret types

Post 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?
Image

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Bonus GUI not grouping some turret types

Post 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.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”