[MOD 0.15|0.14] Foreman - Blueprint Manager 2.0.1

Topics and discussion about specific mods
justarandomgeek
Filter Inserter
Filter Inserter
Posts: 302
Joined: Fri Mar 18, 2016 4:34 pm
Contact:

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.0.2|0.2.6

Post by justarandomgeek »

While working with irinix to build some circuit prints in a sandbox world, we discovered that Foreman trips over some nils while loading/exporting prints if you don't have a character. Exporting the book as a whole seems to work, but very little else (that we tried) did!
Peppe
Fast Inserter
Fast Inserter
Posts: 223
Joined: Fri Nov 28, 2014 6:48 pm
Contact:

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.0.2|0.2.6

Post by Peppe »

I was taking a look at your interfaces and wondering if you could support calling them in a mod?

I'd like to setup my defaults using something like this in a separate config/settings type mod:

Code: Select all

script.on_event(defines.events.on_player_created, function(event)
	if game.active_mods["Foreman"] ~= nil then
		remote.call("foreman", "show")
		remote.call("foreman", "setButtonOrder", "DERL")
                -- todo find remote call for settings (blueprint to cursor, overwrite, close on load blueprint)
                -- todo include some blueprints
	end
end
But get:
Error while running event on_player_created from my mod
Error when running interface function foreman.show: __Foreman__/control.lua:1282: attempt to index field 'player' (a nil value)

Your interface assumes it is comming from the console where it has access to the player calling the command? Could you support passing in the player id ?
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.0.2|0.2.6

Post by Choumiko »

Updated to Updated to Foreman 1.1.0
  • added button/hotkey to mirror blueprint/ active blueprint in a book (mirroring along the other axis is just mirroring and rotating by 180°)
  • added buttons to replace an entity with another one (to upgrade belts, assemblers, etc)
  • cicking Delete blueprint with a blueprint on the cursor overwrites the stored blueprint
  • changed remote interface to accept an optional LuaPlayer argument
PiggyWhiskey wrote:I'm having an issue importing the blueprint strings from viewtopic.php?f=194&t=31575
I could import them fine. Only issue i found is that the strings are books and Foreman fails silently when trying to load a book into a blueprint. Added a message for that.
GTrak wrote:Would be nice if can make group.
Belt Stuffs, Buildings, Rails, Outpost, Etc...
I don't think that's going to happen anytime soon (if at all). 0.15 will add a blueprint library and there are blueprint books already which can be used to organize your prints. With 0.15 Foreman will probably only over a way to export/import blueprints from/into the library (if possible by the API) and do blueprint manipulation (mirror/replace and anything else i can come up with)
self-same-spot
Inserter
Inserter
Posts: 34
Joined: Fri Mar 04, 2016 11:50 am

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.0|0.2.6

Post by self-same-spot »

If I import a blueprint that has round ( ) or curly { } brackets in its name into Foreman, renaming it via Foreman removes these characters. One workaround is to load it to blueprint → rename using vanilla Factorio GUI → delete an old variant from Foreman → import again. Of course I could use other a different naming scheme, but still this bug is a (minuscule) nuisance.

Oh, and another one: if you open Foreman with a shortcut in a new game before any technology is researched, changing any settings caused this error message to appear in the console:

Code: Select all

__Foreman__/control.loa:1056: attempt to index field 'foremanFlow' (a nil value)
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.0.2|0.2.6

Post by Choumiko »

Updated to Updated to Foreman 1.1.1
  • Hotkey to toggle the GUI only works after Blueprints are researched
  • Allowed more characters in blueprints (Only . \ " and ' are removed)
self-same-spot
Inserter
Inserter
Posts: 34
Joined: Fri Mar 04, 2016 11:50 am

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.1|0.2.6

Post by self-same-spot »

Thanks for a quick update! :thumbsup:
self-same-spot
Inserter
Inserter
Posts: 34
Joined: Fri Mar 04, 2016 11:50 am

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.1|0.2.6

Post by self-same-spot »

Another small suggestion:

I find storing and loading blueprint books with Foreman a terrific way to organize a library. But for some reason clicking the 'Load to blueprint' button on a stored book (a blue book icon with a yellow arrow) works only if I click while holding an empty book. Unlike loading a single blueprint it doesn't work if I simply click it.

So my suggestion is to make both cases behave identically, so that it would be possible to keep one blueprint and one book in a toolbar with minimum hassle:

1) A simple click (with an empty hand) on the Load button should load a book into an empty book in toolbar/inventory, if it has enough blank blueprints in it.
2) A new setting "Overwrite books", that if enabled should clear all blueprints in a targeted book, load everything from a stored book and leave blank blueprints in place.
self-same-spot
Inserter
Inserter
Posts: 34
Joined: Fri Mar 04, 2016 11:50 am

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.1|0.2.6

Post by self-same-spot »

Found a small bug (Foreman 1.1.1): flipping a blueprint that consists only of concrete tiles only causes this error to appear:

Code: Select all

__Foreman__/control.lua:879: bad argument #1 to 'pairs' (table expected, got nil)
Sinehmatic
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Nov 05, 2016 3:44 am
Contact:

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.1|0.2.6

Post by Sinehmatic »

How do I import blueprints from one save to another? Where to blueprint files get exported to?
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.1|0.2.6

Post by Nexela »

Blueprints are exported to %appdata%/factorio/script-output/blueprint-string

To import a blueprint open the .blueprint file in a text editor, and copy it to the clipboard. Then click on the + icon in foreman and ctrl-v (paste) into the text field.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.2

Post by Choumiko »

Updated to Foreman 1.1.2
  • clicking the load button on a stored book with an empty cursor now loads the book into a book with enough empty blueprints in the inventory/toolbar
  • added option to overwrite blueprint books when clicking load with an empty cursor, defaults to false
  • The "load to cursor" and "close gui after loading to cursor" settings now also apply for blueprint books
  • mirroring blueprints now also mirrors tiles
  • fixed error when replacing rails in a blueprint
  • fixed wrong filename being printed when exporting blueprints
Sinehmatic wrote:How do I import blueprints from one save to another? Where to blueprint files get exported to?
Nexela got it right. I added a short section in the readme/info on the mod portal
self-same-spot
Inserter
Inserter
Posts: 34
Joined: Fri Mar 04, 2016 11:50 am

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.2

Post by self-same-spot »

Thanks! Tile mirroring now works fine.

I'm still not quite sure book workflow is as smooth as when working with blueprints, and I'm afraid some of my suggestions in my previous post were ill-thought-out.

I have found a number of issues with the requirement that a book should have empty blueprints before Foreman can load a stored book into it. It pretty much necessitates having a max. amount of empty blueprints in a quickbar book. Which means that loading a small book (with only 2-5 blueprints) forces a user to scroll through all empty blueprints to reach the ones they need.

Also the "Overwrite blueprint books" setting actually only allows to append blueprints to a book, and only if it has enough empty blueprints in it: e.g., Foreman doesn't load a book with 10 blueprints into a book with 2 saved and 8 empty ones, instead it complains that it needs 2 more empty blueprints. I find this behavior rather counter-intuitive and not very useful (usually books are specialized collections, you would rarely, if ever, want to mix them), and it also stems from that requirement.

So my hopefully final suggestion is:
1. By default Foreman should load stored books into any book that is either empty or has any amount of empty blueprints in it, preferring the one in the quickbar.
2. Loading should remove all empty blueprints from a target book, leaving only non-empty ones from a stored book.
3. If "Overwrite blueprint books" is enabled, everything in a target book should be removed and replaced with the contents of a stored book.

I hope I am not tiring you with this. :) I know the devs are going to add a blueprint library in 0.15, but that is still at least several months away, and just like with Auto Trash the mod is likely to remain a more convenient and useful alternative.
self-same-spot
Inserter
Inserter
Posts: 34
Joined: Fri Mar 04, 2016 11:50 am

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.2

Post by self-same-spot »

Also I wanted to suggest adding a chat message about where blueprints are exported to, but I see that you have already did this. But for some reason now exporting triggers this error (tested in singleplayer):

Code: Select all

__Foreman__/control.lua:1122: bad argument #0 to 'print' (Wrong number of arguments.)
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.2

Post by Choumiko »

self-same-spot wrote:Also the "Overwrite blueprint books" setting actually only allows to append blueprints to a book, and only if it has enough empty blueprints in it: e.g., Foreman doesn't load a book with 10 blueprints into a book with 2 saved and 8 empty ones, instead it complains that it needs 2 more empty blueprints. I find this behavior rather counter-intuitive and not very useful (usually books are specialized collections, you would rarely, if ever, want to mix them), and it also stems from that requirement.
Uhm, yes. Somehow i forgot to clear the blueprints if the setting is active :D
self-same-spot wrote: 1. By default Foreman should load stored books into any book that is either empty or has any amount of empty blueprints in it, preferring the one in the quickbar.
2. Loading should remove all empty blueprints from a target book, leaving only non-empty ones from a stored book.
3. If "Overwrite blueprint books" is enabled, everything in a target book should be removed and replaced with the contents of a stored book.
1. Once i addressed 3. that's how it will work. When loading without a book on the cursor it looks for a book with enough empty blueprints first, if it doesn't find one and overwrite Books is set it looks for any book with enough blueprints and clears them. Quickbar always gets searched first.
2. Removing empty blueprints sounds a bit annoying since you'd have to reinsert the blueprints if you want to load a book with more blueprints than the last one. I think i can reorder the book so that the empty ones are at the end.
3. That's what it's intended to do (and will in the next release)
self-same-spot wrote:Also I wanted to suggest adding a chat message about where blueprints are exported to, but I see that you have already did this. But for some reason now exporting triggers this error (tested in singleplayer):

Code: Select all

__Foreman__/control.lua:1122: bad argument #0 to 'print' (Wrong number of arguments.)
I changed the chat message to only show for the player who clicked export (and to only save on this players pc), must have missed something there.
self-same-spot
Inserter
Inserter
Posts: 34
Joined: Fri Mar 04, 2016 11:50 am

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.2

Post by self-same-spot »

Choumiko wrote:1. Once i addressed 3. that's how it will work. When loading without a book on the cursor it looks for a book with enough empty blueprints first, if it doesn't find one and overwrite Books is set it looks for any book with enough blueprints and clears them. Quickbar always gets searched first.
2. Removing empty blueprints sounds a bit annoying since you'd have to reinsert the blueprints if you want to load a book with more blueprints than the last one. I think i can reorder the book so that the empty ones are at the end.
Here's a use case that I was basing my suggestion on and that would still be quite inconvenient:

------
A user has stored three books in Foreman titled "F2", "F10" and "F30" with 2, 10 and 30 blueprints respectively. They have only one book with no blueprints at all in their inventory, and want to pin it to the quickbar to use as a universal tool in the same way they can use one pinned blueprint: empty cursor → Foreman hotkey → mouse over → click → place (assuming Set cursor is enabled) → repeat. Obviously they have to enable overwriting for this to work.

They try to load F2 and according to your 1. fail with a warning "Need 2 more blueprints". So they place two blanks into the book and successfully load F2. Then they want to use F10 - same thing, an error "Need 8 more blueprints", they add them to the book, Foreman overwrites two that were already there. OK. By now they should realize that if they want to also be able to use F30, they need to keep 30 blueprints in their book all the time, so they add blanks to the book until it's full. But now, according to your 2., if they load F2 again they would have a book with 28 blanks, so to use the blueprints from F2 they would have to scroll mouse wheel down 28 notches at worst until they reach them.
------

My thought was to scrap this requirement of having enough blueprints (blank or not) in a book before loading into it in all cases and also to remove blanks on loading, which would make this particular and IMO very natural to a Foreman user scenario totally smooth, pain-free and non-GMO 100% organic free-range. ;) Even if a book has no blueprints at all, with Overwrite enabled Foreman should be able to load into it.

I'm not sure how it should work If Overwrite is off, only allow to load into books with no or only empty blueprints, or also allow to append blueprints to a book if there's enough space in the book. The latter does overwrite books in a sense, so maybe another option is needed here.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.2

Post by Choumiko »

self-same-spot wrote:------
A user has stored three books in Foreman titled "F2", "F10" and "F30" with 2, 10 and 30 blueprints respectively. They have only one book with no blueprints at all in their inventory, and want to pin it to the quickbar to use as a universal tool in the same way they can use one pinned blueprint: empty cursor → Foreman hotkey → mouse over → click → place (assuming Set cursor is enabled) → repeat. Obviously they have to enable overwriting for this to work.

They try to load F2 and according to your 1. fail with a warning "Need 2 more blueprints". So they place two blanks into the book and successfully load F2. Then they want to use F10 - same thing, an error "Need 8 more blueprints", they add them to the book, Foreman overwrites two that were already there. OK. By now they should realize that if they want to also be able to use F30, they need to keep 30 blueprints in their book all the time, so they add blanks to the book until it's full. But now, according to your 2., if they load F2 again they would have a book with 28 blanks, so to use the blueprints from F2 they would have to scroll mouse wheel down 28 notches at worst until they reach them.
------
Use cases help a lot, haven't been really playing since the steam release :D

As it works right now (my version): When overwrite is on and you load a book the setup blueprints are always in the active slot and at the front of the books inventory, so the remaining inconvenience would be that you can't scroll from the last setup blueprint to the first one as quickly? I scrolled a book with all slots filled and as far as i could tell the order stayed the same, so you don't end up in a situation where the first slot is a setup blueprint, followed by 5 blanks before the next setup one, etc.

My biggest issue with throwing out empty blueprints is inventory space. In your F2 example you'd have to have 28 free slots in your inventory, which if i remember correctly was something i nearly never had when playing. But since powerarmor now increases inventory size (it does i think) and books actually save inventory space this might no longer be an issue?
self-same-spot wrote: My thought was to scrap this requirement of having enough blueprints (blank or not) in a book before loading into it in all cases and also to remove blanks on loading, which would make this particular and IMO very natural to a Foreman user scenario totally smooth, pain-free and non-GMO 100% organic free-range. ;) Even if a book has no blueprints at all, with Overwrite enabled Foreman should be able to load into it.

I'm not sure how it should work If Overwrite is off, only allow to load into books with no or only empty blueprints, or also allow to append blueprints to a book if there's enough space in the book. The latter does overwrite books in a sense, so maybe another option is needed here.
The thing with a book without enough blueprints/no blueprints at all is: where should Foreman load them to? I guess i could search the inventory for empty blueprints and insert them, or maybe even craft them if the ingredients are available (what i really don't want to do)

When overwrite is off it will only load it if there are enough empty blueprints in it (if clicked with a book on the cursor) or look for a book with enough empty ones if clicked without (effectively merging/appending books)
I guess an option to remove/insert blueprints as needed should resolve most of the issues.
self-same-spot
Inserter
Inserter
Posts: 34
Joined: Fri Mar 04, 2016 11:50 am

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.2

Post by self-same-spot »

Choumiko wrote:the remaining inconvenience would be that you can't scroll from the last setup blueprint to the first one as quickly?
Yep. I know it's not the end of the world, but I am sure every single user who loads a small book (less than 5-10 blueprints) into a book with all slots filled with blanks is going to be confused for a couple of seconds when they scroll too far and see an unexpected empty cursor. Some may even lose their patience, not scroll all the way to the first blueprint and decide the mod is bugged.
Choumiko wrote:My biggest issue with throwing out empty blueprints is inventory space.
Choumiko wrote:The thing with a book without enough blueprints/no blueprints at all is: where should Foreman load them to? I guess i could search the inventory for empty blueprints and insert them, or maybe even craft them if the ingredients are available (what i really don't want to do)
Oh, sorry that I missed this part. Blueprint clutter in inventory would indeed be undesirable. I was thinking of just deleting blueprint items outright or creating them out of thin air. Blueprints have a purely nominal cost of 1 advanced circuit anyway, and Foreman already circumvents it: you would need 100 adv. circuits to store 100 blueprints, but you only need 1 with Foreman, since copies are loaded and stored with no cost at all. Same would be with books: you would need to craft 30 blueprints and 1 book only once to store any kind of a book any number of times (save designs into blueprints, fill a book with them, store, clean them, repeat), and after that blank blueprints would be created by Foreman on demand with no cost and (for balance) destroyed with no compensation when loading books. Thankfully, blueprints and books are not used as an ingredient in anything.
Kenira
Fast Inserter
Fast Inserter
Posts: 111
Joined: Fri Nov 04, 2016 10:21 am
Contact:

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.2

Post by Kenira »

Choumiko wrote:
self-same-spot wrote:Also I wanted to suggest adding a chat message about where blueprints are exported to, but I see that you have already did this. But for some reason now exporting triggers this error (tested in singleplayer):

Code: Select all

__Foreman__/control.lua:1122: bad argument #0 to 'print' (Wrong number of arguments.)
I changed the chat message to only show for the player who clicked export (and to only save on this players pc), must have missed something there.
I also get this error since i updated to 1.1.2. It does still create a file, not sure if i should worry about the integrity of the exported file?
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.2

Post by Choumiko »

Kenira wrote:I also get this error since i updated to 1.1.2. It does still create a file, not sure if i should worry about the integrity of the exported file?
The exported file is fine, it is written in the line before the error.
I'll have a fix out maybe tomorrow, once i have decided how to deal with self-same-spots last post.

Had one idea at work:
Option to let Foreman handle empty blueprints for the player: Foreman would take care that there's at most 1 empty blueprint in the players inventory/quickbar/cursor, if it finds more they get destroyed and Foreman remembers the number. When loading a book from Foreman it will only complain about not enough blueprints if it doesn't have enough "virtual" blueprints.
If the player creates a blueprint by hand Foreman will insert an empty one into the inventory if there's at least one virtual blueprint.

Benefits are that there's no inventory cluttering and i can easily remove empty blueprints from a book so that scrolling through can be done easily.

I don't want Foreman to create blueprints at no cost (even if i have to agree that it really is more of a symbolic price)
self-same-spot
Inserter
Inserter
Posts: 34
Joined: Fri Mar 04, 2016 11:50 am

Re: [MOD 0.13|0.14] Foreman - Blueprint Manager 1.1.2

Post by self-same-spot »

Choumiko wrote:Foreman would take care that there's at most 1 empty blueprint in the players inventory/quickbar/cursor, if it finds more they get destroyed and Foreman remembers the number. When loading a book from Foreman it will only complain about not enough blueprints if it doesn't have enough "virtual" blueprints.
If the player creates a blueprint by hand Foreman will insert an empty one into the inventory if there's at least one virtual blueprint.
Personally I don't have any qualms about cloning blueprints: if someone takes their time to "dupe" them via Foreman, then congrats, they have found an awkward way to have the same limitless storage of blueprints that the mod grants out of the box. But I have to say your solution with keeping tabs on a blueprint balance is quite ingenious and I really like it, I take my hat off. :thumbsup:

So IIUC if after creating several empty books and loading books from Foreman into them the mod warns me that I've run out of my budget, I would be able to "feed" it a bunch more by crafting empty blueprints by hand, right?

I would also suggest showing a chat message on enabling the option that explains this mechanic (and/or a mouseover popup in the options).
Post Reply

Return to “Mods”