[posila] Making multiple beams from the same turrets / strange behavior

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 400
Joined: Thu Dec 21, 2017 8:02 am
Contact:

[posila] Making multiple beams from the same turrets / strange behavior

Post by ownlyme »

When you create multiple beams from the same turret and at least 1 of the beam durations is equal to the cooldown, only 1 beam gets fired.
But when you set the cooldown to 1 higher than the beam durations, the target random offset gets randomized every shot.
At least it's not noticeable that the beam gets interrupted for 1 tick...
I don't really want to disable the target random offset either...

My other idea was to add the second beam to the action of the first beam, but that results in the second beam being active for 1 interval longer than the first beam...

I hope you can fix this, help me or implement the glow in the base game, cause it really improves visual aesthetics
unknown.png
unknown.png (260.28 KiB) Viewed 4012 times

Code: Select all

data.raw["electric-turret"]["laser-turret"]. attack_parameters =
	{
		type = "beam",
		cooldown = 21,
		range = 24,
		source_direction_count = 64,
		source_offset = {0, -3.423489 / 4},
		damage_modifier = 2,
		ammo_type =
		{
			category = "laser-turret",
			energy_consumption = "1kJ",
			action =
			{
				{
					type = "direct",
					action_delivery =
					{
						type = "beam",
						beam = "laser-beam",
						max_length = 24,
						duration = 20,
						source_offset = {0, -1.31439 }
					}
				},
				{
					type = "direct",
					action_delivery =
					{
						type = "beam",
						beam = "laser-beam-light",
						max_length = 24,
						duration = 20,
						source_offset = {0, 0.0 }
					}
				}
			}
		}
	}
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5148
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Making multiple beams from the same turrets / strange behavior

Post by Klonan »

ownlyme wrote:
Mon Jun 10, 2019 2:12 pm
I hope you can fix this, help me or implement the glow in the base game, cause it really improves visual aesthetics
Why not just add the light to the base game beam? You can specify multiple layers for the light sprite

User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 400
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: Making multiple beams from the same turrets / strange behavior

Post by ownlyme »

then the glow would be around the beam and not on the floor under the beam.
https://mods.factorio.com/mod/laser_fix ... looks a bit weird
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance

User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 400
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: Making multiple beams from the same turrets / strange behavior

Post by ownlyme »

just noticed that the two beams solution (at the turret) only works when it is shooting at the player... as soon as i change it's force and spawn a behemoth biter, i just get 1 beam again...

btw: the second beam shows up for 1 interval, but disappears then.
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5148
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Making multiple beams from the same turrets / strange behavior

Post by Klonan »

ownlyme wrote:
Mon Jun 10, 2019 2:22 pm
then the glow would be around the beam and not on the floor under the beam.
You can shift the sprite down in the sprite definition

User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 400
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: Making multiple beams from the same turrets / strange behavior

Post by ownlyme »

i know ;) didn't really try it but that would create a fixed offset, which would still be off when the turrets shoot at the feet (which in itself is also a bit weird ;) )
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance

User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 400
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: Making multiple beams from the same turrets / strange behavior

Post by ownlyme »

Guess i'll decrease the damage interval of my beam to 1/4, that seems to make the delayed glow unnoticeable.
It will probably eat quite some ups, especially with mods that monitor the entity_damaged event ..

Still hoping for a better solution though ;)
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance

User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 400
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: Making multiple beams from the same turrets / strange behavior

Post by ownlyme »

Guess the laser defense equipment defeated me...
The second beam in the beam prototype gets ignored and when added to the equipment, it flickers a bit...
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Making multiple beams from the same turrets / strange behavior

Post by posila »

Thanks for the report.
It should be fixed for 0.17.50

User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 400
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: [posila] Making multiple beams from the same turrets / strange behavior

Post by ownlyme »

Thanks, i updated my mod.
Equipment beams also work perfectly now.
From the download count i'm getting i think you should have added it to the base game ;)
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance

User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 400
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: [posila] Making multiple beams from the same turrets / strange behavior

Post by ownlyme »

Wha
posila wrote:
Mon Jun 17, 2019 7:52 am
Thanks for the report.
It should be fixed for 0.17.50
What about a runtime tint for beams? (I guess based on the force's/player's color?)
Would allow some cool rainbow effects by changing the player color every tick :D

Code: Select all

/c 
	r = 100
	g = 0
	b = 100
	i=0
script.on_event(defines.events.on_tick, function(event) 
	i=i+1
	if i <= 100 then 
		b = b-1
	elseif i <= 200 then 
		g=g+1
	elseif i <= 300 then
		r=r-1
	elseif i <= 400 then 
		b=b+1
	elseif i <= 500 then 
		g=g-1
	elseif i <= 600 then 
		r=r+1
	end
	if i == 600 then
		i=0
	end
	game.players[1].color = {r=r/100,g=g/100,b=b/100}
end)
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance

Post Reply

Return to “Resolved Problems and Bugs”