[MOD 0.14.x] Macromanaged Turrets v1.1.5

Topics and discussion about specific mods
User avatar
Macros
Inserter
Inserter
Posts: 23
Joined: Mon Mar 07, 2016 11:42 am
Contact:

[MOD 0.14.x] Macromanaged Turrets v1.1.5

Post by Macros »

Type: Mod
Name: Macromanaged Turrets
Description: Create turrets that request ammo from the logistic network.
Version: v1.1.5
Release: 2017-4-1
Tested-With-Factorio-Version: 0.14.22
Website: https://mods.factorio.com/mods/Subach/M ... ed_Turrets
Long description
Mod compatibility
Uninstallation
Known limitations
Version history
Last edited by Macros on Sat Apr 01, 2017 3:37 pm, edited 17 times in total.
>nature.destroy()

User avatar
Galacticruler
Long Handed Inserter
Long Handed Inserter
Posts: 56
Joined: Sat Apr 16, 2016 5:18 pm
Contact:

Re: [MOD 0.12.29+] Macromanaged Turrets v1.0.0

Post by Galacticruler »

Macros wrote:

Code: Select all

script.on_init(function()
	remote.call("Macromanaged_Turrets", "add_logistic_turret", "turret-name", "ammo-name", #)
end)

script.on_load(function()
	remote.call("Macromanaged_Turrets", "add_logistic_turret", "turret-name", "ammo-name", #)
end)
in this section, what does the # value do?
Also, does the ammo-name value differ at all from the one listed in the long description? Or does the mod auto-detect the ammo the turret can load?
PC is best.

User avatar
Macros
Inserter
Inserter
Posts: 23
Joined: Mon Mar 07, 2016 11:42 am
Contact:

Re: [MOD 0.12.29+] Macromanaged Turrets v1.0.0

Post by Macros »

Galacticruler wrote:
Macros wrote:

Code: Select all

script.on_init(function()
	remote.call("Macromanaged_Turrets", "add_logistic_turret", "turret-name", "ammo-name", #)
end)

script.on_load(function()
	remote.call("Macromanaged_Turrets", "add_logistic_turret", "turret-name", "ammo-name", #)
end)
in this section, what does the # value do?
Also, does the ammo-name value differ at all from the one listed in the long description? Or does the mod auto-detect the ammo the turret can load?
The # represents a number - it's the amount you want the turret to request. Bots will carry this amount to the turret and stop when the count is met.

A turret can only request one type of ammo at a time. Replace "ammo-name" with the item name of the ammo you want the turret to request. For instance, "basic-bullet-magazine" or "piercing-shotgun-shell". This sets the default request that new turrets of that type are created with.
All three arguments (turret name, ammo name, amount) need to be present, and the turret needs to be able to use the ammo you are telling it to request.

Adding a turret via remote call is functionally identical to adding it to the table in the configuration file. It's just more convenient for your users.
Last edited by Macros on Sat Apr 30, 2016 8:59 pm, edited 1 time in total.
>nature.destroy()

NoriSilverrage
Fast Inserter
Fast Inserter
Posts: 159
Joined: Mon Mar 21, 2016 1:19 pm
Contact:

Re: [MOD 0.12.29+] Macromanaged Turrets v1.0.0

Post by NoriSilverrage »

Wow this looks really nice.

Supercheese
Filter Inserter
Filter Inserter
Posts: 841
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: [MOD 0.12.29+] Macromanaged Turrets v1.0.0

Post by Supercheese »

Nice mod!
Macros wrote:Known issues
  • The logistic turret remote makes a lot of noise if you click-and-drag it around.
I believe that can be fixed with the addition of something like:

Code: Select all

local function onPutItem(event)

if global.tick ~= nil and global.tick > event.tick then 
	return 
end
global.tick = event.tick + 5

...
This is a method that test mode used that I copied for Orbital Ion Cannon.

GameCharmer
Inserter
Inserter
Posts: 38
Joined: Tue Oct 20, 2015 2:34 pm
Contact:

Re: [MOD 0.12.29+] Macromanaged Turrets v1.0.0

Post by GameCharmer »

I'm writing a compatibility & balancing patch that makes several mods play nice together, and I'd love to be able to add this to the patch. Is there any way to define additions outside of control.lua? I'm currently using the data object to detect which bits and pieces of various mods are loaded, then apply changes there via data-final-fixes.

User avatar
Macros
Inserter
Inserter
Posts: 23
Joined: Mon Mar 07, 2016 11:42 am
Contact:

Re: [MOD 0.12.29+] Macromanaged Turrets v1.0.0

Post by Macros »

GameCharmer wrote:I'm writing a compatibility & balancing patch that makes several mods play nice together, and I'd love to be able to add this to the patch. Is there any way to define additions outside of control.lua? I'm currently using the data object to detect which bits and pieces of various mods are loaded, then apply changes there via data-final-fixes.
Unfortunately not. However, it is possible to do almost the same thing in control.lua. During on_init, use this code:

Code: Select all

global.MyTurretList = {}
for name, entity in pairs(game.entity_prototypes) do
  if entity.type == "ammo-turret" then
    table.insert(global.MyTurretList, name)
  end
end
... to iterate over all entity prototypes, and when it finds an ammo-turret (from any mod), add it to a global table.

Then, during on_init and on_load, do a remote call for all your table entries:

Code: Select all

for k, name in pairs(global.MyTurretList) do
  remote.call("Macromanaged_Turrets", "add_logistic_turret", name, <"some-ammo-name">, <#>)
end
Getting the right ammo into the remote call might be tricky; the simplest option would probably be to make a white-list of all the turrets from all the mods you plan on working with, with corresponding ammo for each one. You could also use the white-list to filter out any turrets from mods that you haven't accounted for, instead of doing the remote call for all of them.
Last edited by Macros on Sat Apr 30, 2016 9:12 pm, edited 3 times in total.
>nature.destroy()

User avatar
Macros
Inserter
Inserter
Posts: 23
Joined: Mon Mar 07, 2016 11:42 am
Contact:

Re: [MOD 0.12.29+] Macromanaged Turrets v1.0.1

Post by Macros »

Version 1.0.1 has been released:
Bugfixes:
  • Fixed bots sometimes delivering the wrong item after using the remote
  • Fixed a crash when clicking Save
Last edited by Macros on Sat Apr 30, 2016 7:08 pm, edited 1 time in total.
>nature.destroy()

GameCharmer
Inserter
Inserter
Posts: 38
Joined: Tue Oct 20, 2015 2:34 pm
Contact:

Re: [MOD 0.12.29+] Macromanaged Turrets v1.0.1

Post by GameCharmer »

Thanks Macros! I'll give it a shot. :D

User avatar
Macros
Inserter
Inserter
Posts: 23
Joined: Mon Mar 07, 2016 11:42 am
Contact:

Re: [MOD 0.12.29+] Macromanaged Turrets v1.0.2

Post by Macros »

Version 1.0.2 has been released:
Optimizations:
  • Idle turrets are checked less often
  • Smoothed the distribution of checks to prevent noticeable lag spikes
Future plans:
I plan on adding the ability to connect logistic turrets to circuit networks once Factorio v0.13 is released. Hopefully it will be fairly straightforward.

I am aware of the issue with the turret GUI - the way images scale was changed in Factorio v0.12.31, and is producing some odd results. Version 0.13 should bring some improvements to the way GUIs work, so I'm going to hold off on fixing it until then. For now, the GUI remains usable, just ugly.
>nature.destroy()

User avatar
Macros
Inserter
Inserter
Posts: 23
Joined: Mon Mar 07, 2016 11:42 am
Contact:

Re: [MOD 0.12.33+] Macromanaged Turrets v1.0.3

Post by Macros »

Version 1.0.3 has been released:
Fixes:
  • Fixed the turret GUI display for Factorio v0.12.33
  • GUIs now close when their turret is destroyed, mined, or marked for deconstruction
  • GUIs no longer persist through a save and reload
  • Fixed a method by which a turret could be set to request 0 items
  • Cleaned up the codebase
As a result of these changes, the minimum required Factorio version has been increased to v0.12.33.

I know I said I wouldn't be fixing the GUI until Factorio v0.13 came out. This post by judos convinced me to change my mind and give it a whirl. The end result turned out to be almost, if not exactly, the same as it was prior to Factorio v0.12.31.
>nature.destroy()

User avatar
Macros
Inserter
Inserter
Posts: 23
Joined: Mon Mar 07, 2016 11:42 am
Contact:

Re: [MOD 0.12.33+] Macromanaged Turrets v1.0.4

Post by Macros »

Version 1.0.4 has been released:
Fixes:
  • Fixed multiplayer desync issue
Features:
  • Added TimerInterval setting to the config file
>nature.destroy()

User avatar
Lightning_Bird
Inserter
Inserter
Posts: 29
Joined: Fri May 06, 2016 5:59 pm
Contact:

Re: [MOD 0.12.33+] Macromanaged Turrets v1.0.4

Post by Lightning_Bird »

If anyone finds it useful here's
AutoFill DyTech code
Macromanaged Turrets DyTech code
Here's my github.
You can find there polish locale etc.

Your game is too dark? Use this
terrain files to make your game look nice and cozy.
Looking for a cool mod pack? Check out this!

NoriSilverrage
Fast Inserter
Fast Inserter
Posts: 159
Joined: Mon Mar 21, 2016 1:19 pm
Contact:

Re: [MOD 0.12.33+] Macromanaged Turrets v1.0.4

Post by NoriSilverrage »

Heya, is this going to be updated for 0.13?

User avatar
Macros
Inserter
Inserter
Posts: 23
Joined: Mon Mar 07, 2016 11:42 am
Contact:

Re: [MOD 0.12.33+] Macromanaged Turrets v1.0.4

Post by Macros »

Yes, I have an update almost ready to publish. I'm sorry it's taking me so long; I haven't had a stable internet connection in weeks. I've spent the time completely overhauling the GUI to use the new selection tool item, and have started work on the circuit network aspect. Turns out it's not very straightforward at all.

The plan is to fix my internet sometime next week.
>nature.destroy()

User avatar
DUMBHA
Inserter
Inserter
Posts: 23
Joined: Wed Mar 09, 2016 9:38 am
Contact:

Re: [MOD 0.12.33+] Macromanaged Turrets v1.0.4

Post by DUMBHA »

Just curious. Was a update for this mod still planned? Or has RL stuff put a hold on it.

User avatar
Macros
Inserter
Inserter
Posts: 23
Joined: Mon Mar 07, 2016 11:42 am
Contact:

Re: [MOD 0.14.x] Macromanaged Turrets v1.1.0

Post by Macros »

I'm sorry for the tremendous delay. Version 1.1.0 is now available for download. For the time being, it's not on the mod portal, and I haven't yet updated the GitHub repo. You can find the download link in the attachments section of the first post.

The changelog is too large to post here, so please click this link to view it.
Last edited by Macros on Fri Nov 04, 2016 7:00 pm, edited 1 time in total.
>nature.destroy()

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.14] Macromanaged Turrets v1.1.0

Post by Nexela »

Wow, That is not a change log, it is a change novel.


Great work on this mod, hopefully I will get a chance to try it out this weekend.

User avatar
Macros
Inserter
Inserter
Posts: 23
Joined: Mon Mar 07, 2016 11:42 am
Contact:

Re: [MOD 0.14.x] Macromanaged Turrets v1.1.1

Post by Macros »

Version 1.1.1 has been released:
Bugfixes:
  • Fixed the configure_logistic_turret remote call. This function now only takes two arguments. The second argument follows the same format as config file entries.
  • Deleting a surface that had ghost turrets will no longer cause a crash when loading that world.
  • Turrets will now regain their custom labels when rebuilt from a ghost.
With this release, the mod is now available on the mod portal.
>nature.destroy()

Semaphor
Inserter
Inserter
Posts: 30
Joined: Fri May 20, 2016 2:27 pm
Contact:

Re: [MOD 0.14.x] Macromanaged Turrets v1.1.1

Post by Semaphor »

0.14.19 bug. Looks like, despite my efforts, a turret will always show a 10 stack of ammo even though the amount should be 20 (logistics request set to 20). However, there appears to be multiple stacks of 10; one displayed and one hidden. When a turret is given 20 ammo, 10 appears. When you shift-click to pick up the turret contents, it picks up 10. But you can do that twice; once for the initial 10 stack, and another time for the hidden 10 stack.

Reproducible all the time.

Post Reply

Return to “Mods”