[MOD 0.12.26] Laser Beam Turret

Topics and discussion about specific mods
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5290
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by Klonan »

mcc1903 wrote:hi,
first: thnx for this amazing mods, vanilla laser animations are kinda boring.
but when i try to use it on 0.13 it removes all my laser turrets for some reason. i used 0.1.4 on 0.12 and just replaced it with the one i downloaded from mod portal.
also i also want to know if there is a way to remove this mod without losing all laser turrets
thnx
Hi,

You can run this script in 0.12 with the mod enabled:

Code: Select all

/c
for k, s in pairs (game.surfaces) do
				for c in s.get_chunks() do
					for key, b in pairs(s.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, name = laser-turret-purple"})) do
            local p = b.position
            local f = b.force
            b.destroy()
            s.create_entity{name = "laser-turret", position = p, force = f}								
					end
				end
			end		
and then disable the mod and load in 0.13 with the new mod on the portal
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5290
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by Klonan »

orzelek wrote:I updated the bobs version (I think) - how I can publish it?
Should I post it here and you'll upload it to mods portal?
(That version also works with vanilla btw so can replace simple one)
If you send it to me via message i can also update it (i changed the beam slightly) and then i will publish it in place of my own vanilla verison
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by orzelek »

Klonan wrote:
orzelek wrote:I updated the bobs version (I think) - how I can publish it?
Should I post it here and you'll upload it to mods portal?
(That version also works with vanilla btw so can replace simple one)
If you send it to me via message i can also update it (i changed the beam slightly) and then i will publish it in place of my own vanilla verison
Need to post it here - can't attach to PM apparently.
I didn't test it extensively but should work properly.
Attachments
Laser_Beam_Turret_Bobs_0.1.5.zip
(49.07 KiB) Downloaded 162 times
Escadin
Fast Inserter
Fast Inserter
Posts: 181
Joined: Thu Mar 17, 2016 3:15 pm
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by Escadin »

Unfortunately, I doesn't fully work. Laser beams don't seem to change with upgrade levels. Thanks for the effort anyways! :D
"--? How are commands compounded in a compounded compound command commanding compound composts." -defines.lua
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by orzelek »

Escadin wrote:Unfortunately, I doesn't fully work. Laser beams don't seem to change with upgrade levels. Thanks for the effort anyways! :D
There are two versions of base mod and for bob's one color is not upgrade based but laser turret type based.
Are you sure you are using correct one?
Escadin
Fast Inserter
Fast Inserter
Posts: 181
Joined: Thu Mar 17, 2016 3:15 pm
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by Escadin »

Well I only saw one this whole time... I'd check again but mod portal is unavailable right now. This might solve it.
"--? How are commands compounded in a compounded compound command commanding compound composts." -defines.lua
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by orzelek »

Escadin wrote:Well I only saw one this whole time... I'd check again but mod portal is unavailable right now. This might solve it.
Hmm maybe only one is up on mod portal - I'm using bob's version only so didn't check there.
Escadin
Fast Inserter
Fast Inserter
Posts: 181
Joined: Thu Mar 17, 2016 3:15 pm
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by Escadin »

orzelek wrote:
Escadin wrote:Well I only saw one this whole time... I'd check again but mod portal is unavailable right now. This might solve it.
Hmm maybe only one is up on mod portal - I'm using bob's version only so didn't check there.
Where can I download it then?
"--? How are commands compounded in a compounded compound command commanding compound composts." -defines.lua
mcc1903
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Jul 01, 2016 12:14 am
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by mcc1903 »

Klonan wrote: Hi,

You can run this script in 0.12 with the mod enabled:

Code: Select all

/c
for k, s in pairs (game.surfaces) do
				for c in s.get_chunks() do
					for key, b in pairs(s.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, name = laser-turret-purple"})) do
            local p = b.position
            local f = b.force
            b.destroy()
            s.create_entity{name = "laser-turret", position = p, force = f}								
					end
				end
			end		
and then disable the mod and load in 0.13 with the new mod on the portal
Thank you very much :)
only possible problem for future users is that i think it deleted some laser turrets that were in the boxes as the game showed 300 of them deleted but it is not an issue for me :)

also there is just a little typo on the code at the 3rd line, most ppl could find it easily but to make it perfect one should add another " before "laser-turret-purple"

for key, b in pairs(s.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, name = "laser-turret-purple"}))

thnx again for the quick response and solution
AutoMcD
Fast Inserter
Fast Inserter
Posts: 214
Joined: Wed Apr 27, 2016 5:53 pm
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by AutoMcD »

Yeah that's my only gripe with the mod, if you enable or disable the mod then you lose all turrets that were on the map. :(
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2173
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by Ranakastrasz »

Suggest/Request that we get a config option, that sets it to always use same graphic and hence turret entity. That way, you can uninstall it safely.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
mcc1903
Burner Inserter
Burner Inserter
Posts: 7
Joined: Fri Jul 01, 2016 12:14 am
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by mcc1903 »

The code Klonan posted worked perfectly and i used it to remove/fix some mods too, like replacing rails on logistics railway.
I am surprised that i am the first one to ask something like this but as the solution is easy and doesn't take much time it isn't anything major.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5290
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by Klonan »

Ranakastrasz wrote:Suggest/Request that we get a config option, that sets it to always use same graphic and hence turret entity. That way, you can uninstall it safely.

Okay so until i can figure out a safer/better way to do it, i'm only hosting the basic version on the mod portal, this won't remove the turrets when you uninstall the mod, but it also won't allow the colors to change as the turrets level up.

I will work (at some point) on a better system, but until then there will only be the (safe) basic version
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2173
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by Ranakastrasz »

Also is there a solution to the invisible lasers? Where weak biters die with no visible lasers touching them?
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5290
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by Klonan »

Ranakastrasz wrote:Also is there a solution to the invisible lasers? Where weak biters die with no visible lasers touching them?

It should be fixed in the latest version
DarkHelmet
Inserter
Inserter
Posts: 40
Joined: Sat Apr 16, 2016 5:46 pm
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by DarkHelmet »

Beware, if you want to upgrade a save with this mod to the version on the mod portal, you may need a migration script.

This version of the mod changes the entities and that causes them to be deleted on load with the mod portal version. The 0.13 version on the mod portal appears to simply change the activation of the stock entities. I create a file called "Laser_Beam_Turret_0.1.4.json" in the 0.1.6 mod's migrations folder:

Code: Select all

{
  "entity":
  [
    ["laser-turret-red", "laser-turret"],
    ["laser-turret-green", "laser-turret"],
    ["laser-turret-blue", "laser-turret"],
    ["laser-turret-purple", "laser-turret"]
  ],
  "item":
  [
    ["laser-turret-red", "laser-turret"],
    ["laser-turret-green", "laser-turret"],
    ["laser-turret-blue", "laser-turret"],
    ["laser-turret-purple", "laser-turret"]
  ]
}
This solved my turret-icide on load.
A guide to planning your factory's space requirements:
1) Figure out how much space you need, double it to be safe.
2) Wrong! There's never enough space.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5290
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by Klonan »

DarkHelmet wrote:Beware, if you want to upgrade a save with this mod to the version on the mod portal, you may need a migration script.

This version of the mod changes the entities and that causes them to be deleted on load with the mod portal version. The 0.13 version on the mod portal appears to simply change the activation of the stock entities. I create a file called "Laser_Beam_Turret_0.1.4.json" in the 0.1.6 mod's migrations folder:

Code: Select all

{
  "entity":
  [
    ["laser-turret-red", "laser-turret"],
    ["laser-turret-green", "laser-turret"],
    ["laser-turret-blue", "laser-turret"],
    ["laser-turret-purple", "laser-turret"]
  ],
  "item":
  [
    ["laser-turret-red", "laser-turret"],
    ["laser-turret-green", "laser-turret"],
    ["laser-turret-blue", "laser-turret"],
    ["laser-turret-purple", "laser-turret"]
  ]
}
This solved my turret-icide on load.

Thanks for this,
I have included it in the latest version 0.1.7
SeelenJaegerTee
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sun Aug 14, 2016 7:38 pm
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by SeelenJaegerTee »

Absolutely love this.
This should totally be how laser turrets shoot in __base__.
User avatar
stealingifs
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Aug 16, 2016 6:24 pm
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by stealingifs »

Looks cool
bk5115545
Fast Inserter
Fast Inserter
Posts: 123
Joined: Sun Apr 03, 2016 7:00 pm
Contact:

Re: [MOD 0.12.26] Laser Beam Turret

Post by bk5115545 »

Any 0.14 plans?
Post Reply

Return to “Mods”