[MOD 0.13.X] Killkrog's Blueprint Manager

Topics and discussion about specific mods
User avatar
madpav3l
Long Handed Inserter
Long Handed Inserter
Posts: 81
Joined: Sat Oct 31, 2015 10:24 pm
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by madpav3l »

Hi Killkrog,
could you add a button for this?

Code: Select all

/c remote.call("KBlueprints", "Fix Old Blueprint")
Hold a blueprint from versions before 0.12.32 and it will be updated. Make sure to re-save the blueprint.
Thanks

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3714
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by DaveMcW »

Killkrog wrote:When it comes to factorioblueprints.com I have absolutely no control over the content there. The site is exclusively maintained by Dave.
When the blueprint books were a new thing, I even contacted both Dave and Choumiko and tried to convince them to unify the exported strings between our three mods, but they completely ignored me.
Nice mod Killkrog! Sorry for ignoring you, but your proposed format was kinda big and I am all about making strings smaller.

I have nothing to do with factorioblueprints.com. I agree it sucks to have an obsolete site making blueprints look bad, but I don't have the time to build anything better.

Kryzeth
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Jul 25, 2015 9:07 am
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Kryzeth »

Hello, Mr. Person! First of all, thank you for the great mod, loving the blueprint flipping feature!

Anyways, I am the Kryzeth person from the mod portal who commented about using a mod that gave blueprints and bots from the start, without giving the research, so it seems you added a player command to forcibly enable blueprint manager.
Of course, it wasn't exaactly what I was aiming at; I had actually been asking for a config option of sorts within the mod itself that would allow blueprint manager at start, if a player wanted. It could default to off, so only the core mod-players would find it and change it, but it would be reeeally helpful to have!

It's not much of a problem, if it would be too difficult to do, but thanks either way!

Peppe
Fast Inserter
Fast Inserter
Posts: 223
Joined: Fri Nov 28, 2014 6:48 pm
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Peppe »

Kryzeth wrote:Hello, Mr. Person! First of all, thank you for the great mod, loving the blueprint flipping feature!

Anyways, I am the Kryzeth person from the mod portal who commented about using a mod that gave blueprints and bots from the start, without giving the research, so it seems you added a player command to forcibly enable blueprint manager.
Of course, it wasn't exaactly what I was aiming at; I had actually been asking for a config option of sorts within the mod itself that would allow blueprint manager at start, if a player wanted. It could default to off, so only the core mod-players would find it and change it, but it would be reeeally helpful to have!

It's not much of a problem, if it would be too difficult to do, but thanks either way!
Arn't config changes lost when mods update?

With the command method, you could detect if KBM is installed from your mod and run the command from your mod. If it is not installed your mod does nothing.

User avatar
Killkrog
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Thu Jun 09, 2016 1:04 pm
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Killkrog »

madpav3l wrote:Could you add a button for this?
Implemented for next update.
DaveMcW wrote:Sorry for ignoring you, but your proposed format was kinda big and I am all about making strings smaller.
I have nothing to do with factorioblueprints.com.
You still could have said a word ;)
And about the site, I was sure it was your site oO
Sorry for the mixup!
Kryzeth wrote:I had actually been asking for a config option of sorts within the mod itself
Config.lua files suck. They may be okay if you use a mod only in single player, but as soon as you join a server, every client would have to need the exact same config file. Since I want this mod to be 100% MP friendly, you will never see a config.lua. Also, as Peppe already said, every time I will post a update to the mod the config.lua will be overwritten.

There are a lot of recommendations to Wube to finally introduce a nice way of handling user settings (World of Warcraft did a really good job with those) and i certainly hope we will see them in not too far future. Once that happens, I can go full out with settings. Until then, the remote interface is what you have to use. Just do what Peppe said and use the remote interface to control my mod from within yours. Thats why I use it ;)



Apart from all of that...
So many people apparently using my mod already. Makes me feel like a giddy teen ^^
Happy you all like it enough to post.

User avatar
madpav3l
Long Handed Inserter
Long Handed Inserter
Posts: 81
Joined: Sat Oct 31, 2015 10:24 pm
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by madpav3l »

Killkrog wrote:
madpav3l wrote:Could you add a button for this?
Implemented for next update.
Wow that was quick, I didn't expect that :)
Thanks for a great mod

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by siggboy »

Killkrog wrote:introduce a nice way of handling user settings (World of Warcraft did a really good job with those)
It just has to be a simple key-value store that the mods can read/write (write into their own section and read everything). It wouldn't be hard to implement. Such a feature is absolutely missing, especially now that the mod manager overwrites everything when you update. If you don't backup your config.lua and then update by accident you lose all your settings. It blows. On the other hand, without a config.lua there is no way at all to configure a mod.

It could also allow the mod to store data across game instances. For example, the blueprint manager could store the blueprint library in the config and then you could load it from another savegame. It would be great. (Same with other mods that require some setting up, like FARL.)
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

User avatar
Killkrog
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Thu Jun 09, 2016 1:04 pm
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Killkrog »

DaveMcW wrote:your proposed format was kinda big and I am all about making strings smaller.
Did a test because you made me curious.

A small blueprint (4 lane belt balancer) is 355 byte with your mod and 382 byte with mine. Thats 7% difference.
A large blueprint (8 rail t-junction) is 8882 byte with your mod and 8929 byte with mine. Thats a 0.5% difference.

The import/export time of small blueprints is so small in both mods that it's negelctable.
And for large blueprints, the 0.5% won't make a difference.

Those differences in my eyes are small enough to justify the gained benefits (ability to autoupdate blueprints because I know what version they were generated in + save blueprint labels within blueprint books).
siggboy wrote:it just has to be a simple key-value store
Why restrict yourself? Lua is the perfect language to export tables as user settings.
siggboy wrote:for example, the blueprint manager could store the blueprint library in the config and then you could load it from another savegame
Would be great. Again, tables instead of key-value pairs here, too ^^

Kryzeth
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Jul 25, 2015 9:07 am
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Kryzeth »

Peppe wrote:Arn't config changes lost when mods update?
You assume that I would ever update a mod without redoing the changes I made to said mod =P
Killkrog wrote: Config.lua files suck. They may be okay if you use a mod only in single player, but as soon as you join a server, every client would have to need the exact same config file. Since I want this mod to be 100% MP friendly, you will never see a config.lua. Also, as Peppe already said, every time I will post a update to the mod the config.lua will be overwritten.
Oh... well I'm sorry that you think that way. Personally, if I were playing Factorio multiplayer, I would simply send my entire mod folder (because I make many changes, modifying both configs and other internal parts) to the friends I was going to play with. It's not like I'd be playing with randoms or anything.

Mods don't auto-update; players still have to manually update them. And in theory, the config would only ever apply at first run (on new game) so even if it were overwritten by a later update, it shouldn't change that the blueprint interface was unlocked. I mean, I think. I don't know exactly how you have it set up internally, so maybe it might function differently than I think.

Oh, and I'm not the developer of the quick start mod I mentioned, I'm just using it. Either way, I wouldn't know how to call parts of a mod from within another mod...
Last edited by Kryzeth on Wed Aug 03, 2016 12:04 am, edited 1 time in total.

Kryzeth
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Jul 25, 2015 9:07 am
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Kryzeth »

If you're that adamant about configs, I won't press the subject, but another suggestion then, would be to include a manual inside the mod itself, detailing the commands.

It's kind of annoying to have to come back to the Factorio forums every time I want to start a new game, just to copy/paste the command.

Peppe
Fast Inserter
Fast Inserter
Posts: 223
Joined: Fri Nov 28, 2014 6:48 pm
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Peppe »

Kryzeth wrote:
Peppe wrote:Arn't config changes lost when mods update?
You assume that I would ever update a mod without redoing the changes I made to said mod =P
Killkrog wrote: Config.lua files suck. They may be okay if you use a mod only in single player, but as soon as you join a server, every client would have to need the exact same config file. Since I want this mod to be 100% MP friendly, you will never see a config.lua. Also, as Peppe already said, every time I will post a update to the mod the config.lua will be overwritten.
Oh... well I'm sorry that you think that way. Personally, if I were playing Factorio multiplayer, I would simply send my entire mod folder (because I make many changes, modifying both configs and other internal parts) to the friends I was going to play with. It's not like I'd be playing with randoms or anything.

Mods don't auto-update; players still have to manually update them. And in theory, the config would only ever apply at first run (on new game) so even if it were overwritten by a later update, it shouldn't change that the blueprint interface was unlocked. I mean, I think. I don't know exactly how you have it set up internally, so maybe it might function differently than I think.

Oh, and I'm not the developer of the quick start mod I mentioned, I'm just using it. Either way, I wouldn't know how to call parts of a mod from within another mod...
You talked as if you were the mod developer. No issue if you are not it just seemed that way.

It only takes once for you to update mods in game and miss a mod that you have modified the config for and now your save may or may not work the same as before.

Even when there is a config I prefer to just overwrite with my own custom mod. For example color coding mod has a config value to change if you get color concrete back vs concrete back when you mine the tiles back after placement. The default was color and I wanted concrete. I could change the config, but now I need to manually change it after every update.

Not config option, but I am very sensitive to the number of tabs mods add to the crafting menu. I try to keep it to 2 rows. The color mod adds it's own tab for ~16 recipes. Another mod homeworld makes a tab for 4 recipes... In a custom mod I move those to be within the vanilla tabs. Now I have the color mod configured exactly how I like and it and can still update it independent of my overrides.

I just call my mod PeppeTweaks and use it locally.
it is very simple to do a data-final-fixes.lua mod:
example

User avatar
Killkrog
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Thu Jun 09, 2016 1:04 pm
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Killkrog »

Kryzeth wrote:It's kind of annoying to have to come back to the Factorio forums every time I want to start a new game, just to copy/paste the command.
That's the reason god gave us text files ;)

Kryzeth
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Jul 25, 2015 9:07 am
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Kryzeth »

Killkrog wrote:That's the reason god gave us text files ;)
That's kind of what I meant; you can keep a .txt file inside the mod package without it affecting the mod itself.. x_x
Peppe wrote: It only takes once for you to update mods in game and miss a mod that you have modified the config for and now your save may or may not work the same as before.
See, that's the thing though. I would never update my mods without knowing what the updates will do. I don't use the in-game mod portal or mod updating thing; I prefer to manually update them myself, if necessary.
"If necessary" being the key word there. I would never blindly update a modpack in the middle of a playthrough, because I don't trust mods to not break save files. If an update makes a minor change or some sort of bugfix because of Factorio updates, only then will I choose to update it, because I deem it safe.

Either way, I keep any mods I have heavily modified unpacked (they load just as well) to ensure that I don't overwrite them with manual updates either. But maybe that's just me being overly cautious.

What you mentioned sounds nice, but won't it also fail to work if a mod updates and changes its internal coding that you tried to overwrite? You would still not want to update willy nilly, or else you'd have to rewrite your personal fix mod.
It's not that much better of a solution than mine, is it?

Kryzeth
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Jul 25, 2015 9:07 am
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Kryzeth »

I figured out how to use the command from within another mod, thank you very much for implementing it!

Gahhh, figuring out how to check if a mod exists was the worst, especially without an entity or recipe to check if exists... but I finally got it x_X

User avatar
Killkrog
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Thu Jun 09, 2016 1:04 pm
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Killkrog »

Glad you managed to get everything the way you like!

I guess you did something like this?

Code: Select all

if remote.interfaces["KBlueprints"] and remote.interfaces["KBlueprints"]["Always Show GUI"] then
	remote.call("KBlueprints", "Always Show GUI", player)
end
That is the safest and shortest way I know of trying to call a remote function.

Cheers!

Kryzeth
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Jul 25, 2015 9:07 am
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Kryzeth »

Killkrog wrote: I guess you did something like this?

Code: Select all

if remote.interfaces["KBlueprints"] and remote.interfaces["KBlueprints"]["Always Show GUI"] then
	remote.call("KBlueprints", "Always Show GUI", player)
end
...oh.. that's probably more efficient than what I had to use.. I can really only use code if I've seen it used somewhere else, and there wasn't any code like that in any other mod x_x
I actually used this

Code: Select all

for name, version in pairs(game.active_mods) do
  if name == "KBlueprints" then kblue = true end
end
inside the player created loop, just before

Code: Select all

if kblue then
  remote.call("KBlueprints", "Always Show GUI", game.players[event.player_index])
end
It's also probably a bad assumption to check only if the mod exists, then to try to call that method, but you wouldn't remove or rename it, now would you..? ^^;

User avatar
Killkrog
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Thu Jun 09, 2016 1:04 pm
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Killkrog »

Your code obviously is just fine too. Just be aware that the interface name (the first part of the function) doesn't necessarily has to be the mod's name. In my case, it is, though.
And no, I don't plan to remove or rename the function. It's descriptive and will always be needed.

Neemys
Filter Inserter
Filter Inserter
Posts: 461
Joined: Sat Apr 09, 2016 6:16 pm
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Neemys »

Thanks for the hard work on your awesome mod. There is a bug I posted here https://mods.factorio.com/mods/killkrog ... ssion/1796

Are you working on a fix right now ? Or you can't work on it right now and I should fix it myself ?

Thanks
Want more space restriction ? Or maybe you want to be forced to use train for other thing than ore and oil ? Try Building Platform Mod !

User avatar
Killkrog
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Thu Jun 09, 2016 1:04 pm
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by Killkrog »

Neemys wrote:Are you working on a fix right now?
???

Already fixed since yesterday. Even answered you on the portal. Just download newest version ^^

sebgggg
Burner Inserter
Burner Inserter
Posts: 15
Joined: Tue Aug 09, 2016 6:57 am
Contact:

Re: [MOD 0.13.X] Killkrog's Blueprint Manager

Post by sebgggg »

Hi,

Thanks for the mod, it's very nice.
However in control.lua function loadEntry, you need to flip the lines setting icons and those setting tiles, otherwise it fails with this message when a blueprint is only tiles (ver 1.1.9):

Blueprint icons cannot be set on an empty blueprint.
stack traceback:
__KBlueprints__/control.lua:764: in function 'loadEntry'
__KBlueprints__/control.lua:1146: in function <__KBlueprints__/control.lua:1091

It also destroys the empty blueprints when loading a book, but that's ok.

Post Reply

Return to “Mods”