Page 2 of 5

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

Posted: Mon Aug 01, 2016 6:12 pm
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

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

Posted: Mon Aug 01, 2016 10:34 pm
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.

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

Posted: Tue Aug 02, 2016 12:19 pm
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!

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

Posted: Tue Aug 02, 2016 1:56 pm
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.

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

Posted: Tue Aug 02, 2016 3:25 pm
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.

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

Posted: Tue Aug 02, 2016 6:01 pm
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

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

Posted: Tue Aug 02, 2016 6:14 pm
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.)

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

Posted: Tue Aug 02, 2016 10:00 pm
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 ^^

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

Posted: Tue Aug 02, 2016 11:58 pm
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...

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

Posted: Wed Aug 03, 2016 12:00 am
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.

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

Posted: Wed Aug 03, 2016 2:46 pm
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

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

Posted: Wed Aug 03, 2016 5:09 pm
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 ;)

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

Posted: Thu Aug 04, 2016 9:43 am
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?

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

Posted: Sat Aug 06, 2016 7:49 pm
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

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

Posted: Sun Aug 07, 2016 2:07 am
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!

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

Posted: Sun Aug 07, 2016 3:47 am
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..? ^^;

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

Posted: Sun Aug 07, 2016 9:20 am
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.

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

Posted: Mon Aug 08, 2016 9:36 pm
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

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

Posted: Mon Aug 08, 2016 9:37 pm
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 ^^

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

Posted: Tue Aug 09, 2016 7:03 am
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.