[0.12.x][v0.12.10] Bob's Logistics mod
Moderator: bobingabout
Re: [0.12.x][v0.12.10] Bob's Logistics mod
Yeah I was wrong sorry, haven't see his script to migrate inserter needed a keystroke to be activated >_< so no circuit network are kept. Yeah I thought everything was done on save loading >_< Seeing his code, it was not possible the circuit connection were kept and then I saw the keystroke in data.lua.......
But It can be done by keeping the controlbehavior somehow, I can't do any test right now.
Json keep hand content and circuit network connection ?
I'm sure by having to do it in two step, some people will have trouble.
But if your solution work keep it, no need to spend a week on that
For blueprint, it can be done but even if you update all blueprint in the world, if people bring old blueprint with blueprint string mod as world is already loaded, you must have a gui button or keystroke to update the blueprint in hand.
But It can be done by keeping the controlbehavior somehow, I can't do any test right now.
Json keep hand content and circuit network connection ?
I'm sure by having to do it in two step, some people will have trouble.
But if your solution work keep it, no need to spend a week on that
For blueprint, it can be done but even if you update all blueprint in the world, if people bring old blueprint with blueprint string mod as world is already loaded, you must have a gui button or keystroke to update the blueprint in hand.
Last edited by Neemys on Mon Jul 18, 2016 9:50 pm, edited 1 time in total.
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 !
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: [0.12.x][v0.12.10] Bob's Logistics mod
Blueprints would be too much trouble to be worth it... however, for the rest of it.
install saver mod, load game, save game, exit
update to latest version of logistics, load game, done.
that is the current process you would need to do.
how the current plan works:
the saver mod saves all hand positions to the entity via lua.
main mod uses a json to update the entity.
json method keeps everything except the hand positions, unless hand positions have been saved to the entity via lua in runtime, which is why I prefer it. unfortunately, the lua script I would be using doesn't scan blueprints.
install saver mod, load game, save game, exit
update to latest version of logistics, load game, done.
that is the current process you would need to do.
how the current plan works:
the saver mod saves all hand positions to the entity via lua.
main mod uses a json to update the entity.
json method keeps everything except the hand positions, unless hand positions have been saved to the entity via lua in runtime, which is why I prefer it. unfortunately, the lua script I would be using doesn't scan blueprints.
Re: [0.12.x][v0.12.10] Bob's Logistics mod
Sound good and easy enough, nice work ^^
circuit network connection are kept ?
Yeah blueprint will be too much trouble. they still can "upgrade" them by placing it with old version then update and redo the blueprint ^^
circuit network connection are kept ?
Yeah blueprint will be too much trouble. they still can "upgrade" them by placing it with old version then update and redo the blueprint ^^
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 !
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: [0.12.x][v0.12.10] Bob's Logistics mod
Basically, phase one:
That's it, that entire code there in a migration lua script is the whole thing for phase 1! I even figured out a Fast entity finding routine for scanning the whole known map!
Phase 2:
Update to the newer version of the mod that includes this json script
All inserters in the world will be updated to base form of their inserter type, with all settings kept.
But blueprints using any of the old entity types will still be wrong.
The json script should replace the inserter entities with their base form, but the hand positions will be wrong.
the problem with scanning blueprints is... well, where are they? if they're in a player's inventory, it probably won't be too difficult to update those, but if they're in a box? scan every box to see if there's a blueprint in it? that's going to be too much work, and processing power to do, so.... I'll just say that all blueprints are universally broken. Besides, GotLag doesn't account for blueprints either.
Also this: viewtopic.php?f=33&t=29349
Code: Select all
for chunk in game.surfaces[1].get_chunks() do
local inserters = game.surfaces[1].find_entities_filtered{area = {{(chunk.x * 32), (chunk.y * 32)}, {(chunk.x * 32) +32, (chunk.y * 32) +32}}, type = "inserter"}
for i, inserter in pairs(inserters) do
inserter.pickup_position = {inserter.pickup_position.x, inserter.pickup_position.y}
inserter.drop_position = {inserter.drop_position.x, inserter.drop_position.y}
inserter.direction = inserter.direction
end
end
Phase 2:
Update to the newer version of the mod that includes this json script
Code: Select all
{
"item":
[
["long-handed-burner-inserter", "burner-inserter"],
["fast-long-inserter", "fast-inserter"],
["fast-near-inserter", "fast-inserter"],
["fast-far-inserter", "fast-inserter"],
["filter-long-inserter", "filter-inserter"],
["filter-near-inserter", "filter-inserter"],
["filter-far-inserter", "filter-inserter"],
["filter-short-far-inserter", "filter-inserter"],
["filter-short-long-inserter", "filter-inserter"],
["filter-long-near-inserter", "filter-inserter"],
["filter-long-short-inserter", "filter-inserter"],
["express-long-inserter", "express-inserter"],
["express-near-inserter", "express-inserter"],
["express-far-inserter", "express-inserter"],
["express-short-far-inserter", "express-inserter"],
["express-short-long-inserter", "express-inserter"],
["express-long-near-inserter", "express-inserter"],
["express-long-short-inserter", "express-inserter"]
],
"recipe":
[
["long-handed-burner-inserter", "burner-inserter"],
["fast-long-inserter", "fast-inserter"],
["fast-near-inserter", "fast-inserter"],
["fast-far-inserter", "fast-inserter"],
["filter-long-inserter", "filter-inserter"],
["filter-near-inserter", "filter-inserter"],
["filter-far-inserter", "filter-inserter"],
["filter-short-far-inserter", "filter-inserter"],
["filter-short-long-inserter", "filter-inserter"],
["filter-long-near-inserter", "filter-inserter"],
["filter-long-short-inserter", "filter-inserter"],
["express-long-inserter", "express-inserter"],
["express-near-inserter", "express-inserter"],
["express-far-inserter", "express-inserter"],
["express-short-far-inserter", "express-inserter"],
["express-short-long-inserter", "express-inserter"],
["express-long-near-inserter", "express-inserter"],
["express-long-short-inserter", "express-inserter"]
],
"entity":
[
["long-handed-burner-inserter", "burner-inserter"],
["fast-long-inserter", "fast-inserter"],
["fast-near-inserter", "fast-inserter"],
["fast-far-inserter", "fast-inserter"],
["filter-long-inserter", "filter-inserter"],
["filter-near-inserter", "filter-inserter"],
["filter-far-inserter", "filter-inserter"],
["filter-short-far-inserter", "filter-inserter"],
["filter-short-long-inserter", "filter-inserter"],
["filter-long-near-inserter", "filter-inserter"],
["filter-long-short-inserter", "filter-inserter"],
["express-long-inserter", "express-inserter"],
["express-near-inserter", "express-inserter"],
["express-far-inserter", "express-inserter"],
["express-short-far-inserter", "express-inserter"],
["express-short-long-inserter", "express-inserter"],
["express-long-near-inserter", "express-inserter"],
["express-long-short-inserter", "express-inserter"]
]
}
But blueprints using any of the old entity types will still be wrong.
The json script should replace the inserter entities with their base form, but the hand positions will be wrong.
the problem with scanning blueprints is... well, where are they? if they're in a player's inventory, it probably won't be too difficult to update those, but if they're in a box? scan every box to see if there's a blueprint in it? that's going to be too much work, and processing power to do, so.... I'll just say that all blueprints are universally broken. Besides, GotLag doesn't account for blueprints either.
Also this: viewtopic.php?f=33&t=29349
Re: [0.12.x][v0.12.10] Bob's Logistics mod
It's a nice and short code ;)But it only migrate pickup and drop position on the first surface. If a savegame have multiple surface and use your mod, other surface will not be updated. Maybe add a for loop for all surface ?
Yeah for blueprint you basically end up looking into every container there is, for multiplayer, you need to look in every player's inventory, and like I said before, some store blueprint outside in string and you can't update them directly so you must provide (and maintain) an update function wich trigger on hotkey (as old entities will not be here anymore, maybe it's not even possible to migrate after loading in blueprint string). Yeah It's lot of work for a small inconvenience like that. If people need to update a big blueprint instead or redoing it, they paste it on floor on old version, then update for your script to migrate the inserter, then they can redo the blueprint.
Nice new feature you got us, thanks
Yeah for blueprint you basically end up looking into every container there is, for multiplayer, you need to look in every player's inventory, and like I said before, some store blueprint outside in string and you can't update them directly so you must provide (and maintain) an update function wich trigger on hotkey (as old entities will not be here anymore, maybe it's not even possible to migrate after loading in blueprint string). Yeah It's lot of work for a small inconvenience like that. If people need to update a big blueprint instead or redoing it, they paste it on floor on old version, then update for your script to migrate the inserter, then they can redo the blueprint.
Nice new feature you got us, 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 !
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: [0.12.x][v0.12.10] Bob's Logistics mod
I was thinking of doing that.Neemys wrote:It's a nice and short code ;)But it only migrate pickup and drop position on the first surface. If a savegame have multiple surface and use your mod, other surface will not be updated. Maybe add a for loop for all surface ?
Also, I'm thinking of releasing the lua script and not the JSON in the next update, then doing a JSON in the update afterwards, it would silently do the saving on existing entities, while changing it so you can't place new ones, but old ones would still exist, then in the next update, use the JSON to migrate the entities left over.... sort of a silent way of migrating you, with minimum effort....
Though could just release the lua as a seperate mod, then do the json with everything removed in the next logistics update....
I guess I need some opinions
Re: [0.12.x][v0.12.10] Bob's Logistics mod
Not everyone updates every day.
At the moment I'm playing without bobmods, so when I continue my bobgame I'll probably skip a few updates.
So that means my inserters can be broken?
At the moment I'm playing without bobmods, so when I continue my bobgame I'll probably skip a few updates.
So that means my inserters can be broken?
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: [0.12.x][v0.12.10] Bob's Logistics mod
if you don't do the intermediate one that saves the pickup/drop positions, they'll be updated and only lose their hand positions, which you can then change with the GUI.pieppiep wrote:Not everyone updates every day.
At the moment I'm playing without bobmods, so when I continue my bobgame I'll probably skip a few updates.
So that means my inserters can be broken?
Re: [0.12.x][v0.12.10] Bob's Logistics mod
As not everyone update at each version, I think you should release the LUA on another mod file so only those who want to migrate use it. And it will be easier later when people who don't play experimental want to update, you will have on one hand the lua to migrate and on the other your updated mod, you will onbly need to have a disclaimer that state how to migrate (add migrate mod with old bob mod, save/load, then remove migration and update bob).
Having the LUA in your mod directly mean they will need to download a specific version of your mod (lua without JSON), migrate, then update to latest bob version. Maybe your specific version will not work on 0.13.20 and then they cannot migrate unless changing 0.13 version (or they come here yelling at you for your incompetence ).
So separate mod will be easier to maintain and will be more likely to work even when people try to migrate on 0.13.30, less difficult for user to use (so less bug report, "don't work" post or whatever that take your time for maybe nothing).
Haven't check how the mod portal work (I'm waiting dev to correct a bug before trying to release my mod) but can you have 2 version of your mod at the same time ? if not then you have no choice As having LUA on your mod need having two version of your mod downloadable. Even if you can upload the specific version here on forum, I think dev want to move mod to portal and people will be less likely to check here.
Having the LUA in your mod directly mean they will need to download a specific version of your mod (lua without JSON), migrate, then update to latest bob version. Maybe your specific version will not work on 0.13.20 and then they cannot migrate unless changing 0.13 version (or they come here yelling at you for your incompetence ).
So separate mod will be easier to maintain and will be more likely to work even when people try to migrate on 0.13.30, less difficult for user to use (so less bug report, "don't work" post or whatever that take your time for maybe nothing).
Haven't check how the mod portal work (I'm waiting dev to correct a bug before trying to release my mod) but can you have 2 version of your mod at the same time ? if not then you have no choice As having LUA on your mod need having two version of your mod downloadable. Even if you can upload the specific version here on forum, I think dev want to move mod to portal and people will be less likely to check here.
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 !
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: [0.12.x][v0.12.10] Bob's Logistics mod
The mod portal on the site keeps all versions of your mod that you upload. The mod portal in the game will always download the latest version.
Re: [0.12.x][v0.12.10] Bob's Logistics mod
Edit : nah nevermind it don't work..... Why JSON migration script before LUA ? It even run 0.13.6 JSON migration script before 0.13.5 LUA migration script. Is it a bug ?
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 !
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: [0.12.x][v0.12.10] Bob's Logistics mod
Well, JSON is used to replace things that don't exist anymore, so is run before the game fully initialises.
LUA is a script that runs on things once the game is initialised.
so... it makes sense that json runs first, even if it's not really what we want to do here.
LUA is a script that runs on things once the game is initialised.
so... it makes sense that json runs first, even if it's not really what we want to do here.
Re: [0.12.x][v0.12.10] Bob's Logistics mod
even in this case :
1.0.1 : migration script in LUA (mymod_1.0.1.lua in migration folder)
1.0.2 : migration script in JSON (mymod_1.0.2.json in migration folder)
when we update from 1.0.0 to 1.0.2 the JSON is running first. And I don't think it should be the case. If we wrote a script in earlier version we don't want to update it everytime an entity change in later version (if we use that entity). So we must wrote the entire entity migration in LUA to do it in one save/load. They must have good reason to design it that way...
So like I said before, I think it's better to use an other mod to update the inserters as the mod portal will be unable to give player a specific version of your mod to execute only the LUA script. But in the end you choose Keep up the good work.
1.0.1 : migration script in LUA (mymod_1.0.1.lua in migration folder)
1.0.2 : migration script in JSON (mymod_1.0.2.json in migration folder)
when we update from 1.0.0 to 1.0.2 the JSON is running first. And I don't think it should be the case. If we wrote a script in earlier version we don't want to update it everytime an entity change in later version (if we use that entity). So we must wrote the entire entity migration in LUA to do it in one save/load. They must have good reason to design it that way...
So like I said before, I think it's better to use an other mod to update the inserters as the mod portal will be unable to give player a specific version of your mod to execute only the LUA script. But in the end you choose Keep up the good work.
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 !
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: [0.12.x][v0.12.10] Bob's Logistics mod
Imagine the scenario (in which this is actually the case) that we have an entity, and have a LUA migration script on on that specific entity.
Then you release an update, the update completely removes said entity from the game, with a JSON migration script telling it to replace the removed entity with another.
Well, the object referenced to in the LUA no longer exists in the game(but that isn't a problem, the result is that nothing happens), the save file contains a reference to an object that doesn't exist. the JSON tells the game to replace said references of the entity with the new entity.
If these references were not replaced, the only thing the game could do is delete them... in either case, there is no entity to run a LUA script on, because it is GONE!!!
If the LUA runs first, the script runs, but finds no entities to run the script on, because that object doesn't exist anymore, if it runs after, well, same problem, only the reference is replaced with something else.
Now do you see why the JSON is always run first?
Then you release an update, the update completely removes said entity from the game, with a JSON migration script telling it to replace the removed entity with another.
Well, the object referenced to in the LUA no longer exists in the game(but that isn't a problem, the result is that nothing happens), the save file contains a reference to an object that doesn't exist. the JSON tells the game to replace said references of the entity with the new entity.
If these references were not replaced, the only thing the game could do is delete them... in either case, there is no entity to run a LUA script on, because it is GONE!!!
If the LUA runs first, the script runs, but finds no entities to run the script on, because that object doesn't exist anymore, if it runs after, well, same problem, only the reference is replaced with something else.
Now do you see why the JSON is always run first?
Re: [0.12.x][v0.12.10] Bob's Logistics mod
Yeah I see, even though it doesn't cover all use case. You surely have every thing done for logistic so that's perfect When I play again (waiting some update) i will be able to continue my Science overhaul with bob's mod on 0.13
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 !
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: [0.12.x][v0.12.10] Bob's Logistics mod
And it is done!
Logistics 0.13.6
* Added a check for stack inserter research, made it compatable for versions before it was added.
* re-added the old inserter stack size bonus technology, also removed normal inserter stack size bonuses from the new tech.
* replaced inserter capacity bonus technology icon with old stack inserter icon from pre 0.13.7
* Removed long/near/more inserters. Use the migrate mod to retain hand positions.
* Added Logistic zone interface. An entity connected to the roboport logistics network to connect circuit wires to.
Inserters 0.13.2
* Added 3 tiles reach options, unlocked by long inserters 2 research
* More inserters research only unlocks diagonals, more inserters 2 unlocks other positions if there are any.
* GUI now draws a smaller GUI for standard reach inserters if there are no long inserter options.
* Researching a technology that changes the GUI now automatically redraws the GUI.
* Changed open/close GUI hotkey to SHIFT + E (Old key will be kept in your config files though)
* Removed the inserter stack size research changes.
Inserter Migrate
Instructions:
With Logistics mod version 0.13.4 or older installed, install this mod, load the game, then save.
Once you have saved the game with this mod installed, it is safe to remove it.
Then upgrade the logistics mod to version0.13.5 0.13.6 to complete the migration and continue as normal.
Logistics 0.13.6
* Added a check for stack inserter research, made it compatable for versions before it was added.
* re-added the old inserter stack size bonus technology, also removed normal inserter stack size bonuses from the new tech.
* replaced inserter capacity bonus technology icon with old stack inserter icon from pre 0.13.7
* Removed long/near/more inserters. Use the migrate mod to retain hand positions.
* Added Logistic zone interface. An entity connected to the roboport logistics network to connect circuit wires to.
Inserters 0.13.2
* Added 3 tiles reach options, unlocked by long inserters 2 research
* More inserters research only unlocks diagonals, more inserters 2 unlocks other positions if there are any.
* GUI now draws a smaller GUI for standard reach inserters if there are no long inserter options.
* Researching a technology that changes the GUI now automatically redraws the GUI.
* Changed open/close GUI hotkey to SHIFT + E (Old key will be kept in your config files though)
* Removed the inserter stack size research changes.
Inserter Migrate
Instructions:
With Logistics mod version 0.13.4 or older installed, install this mod, load the game, then save.
Once you have saved the game with this mod installed, it is safe to remove it.
Then upgrade the logistics mod to version
Re: [0.12.x][v0.12.10] Bob's Logistics mod
Thank you for your hard work bobingabout really appreciate it, but it looks like i am staying on boblogistics version 0.13.4. I'm not really a fan of these 2 changes because this will change all the inserter "ratio's" again and my guess is that the new adjustable inserter is not as fast to setup even with hotkeys, why would you remove the current ones?bobingabout wrote: Logistics 0.13.6
* re-added the old inserter stack size bonus technology, also removed normal inserter stack size bonuses from the new tech.
* Removed long/near/more inserters. Use the migrate mod to retain hand positions.
PS.
As one software developer to another 0.13.4 to 0.13.6 does not really reflect the changes you made. In my mind such a version increment looks more like a bug fix which it is clearly not because this will "break" current factories when people don't see your message (in game mod update ) to use the migration mod/script and install the inserter mod.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: [0.12.x][v0.12.10] Bob's Logistics mod
I'm not sure what you mean by Inserter Ratios... but otherwise, it is still fairly fast to setup the new inserters (though obviously not as fast) and the main reason why I removed the old ones so soon is because people kept asking me to. (It is true that you don't NEED them anymore with the new setup.)vlczero wrote:Thank you for your hard work bobingabout really appreciate it, but it looks like i am staying on boblogistics version 0.13.4. I'm not really a fan of these 2 changes because this will change all the inserter "ratio's" again and my guess is that the new adjustable inserter is not as fast to setup even with hotkeys, why would you remove the current ones?
This was one of my major concerns with the removal of the old entities. If I could put it all in one update to make it as painless and silent as possible, I would have, but the way the game works, it simply wasn't.vlczero wrote:As one software developer to another 0.13.4 to 0.13.6 does not really reflect the changes you made. In my mind such a version increment looks more like a bug fix which it is clearly not because this will "break" current factories when people don't see your message (in game mod update ) to use the migration mod/script and install the inserter mod.
As for the version number step... well, if I was still using my old number, it would have been a step up, but I normalised my numbers with the game's release numbers so that it should be clearer to tell what version of the game it is for.
-
- Inserter
- Posts: 46
- Joined: Mon Jul 11, 2016 4:26 pm
- Contact:
Re: [0.12.x][v0.12.10] Bob's Logistics mod
Hey, I have a slight problem in the game I migrated I can't build fast inserters and still have long inserters instead, in a new game fast inserters work but there are still long inserters.
Great new addon to the mod!
Eh what can I do to fix that? I tried resetting recipes and researches.
-- edit --
enabling it by hand worked and the long inserters seem to be where they ought to be, thought they'd be migrated too
Great new addon to the mod!
Eh what can I do to fix that? I tried resetting recipes and researches.
-- edit --
enabling it by hand worked and the long inserters seem to be where they ought to be, thought they'd be migrated too
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: [0.12.x][v0.12.10] Bob's Logistics mod
I don't even know how what you describe could be possible, Fast long inserters don't even exist any more. As for fast inserters, the migration scripts themselves shouldn't have touched them.
if you are having issues with the fast inserter not being available though, this should fix it.
if you are having issues with the fast inserter not being available though, this should fix it.
Code: Select all
/c for index, force in pairs(game.forces) do force.recipes["fast-inserter"].enabled = true end