Page 4 of 5

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Sat Jul 02, 2016 10:25 am
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

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Sat Jul 02, 2016 10:26 am
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

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Sat Jul 02, 2016 11:46 am
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.

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Sat Jul 02, 2016 12:08 pm
by Escadin
Unfortunately, I doesn't fully work. Laser beams don't seem to change with upgrade levels. Thanks for the effort anyways! :D

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Sat Jul 02, 2016 12:56 pm
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?

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Sat Jul 02, 2016 1:06 pm
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.

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Sat Jul 02, 2016 1:24 pm
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.

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Sat Jul 02, 2016 1:42 pm
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?

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Sun Jul 03, 2016 9:36 am
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

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Sun Jul 03, 2016 11:42 pm
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. :(

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Mon Jul 04, 2016 1:10 am
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.

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Mon Jul 04, 2016 8:14 am
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.

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Mon Jul 04, 2016 7:51 pm
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

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Mon Jul 04, 2016 11:47 pm
by Ranakastrasz
Also is there a solution to the invisible lasers? Where weak biters die with no visible lasers touching them?

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Tue Jul 05, 2016 10:34 am
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

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Fri Jul 08, 2016 1:20 am
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.

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Sat Jul 09, 2016 12:35 pm
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

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Mon Aug 22, 2016 1:56 pm
by SeelenJaegerTee
Absolutely love this.
This should totally be how laser turrets shoot in __base__.

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Sun Aug 28, 2016 12:56 am
by stealingifs
Looks cool

Re: [MOD 0.12.26] Laser Beam Turret

Posted: Wed Aug 31, 2016 8:08 pm
by bk5115545
Any 0.14 plans?