[MOD 0.12.x] Autowire - configurable automated pole wiring

These mods are not game-changing, but enhance the gameplay by helping you with useful functions.
Mods like showing the current game-time, keep track over your resources, rail-laying...

[MOD 0.12.x] Autowire - configurable automated pole wiring

Postby GopherAtl » Mon Aug 17, 2015 5:07 pm

Autowire

Image
Image

Info:
Adds a gui that lets you select which wires will be connected automatically when placing any electric power poles. Automatically connecting red/green requires you have the wires in your inventory, while copper are still free, as normally.


License
License
Copyright (c) 2016 GopherAtl, narc0tiq, golfmiketango

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Long Description
Long Description
Something I threw together when I got tired of connecting up lots of red and green wires between separated outposts. The "autowire" button will appear in the top-left; clicking it toggles a panel that opens to it's right with checkboxes for copper, red, and green. Check or uncheck items to enable or disable auto-connection of that type of wire/cable when placing new power poles.

Auto-connecting red and green wires will still cost wire, which will be taken from your inventory, otherwise none will be placed; copper is still free, as always.

Version history
Version history
  • 0.1.3 2015-8-18: fixed bug that caused gui not to appear when loading an old save file after adding the mod and resulted in a crash on placing poles.
  • 0.1.2 2015-8-18: gui tweaked, now more compact, and on top instead of left, so works better with other mods' guis
  • 0.1.1 2015-8-17: minor update, now supports anything based on electric-pole, and supports a list of exceptions in config.lua
  • 0.1.0 2015-8-17: Initial version released into wild for testing by people-who-aren't-me


Planned Features
Planned Features
  • I got nothin'. I'm open to suggestions...


Use in Mod Packs
Use in Mod Packs
Go ahead. You don't need to ask. You're free to include it in any mod pack either as-is, or with changed recipes/graphics, or whatever. Comments to this thread linking the mod pack are encouraged/appreciated, as it helps me keep track of who's using the mod, but that's it.

[spoiler=post format notes]Hopefully the format is satisfactory, if any automatic parsing systems have a problem with anything let me know.
Last edited by GopherAtl on Wed Jun 01, 2016 12:31 am, edited 8 times in total.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby GopherAtl » Mon Aug 17, 2015 5:09 pm

Threw this together partly to relive myself of the tedium of running along stringing red and green wires when I'm playing with large-scale circuit networks that connect distant outposts, and partly to try my hand at the factorio modding api's gui systems.

I tried to make it support multiplayer, but have not yet been able to test that, so if you do test it, please report the results XD
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby Adil » Mon Aug 17, 2015 5:50 pm

GopherAtl wrote:way to auto-detect other mods' added power poles?

Just in case. All but the most exotic modded poles should have type=="electric-pole".
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
User avatar
Adil
Filter Inserter
Filter Inserter
 
Posts: 929
Joined: Fri Aug 15, 2014 8:36 pm

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby GopherAtl » Mon Aug 17, 2015 5:56 pm

Adil wrote:
GopherAtl wrote:way to auto-detect other mods' added power poles?

Just in case. All but the most exotic modded poles should have type=="electric-pole".


:facepalm: I am the derp for not thinking of that at the time XD

Though after thinking about it, some mods might add poles that have their own customized wiring behaviors? in which case, a way to at least make an exception might be wise. A table of exceptions in the config file should work, though.

:edit: and now it does. 0.1.1 released, it now has a config.lua with an (initially empty) array "wire_exceptions," anything not named in that array of type electric-pole will be auto-wired.

If anyone knows of any mods off-hand that have power poles that should be excepted from autowiring behavior for whatever reason, let me know and I'll add them to the default wire_exceptions list.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby hitzu » Tue Aug 18, 2015 9:22 am

Great mod! Thank you :)

I can suggest another way to implement auto wiring without any additional GUI. Making it work on large distances so the player connects the first and the last power pole and all intermediate poles would be connected automatically by a shortest way if possible.
hitzu
Filter Inserter
Filter Inserter
 
Posts: 474
Joined: Tue Sep 09, 2014 5:55 pm

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby Alexs » Tue Aug 18, 2015 12:16 pm

Unfortunately the mod is not working with me. Perhaps a problem with the mod: better electric pole? with me also no GUI is displayed ... your idea is clever. Sorry, Translated with Google
Alexs
Fast Inserter
Fast Inserter
 
Posts: 107
Joined: Sun Sep 07, 2014 9:46 am

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby GopherAtl » Tue Aug 18, 2015 1:17 pm

hitzu wrote:Great mod! Thank you :)

I can suggest another way to implement auto wiring without any additional GUI. Making it work on large distances so the player connects the first and the last power pole and all intermediate poles would be connected automatically by a shortest way if possible.


while I can see the utility if that feature, you're basically asking me to implement pathfinding and graph traversal on what could be a truly massive scale, it's doable, even doable in a way that doesn't bog the game down while it processes, but it's not something I can implement trivially.

Alexs wrote:Unfortunately the mod is not working with me. Perhaps a problem with the mod: better electric pole? with me also no GUI is displayed ... your idea is clever. Sorry, Translated with Google


I don't know why no gui is displayed. Interactions with better electric pole are possible, but that shouldn't affect the gui. I will test the two together later today when I get a chance.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby GopherAtl » Tue Aug 18, 2015 2:08 pm

@Alexs Just tested it with the unofficial update of "Better Electric Pole" here, by lishget, as the original version by elmi has not been updated to 0.12.x, and it seems to work fine, no problems

Image

So I'm not sure what's happening for you.

Can you tell me what version of the game you're playing, and list all the mods you're using? Are all the latest versions?
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby Alexs » Tue Aug 18, 2015 2:23 pm

Thank you for the fast reaction. I have just tested the small electricity pylon. he has the same problem. So it is not at the other mod. the message is the following:

Error while running event handler:
--autowire--/control.lua 58: attempt to index Local "settings" (a nil value)

...

Edit: I have just turned off all mods except for color-coding. still the same error. Factoriop has stood up to date. Alledings the 64-bit version ... a problem?
.
Last edited by Alexs on Tue Aug 18, 2015 2:37 pm, edited 1 time in total.
Alexs
Fast Inserter
Fast Inserter
 
Posts: 107
Joined: Sun Sep 07, 2014 9:46 am

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby GopherAtl » Tue Aug 18, 2015 2:26 pm

Alexs wrote:Thank you for the fast reaction. I have just tested the small electricity pylon. he has the same problem. So it is not at the other mod. the message is the following:

Error while running event handler:
--autowire--/control.lua 58: attempt to index Local "settings" (a nil value)

....


hmm. Are you sure you're running the latest version, autowire_0.1.2? How are you placing the poles? Is this in single-player?
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby Alexs » Tue Aug 18, 2015 2:39 pm

I have just turned off all mods except for color-coding. still the same error. Factoriop has stood up to date. Alledings the 64-bit version ... a problem?

yes - singleplayer ...


NEWS: when I start a new game with all mods, I have the gui.
how can I save the old save game?
Last edited by Alexs on Tue Aug 18, 2015 2:47 pm, edited 1 time in total.
Alexs
Fast Inserter
Fast Inserter
 
Posts: 107
Joined: Sun Sep 07, 2014 9:46 am

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby GopherAtl » Tue Aug 18, 2015 2:42 pm

Alexs wrote:I have just turned off all mods except for color-coding. still the same error. Factoriop has stood up to date. Alledings the 64-bit version ... a problem?

yes - singleplayer ...


Hmm. I run a 64-bit version too, so that wouldn't be it. Will test with color-coding now, not used that mod before, some strange interaction may be happening...

:edit: Aha! I found the problem. Nothing to do with color-coding; the recent versions don't work when added to an already-existing save, after I changed it to make it properly support multi-player.

Will work on a fix now, hopefully won't take long.
Last edited by GopherAtl on Tue Aug 18, 2015 2:48 pm, edited 1 time in total.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby Alexs » Tue Aug 18, 2015 2:48 pm

.. when I start a new game with all mods, I have the gui.
how can I save the old save game?
Alexs
Fast Inserter
Fast Inserter
 
Posts: 107
Joined: Sun Sep 07, 2014 9:46 am

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby GopherAtl » Tue Aug 18, 2015 2:50 pm

Alexs wrote:.. when I start a new game with all mods, I have the gui.
how can I save the old save game?

gimme just a minute, found and fixing the problem now!
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby Alexs » Tue Aug 18, 2015 3:08 pm

great! I look forward to the new version. The Nixie tubes are very good! thanks for the quick troubleshooting. wow! concentrated expertise! Thanks for the work.
Alexs
Fast Inserter
Fast Inserter
 
Posts: 107
Joined: Sun Sep 07, 2014 9:46 am

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby GopherAtl » Tue Aug 18, 2015 3:14 pm

Hrm. A proper fix is going to take a bit of figuring, not sure why it's not working now.

So this isn't a proper release, just a temporary patch.

Load this version and then place any kind of electric pole, and the gui should be added. It will work properly from there. (see attachment to this post)

:edit: Scratch that, found the problem and fix almost immediately after this post XD packing up a proper 0.1.3 release with the fix now which will properly handle being added to existing saves. Will update the OP and this post with links when I'm done (within 2 minutes) and remove the attachment here at that time.

:edit: and done. Linky to 0.1.3
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby Alexs » Tue Aug 18, 2015 3:32 pm

many many thanks! IT WORKS! great :D
Alexs
Fast Inserter
Fast Inserter
 
Posts: 107
Joined: Sun Sep 07, 2014 9:46 am

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby Narc » Wed Oct 21, 2015 9:28 am

I've got a pull request for the Factorio 0.12.11 update and an unofficial autowire v0.1.4 update (direct download). Please prefer GopherAtl's official update, whenever that occurs.
User avatar
Narc
Filter Inserter
Filter Inserter
 
Posts: 267
Joined: Mon Feb 11, 2013 7:25 am

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby Peter34 » Tue Dec 01, 2015 12:33 pm

I've only now upgraded from 0.12.10 to 0.12.19, and the fixed autowire 1.3 gives an error message that ends the game.
Peter34
Smart Inserter
Smart Inserter
 
Posts: 1083
Joined: Mon Nov 10, 2014 12:44 pm
Location: Europe

Re: [MOD 0.12.x] Autowire - configurable automated pole wiring

Postby SirRichie » Tue Dec 01, 2015 12:58 pm

Peter34 wrote:I've only now upgraded from 0.12.10 to 0.12.19, and the fixed autowire 1.3 gives an error message that ends the game.


I think that the content of the error message and details on the actions that cause it will prove helpful.
SirRichie
Fast Inserter
Fast Inserter
 
Posts: 244
Joined: Wed Feb 25, 2015 4:50 pm

Next

Return to Helper mods

Who is online

Users browsing this forum: No registered users and 2 guests