Page 1 of 2

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

Posted: Mon Aug 17, 2015 5:07 pm
by GopherAtl
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
Long Description
Version history
Planned Features
Use in Mod Packs

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

Posted: Mon Aug 17, 2015 5:09 pm
by GopherAtl
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

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

Posted: Mon Aug 17, 2015 5:50 pm
by Adil
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".

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

Posted: Mon Aug 17, 2015 5:56 pm
by GopherAtl
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.

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

Posted: Tue Aug 18, 2015 9:22 am
by hitzu
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.

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

Posted: Tue Aug 18, 2015 12:16 pm
by Alexs
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

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

Posted: Tue Aug 18, 2015 1:17 pm
by GopherAtl
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.

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

Posted: Tue Aug 18, 2015 2:08 pm
by GopherAtl
@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?

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

Posted: Tue Aug 18, 2015 2:23 pm
by Alexs
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?
.

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

Posted: Tue Aug 18, 2015 2:26 pm
by GopherAtl
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?

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

Posted: Tue Aug 18, 2015 2:39 pm
by Alexs
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?

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

Posted: Tue Aug 18, 2015 2:42 pm
by GopherAtl
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.

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

Posted: Tue Aug 18, 2015 2:48 pm
by Alexs
.. when I start a new game with all mods, I have the gui.
how can I save the old save game?

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

Posted: Tue Aug 18, 2015 2:50 pm
by GopherAtl
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!

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

Posted: Tue Aug 18, 2015 3:08 pm
by Alexs
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.

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

Posted: Tue Aug 18, 2015 3:14 pm
by GopherAtl
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

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

Posted: Tue Aug 18, 2015 3:32 pm
by Alexs
many many thanks! IT WORKS! great :D

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

Posted: Wed Oct 21, 2015 9:28 am
by Narc
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.

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

Posted: Tue Dec 01, 2015 12:33 pm
by Peter34
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.

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

Posted: Tue Dec 01, 2015 12:58 pm
by SirRichie
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.