[MOD 0.14.x] Macromanaged Turrets v1.1.5

Topics and discussion about specific mods
teenkertoy
Inserter
Inserter
Posts: 37
Joined: Fri Nov 11, 2016 5:03 am
Contact:

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

Post by teenkertoy »

I'm new to using mods, and tried to use this one. I'm using solar panels and accumilators in my game.

If I have your mod enabled, the accumilators are broken. They will not charge or discharge. I think the solar is broken too, since it continues to work during the night time at full capacity. I think. My steam is offline during the night and my base is still fully powered somehow.

If you need more details, let me know.
teenkertoy
Inserter
Inserter
Posts: 37
Joined: Fri Nov 11, 2016 5:03 am
Contact:

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

Post by teenkertoy »

If I use the config.lua file you supplied, without any modifications, then my accumilators and solar stuff works fine. But the vanilla turrets are not configurable with logic network stuff.

If I modify the config.lua file by adding
LogisticTurret["gun-turret"] = true

below the line:
--]]--------------------------------Add entries below this line---------------------------------]]--

then I get the problem I was describing earlier.
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 »

Semaphor wrote: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.
Not a bug; that's just how the mod works. There's an invisible requester chest under each turret that holds half of its ammo. When you empty the turret with shift-click, the script refills it with the ammo in the chest, and then robots refill the chest. The game's GUI is limited and can't show both; however, if you were to hook the turret up to a circuit network and set it to send contents, you would get an accurate count of the ammo in both inventories (which may be slightly more than you requested, if your robots' carry capacity caused them to deliver more than necessary.)
teenkertoy wrote:If I have your mod enabled, the accumilators are broken. They will not charge or discharge. I think the solar is broken too, since it continues to work during the night time at full capacity. I think. My steam is offline during the night and my base is still fully powered somehow.
I'll investigate. In the meantime, could you give me a list of all the mods you're using, and a save file with the bug if at all possible?
>nature.destroy()
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.2

Post by Macros »

Version 1.1.2 has been released:
Bugfix:
  • Fixed accumulators neither charging nor discharging when a logistic turret was part of their electric network.
Thank you, teenkertoy, for the bug report.
>nature.destroy()
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.3

Post by Macros »

Version 1.1.3 has been released:
Bugfix:
  • Hotfix for a crash when changing the config file.
>nature.destroy()
Sinehmatic
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Nov 05, 2016 3:44 am
Contact:

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

Post by Sinehmatic »

So this mod not only doesn't work out of the box, you have to individually add each turret to the config files in order for them to work? Even if the turret is the vanilla one? Why doesn't this mod have the vanilla turret already in the config files? It's pasted as a comment but why not just have it ready to go?
Sinehmatic
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Nov 05, 2016 3:44 am
Contact:

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

Post by Sinehmatic »

How tf do you even use this mod?

I've copied the vanilla turret example into the "table" area in the config file yet dropping a turret within a roboport's logistics network area does not automatically fill it as I understand a "default request" should do.
Sinehmatic
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Nov 05, 2016 3:44 am
Contact:

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

Post by Sinehmatic »

I can't get robots to drop more than 5 magazines in a turret and how do you even copy settings to paste them in the first place? How are people supposed to just figure out how this mod works?
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.3

Post by Macros »

I keep meaning to write a verbose readme, but I never seem get around to it.

Adding a turret to the config file is a one-time thing that "enables" the mod for that turret type. Doing so essentially turns those turrets into requester chests that can only request ammo. Just like regular requester chests, you have to tell them what to request before they'll do it.

Rather than using the standard requester chest GUI, I have created a custom GUI that you can open by using the logistic turret remote, which is an item that you have to craft. The recipe is unlocked when you research the logistic system. Drag the remote over your turrets to use it.

For convenience, turrets can be configured with a "default request," which means you don't have to use the remote to tell them what to request after building them, since it is set automatically.

Robots still have to deliver the ammo to the turrets, which means there must be robots and ammo available in the logistic network. Also, the logistic turret remote actually has to be unlocked before robots will go to work delivering ammo.

The vanilla gun turret is not configured by default because this mod is primarily aimed at other mods' turrets, most of which could be considered "upgrades" of the gun turret, and might therefore have more advanced features. (Like, say, integration with the logistic and circuit networks.) That said, there's nothing preventing it from working with the vanilla gun turret.

The fact that turrets only hold half of the ammo you think they should is an unfortunate limitation, and is actually a bugfix. In older versions, turrets would keep all of the ammo they were requesting in their own inventory... and just as much in their invisible requester inventory, causing each turret to store twice as much ammo as you told it to.

Pretty much all other features are functions of the logistic turret remote, so once you have that unlocked, it should (hopefully) be self-explanatory. But if you have any more questions, let me know.



As a side note, I think I've finally figured out how to save requests and wires in blueprints. The code is pretty raw at the moment, so it'll be a while before a release (it might have to wait for Factorio v0.15, in fact.) I'm also planning on optimizing the way turrets in "set requests" mode work, which is the largest source of lag in this mod at the moment. Since this requires a feature being added in v0.15, it, too, will have to wait.
>nature.destroy()
Sinehmatic
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Nov 05, 2016 3:44 am
Contact:

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

Post by Sinehmatic »

The fact that turrets only hold half of the ammo you think they should is an unfortunate limitation, and is actually a bugfix. In older versions, turrets would keep all of the ammo they were requesting in their own inventory... and just as much in their invisible requester inventory, causing each turret to store twice as much ammo as you told it to.
I don't understand. A turret will only hold half of its request? So I should make the request double what I actually need? Or are all the magazines there just split between two inventories, one of which is invisible?
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.3

Post by Macros »

Sinehmatic wrote:Or are all the magazines there just split between two inventories, one of which is invisible?
This is exactly it. I know it's counter-intuitive, so the best thing to do is ignore it and let the script worry about managing the inventories (which is, after all, the point of the mod.) The custom GUI will show their "real" request, which will be about twice the amount that they keep in their inventory.

You can also use circuit networks to get an accurate read of your turrets' inventory. The hidden inventory is taken into account when the turret is in "send contents" mode.
>nature.destroy()
fakecrusader
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Feb 20, 2017 9:15 pm
Contact:

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

Post by fakecrusader »

There seems to be a problem with turret health when they are macromanaged. I found I was having massive auto-repair issues and it turned out that robots were constantly repairing damaged turrets even when they were restored to full health. I turned off the mod and once the damage was repaired this issue did not recur.

Could you look into this?
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.4

Post by Macros »

Version 1.1.4 has been released:
  • Features:
    • Turrets' requests and circuit network wires can now be saved in blueprints.
    • Turrets now remember what they were requesting when they die and a ghost is created.
    • Wires between ghost turrets are now properly shown.
    • Added the "TimeFactor" setting to the config file.
    • Added an "UninstallMod" setting to the config file.
  • Bug fixes:
    • Fixed a bug that caused turrets to lose their logistic and circuit network functionality. Any affected turrets will be restored with whatever default settings you have configured them with.
    • Related to the above, fixed a bug that caused construction robots to think turrets were damaged when they were not.
    • Fixed a potential crash when mining the circuit network interface.
    • Fixed the desyncs, again, for real this time.
    • The clipboard is no longer cleared when loading a world in singleplayer.
  • Scripting:
    • Added "get_default_configuration" to the remote interface.
    • Added "get_request_slot" to the remote interface.
    • Added "get_circuit_mode" to the remote interface.
    • Added "get_custom_label" to the remote interface.
    • Added "change_custom_label" to the remote interface.
    • Added "mod_info" to the remote interface. This function can only be called from the in-game console.
    • Renamed "reload_config" to "reset_mod". This function can now only be called from the in-game console.
    • For documentation on this mod's remote interface, please click here.
  • Known limitations:
    • Circuit network wires are only saved in blueprints if the turret has undergone a "wire update" after the wire was attached. Wire updates occur whenever a turret is selected with the logistic turret remote, and all turrets are updated whenever a world is loaded. The circuit connector light will turn green after the turret has been updated (assuming you have circuit connector sprites enabled). When Factorio v0.15 is released, it will be possible to update turrets simply by hovering your mouse over them, making the process nearly invisible.
Wires are now supported in blueprints. There's all kinds of weird quirks involved, though. Generally speaking, you'll need to use the logistic turret remote to select a turret after adding or removing a wire, and then wait a full second for it to update. You don't need to do anything in the turret's GUI, just opening it is enough. Once Factorio version 0.15 is out, this step won't be necessary.

Also, I finally found a solution to the desync issue that has plagued me for so long. I added a new option to the config file (the "TimeFactor" setting mentioned above) to make sure it stays fixed. The default setting of 5 should work in most cases, but if it still desyncs for you, try changing it to a higher value. I'm still not entirely sure why the desyncs occur in the first place - it's as though the on_tick function edits tables more rapidly than the server updates players.

The disappearing circuit connectors were my fault. I had removed some "redundant" safeguards based on the erroneous assumption that entities with a max_health of 0 could not be destroyed.

The code also underwent another major rewrite. Once the control file hit 130KB, I had to split it up into modules; the length was starting to annoy even me.
>nature.destroy()
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

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

Post by Mooncat »

Hi Macros, I'm working on integrating your mod for my new turrets, and I have successfully turned them into logistic turrets with your "configure_logistic_turret" API.

But I have a little problem. If I provide a default request instead of "true", the Autofill mod will only recognize the ammo of that request, even though I have set multiple ammo in the default set for that turret in Autofill.
e.g. I have set ammo "A", "B", "C" (both are in the same ammo category) for the turret in Autofill. If I provide "A" as the default request in your mod, Autofill cannot automatically insert "B" or "C" if my character has run out of "A".

Is there anyway to keep Autofill recognizing the other ammo? :mrgreen:
Maybe don't change the settings in Autofill for the turret if the settings have already existed? Or an additional Boolean parameter in configure_logistic_turret to determine whether the default request should override Autofill?
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.4

Post by Macros »

Thanks for pointing that out. I'll try to make it a bit smarter about how and when it decides to update Autofill profiles. It should be possible to do without adding an extra parameter to configure_logistic_turret. For now, creating a personal set (using Autofill's "insertset" remote call) should allow you to bypass the override.
>nature.destroy()
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

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

Post by Nexela »

Autofill 2.0 will have some non backwards compatible changes to the remote interface. However it will be a lot easier to add/edit/remove stuff like this :)
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.5

Post by Macros »

Version 1.1.5 has been released:
  • Autofill integration improvements:
    • Autofill profiles are only generated for turrets that don't already have one. Existing profiles are no longer overwritten.
    • When generating a profile, the mod will attempt to match the turret to an existing item set. Only named item sets are considered.
    • This mod is now aware of any custom item sets if that set is already being used by at least one other object (custom item sets are created through Autofill's "setItemArray" remote call).
    • If a suitable item set cannot be found, then the turret will be autofilled with any ammo it is capable of using. Priority goes to whatever ammo you happen to have the most of in your inventory.
    • A turret's default request (or lack of one) no longer has any bearing on what it can be autofilled with.
You'll probably have to re-apply your Autofill settings to any saved games, Mooncat, but they won't be overwritten again. The generated profiles are now more generic, utilizing all the ammo a turret is capable of using, but in no special order. However, if a predefined item set exists for a turret's ammo category, then it will use that instead. This is only done once per turret, at most, and the changes will persist even if this mod is uninstalled (but obviously not if Autofill is uninstalled).
Nexela wrote:Autofill 2.0 will have some non backwards compatible changes to the remote interface. However it will be a lot easier to add/edit/remove stuff like this :)
I figured that would be the case, and I'm all for it. These changes were made knowing full well that they would likely break when Autofill 2.0 came out.
>nature.destroy()
Zarnoo
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Thu Mar 31, 2016 6:01 pm
Contact:

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

Post by Zarnoo »

Is there a way in the config file to set a turret to request multiple ammo types and specify a priority that they use the loaded ammo ? I have some ammo which is expensive, but killer. The problem is that if I can't make enough I'd rather have the guns loaded with something than not loaded at all.

Z
Zazulio
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Apr 03, 2017 8:56 pm
Contact:

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

Post by Zazulio »

I am having an issue with the latest version of this mod that is preventing me from loading my turrets using inserters. Basically, my inserters just keep feeding ammunition into the invisible chest underneath the turret instead of the turret itself, which is somewhat problematic! First, the turrets are not receiving any ammo, presumably making them functionally useless (though they may take the ammo as needed)? Second, the chest is taking all the ammo on the belt! The turrets themselves usually only hold ten ammo before they stop taking ammo from the belt, which allows the belt to feed every turret in the line pretty easily. But since the invisible chests don't have a limit on how much they will take, they are sucking up all the ammo on the line, meaning that only my first turret on the belt is receiving any ammo at all.

Basically, this mod seemingly breaks the ability to feed my turrets inserters, which is a big problem. It leaves me totally defenseless up until I am able to build logistics bots or laser turrets (and/or requires me to build circuit conditions for every single turret)! I would very much like to use your mod, but I just won't be able to unless there is a simple workaround or fix for this. It's game breaking.

EDIT -- Just tested, and the invisible chests are NOT feeding the turrets ammo as needed, so loading them with inserters is functionally useless right now. The ammunition ends up in the requester chest, but is NOT distributed to the weapon. This is a completely game breaking bug. I really have no choice but to uninstall it until there's a fix.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

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

Post by Mooncat »

Macros wrote:Version 1.1.5 has been released:
  • Autofill integration improvements:
    • Autofill profiles are only generated for turrets that don't already have one. Existing profiles are no longer overwritten.
    • When generating a profile, the mod will attempt to match the turret to an existing item set. Only named item sets are considered.
    • This mod is now aware of any custom item sets if that set is already being used by at least one other object (custom item sets are created through Autofill's "setItemArray" remote call).
    • If a suitable item set cannot be found, then the turret will be autofilled with any ammo it is capable of using. Priority goes to whatever ammo you happen to have the most of in your inventory.
    • A turret's default request (or lack of one) no longer has any bearing on what it can be autofilled with.
Thanks! It is working now. :D

But as Zazulio said above, now the inserters keep inserting ammo to the invisible chest, no matter how big the turret is. (I have a 1.5x1.5 turret and a 3x3 turret, both have the same issue.)
Tho it is a bit different in my case. The ammo will be automatically transferred to the turret, at slightly lower rate than a normal inserter. But even if the turret is full, the chest still consumes ammo slowly, infinitely.
Would you mind fixing it? :D
Post Reply

Return to “Mods”