[MOD 0.12.12+] Advanced Logistics System 0.2.13

Topics and discussion about specific mods
Outsider
Fast Inserter
Fast Inserter
Posts: 115
Joined: Sat Jan 10, 2015 12:23 am
Contact:

Re: [MOD 0.12.x] Advanced Logistics System

Post by Outsider »

sadris wrote: I'm getting the following error when I try to view other radar stations with the Command & Control mod (I think it basically teleports you)

advanced-logistic-system/control.lua:217: attempt to index field 'characater' (a nil value)

viewtopic.php?f=86&t=13338
You seem to be using a very old version of the mod, version 0.2.2 in particular, this bug was fixed a while ago, please update the mod and you should be fine.
TBog wrote:I have a lua crash when loading up the map:
Image
Here is the save file and all the mods in use:
http://speedy.sh/yCeHZ/error.zip

I can disable Advanced Logistics System and load the map, make a new save, exit, toggle the mod back on and load the new save and everything works, but maybe it should be fixed.
Same issue here i think, you seem to be using version 0.2.1 of the mod, and this issue was fixed in a later release, please update and let me know if you still have issues.
Ranakastrasz wrote: Would it be possible to dynamically load all logistic items, so that any mod adding extra logistic chests or roboports will be seen by this mod?

Dytech (or the lighter Chest only mod I made) and the Robocharge poles mod have this issue.
Yes with the new logistic network API i no longer need to manually add comparability for other mods, this is coming in the new release which i'll be uploading soon.
Advanced Logistics System - Provides a detailed view of your logistics network and the items within it
TBog
Inserter
Inserter
Posts: 34
Joined: Tue Feb 03, 2015 3:15 pm
Contact:

Re: [MOD 0.12.x] Advanced Logistics System

Post by TBog »

Outsider wrote:
sadris wrote: Same issue here i think, you seem to be using version 0.2.1 of the mod, and this issue was fixed in a later release, please update and let me know if you still have issues.
I am using the version from http://www.factoriomods.com/mods/advanc ... ics-system
It is version 0.2.1
Thank you.
Outsider
Fast Inserter
Fast Inserter
Posts: 115
Joined: Sat Jan 10, 2015 12:23 am
Contact:

Re: [MOD 0.12.x] Advanced Logistics System

Post by Outsider »

TBog wrote:
Outsider wrote:
sadris wrote: Same issue here i think, you seem to be using version 0.2.1 of the mod, and this issue was fixed in a later release, please update and let me know if you still have issues.
I am using the version from http://www.factoriomods.com/mods/advanc ... ics-system
It is version 0.2.1
Thank you.
Yeah i'll try to get in contact with them and have it updated there, 0.2.5 should fix your issues, let me know how it goes.
Advanced Logistics System - Provides a detailed view of your logistics network and the items within it
theit8514
Inserter
Inserter
Posts: 47
Joined: Sun Apr 20, 2014 2:11 am
Contact:

Re: [MOD 0.12.x] Advanced Logistics System

Post by theit8514 »

I was doing some testing when I noticed that this mod was using quite a bit of resources, especially considering that I hadn't even gotten to logistics chests yet.

Prior to researching the tech:
PreTechResearch.png
PreTechResearch.png (29.05 KiB) Viewed 8714 times
After researching the tech:
PostTechResearch.png
PostTechResearch.png (24.52 KiB) Viewed 8714 times
In your on_tick event, the unlock code is being run every tick. When the tech is not unlocked, that check is not cached so the next tick it gets recalculated. Changing the code to do the unlock check on tick 0 reduces the ms prior to researching the tech.
Fixed.png
Fixed.png (28.67 KiB) Viewed 8714 times

Code: Select all

local doWork = false
game.on_event(defines.events.on_tick, function(event)
		if event.tick % 60 == 0 then
			doWork = false
			for i,p in ipairs(game.players) do
				if playerHasSystem(p) then
					doWork = true
				end
			end
		end
		if doWork then
			for i,p in ipairs(game.players) do
				if playerHasSystem(p) then
					if (not p.gui.top["logistics-view-button"]) then
						initGUI(p)
					end
					local refresh = global.settings[i].refreshInterval * 60
					if event.tick % refresh == 0  then
						if global.guiVisible[i] == 1 then
							local currentTab = global.currentTab[i]
							if currentTab == "itemInfo" then
								local currentItem = global.currentItem[i]
								if currentItem then
									clearGUI(p, i)
									showItemInfo(currentItem, p, i)
								end
							else
								updateGUI(p, i)
							end
						end
					end

					-- check search field tick
					if global.searchTick[i]["logistics"] ~= nil then onLogisticsSearchTick(event, i) end
					if global.searchTick[i]["normal"] ~= nil then onNormalSearchTick(event, i) end
				elseif global.settings[i] then
					destroyGUI(p, i)
				end

			end
		end
end)
Outsider
Fast Inserter
Fast Inserter
Posts: 115
Joined: Sat Jan 10, 2015 12:23 am
Contact:

Re: [MOD 0.12.5+] Advanced Logistics System

Post by Outsider »

Version 0.2.6 is up! this is a big update and includes mostly code refractoring plus a bunch of new features using the new Logistic_Network APIs.

Hopefully you guys like it, and not run into any issues :)

Preview Images
Changelog
  • Code refactoring and optimization - using the new Lua/LogisticNetwork / Lua/LogisticCell API
  • Added compatibility for mods that use hidden containers as proxies - mainly 5dim-trains
  • Added a "Networks" and a "Network Info" view that shows a list of your logistic networks with detailed info on each
  • Added the ability to rename your networks, the names are shared per force not per player
  • Added a a filter by "Networks" option to the "Network Items" and the "Item Info" views.
  • Added a new settings option "Auto Filter" when Enabled automatically filter "Item Info" views based on the previous tab whether it's "Logistics/Normal" - Enabled by default
  • Added a new settings option "Exclude Requesters" when Enabled items in requester chests will not be included in the totals calculation - Enabled by default
  • Remove item requirement - no longer a config option
  • Added a remote interface function "ShowSettings" to force open the settings panel, ex: remote.call("advanced-logistics-system","showSettings",game.local_player)
Advanced Logistics System - Provides a detailed view of your logistics network and the items within it
Outsider
Fast Inserter
Fast Inserter
Posts: 115
Joined: Sat Jan 10, 2015 12:23 am
Contact:

Re: [MOD 0.12.x] Advanced Logistics System

Post by Outsider »

theit8514 wrote:I was doing some testing when I noticed that this mod was using quite a bit of resources...
Thank you for the detailed report, i do believe this is fixed in 0.2.6, since i removed the item requirement checks completely and was also missing a per sec check on the tick event.

i will take a second look at this part of the code to make sure it's running optimally, let me know if you run into the same issue with the latest version.
waduk wrote:Crash when removing roboport:
Factorio 0.12.6
Advanced Logistics System 0.2.5
Image
The cause may be 5dim's train (logistic) module ?
https://forums.factorio.com/forum/viewforum.php?f=81
TheSAguy wrote:I got the below crash, when I tried to mine a robo-port.
First time using the mod.

Image

Using Bob's, but it was a vanilla port.
Both issues should be fixed in 0.2.6, please test and let me know? :)
R3vo wrote:Hey Outsider,
first of all, thanks for this awesome mod, I would like to put it into good use, however, my interface looks like this.

http://www.fotos-hochladen.net/view/201 ... e19xyc.jpg

I've unfortunately set the number of lines to ~30 without thinking :roll:
I tried to find a variable, which I could set back to default, without success. Is there any solution to this, without starting a new savegame?

Furthermore I'd suggest you add a limit to the number of lines, or at least a little hint which warns the user of too high values.

Edit: I have somehow solved the issue, but I've got no clue how.
this is unfortunate sorry :) i'd rather not rely on editable config files, but i have added a remote interface call that you can use in the console to force the settings window to show, then you can adjust the items per page to a smaller number.

try running in your console :

Code: Select all

remote.call("advanced-logistics-system","showSettings",game.local_player)
Advanced Logistics System - Provides a detailed view of your logistics network and the items within it
theit8514
Inserter
Inserter
Posts: 47
Joined: Sun Apr 20, 2014 2:11 am
Contact:

Re: [MOD 0.12.5+] Advanced Logistics System

Post by theit8514 »

Yep, looks like the new version is idle without the tech researched.
Outsider
Fast Inserter
Fast Inserter
Posts: 115
Joined: Sat Jan 10, 2015 12:23 am
Contact:

Re: [MOD 0.12.5+] Advanced Logistics System

Post by Outsider »

theit8514 wrote:Yep, looks like the new version is idle without the tech researched.
well great, thanks for your effort and please let me know if you run into any other bits of code that could use optimization.
Advanced Logistics System - Provides a detailed view of your logistics network and the items within it
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.x] Advanced Logistics System

Post by waduk »

Outsider wrote:
waduk wrote:Crash when removing roboport:
Factorio 0.12.6
Advanced Logistics System 0.2.5
Image
The cause may be 5dim's train (logistic) module ?
https://forums.factorio.com/forum/viewforum.php?f=81
Both issues should be fixed in 0.2.6, please test and let me know? :)
Arrggh,..i accidentally deleted my save file ! :(
Sorry cannot test it. I only have vanilla saves left. :|
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.5+] Advanced Logistics System

Post by waduk »

I made a custom normal chest, how can i add that into this mod ? What i mean is, i can see the overall stats, but i want to view them side by side with the vanilla normal chest (filterable)
Pic
Pic2
Outsider
Fast Inserter
Fast Inserter
Posts: 115
Joined: Sat Jan 10, 2015 12:23 am
Contact:

Re: [MOD 0.12.5+] Advanced Logistics System

Post by Outsider »

waduk wrote:I made a custom normal chest, how can i add that into this mod ? What i mean is, i can see the overall stats, but i want to view them side by side with the vanilla normal chest (filterable)
Pic
Pic2
if i understood correctly you want to use the custom chest for filtering and also on the main item view table for sorting?

there is no config option or a feature to do that yet, so you'd have to do it by changing some of the code.
Advanced Logistics System - Provides a detailed view of your logistics network and the items within it
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.5+] Advanced Logistics System

Post by waduk »

Yes, exactly that.
I'm aware there are no config option, i have to add the code.
I see in control.lua this line at 77 :

Code: Select all

normal = {
            name = "name",
            total = "total",
            woc = "wooden-chest",
            irc = "iron-chest",
            stc = "steel-chest",
            smc = "smart-chest",
        }
I also search where else the code being referenced, found it on main.lua :

So, is that the two files that i have to changed/add if i want to add my custom chest, or is more complicated than that ?
I'm a complete noob on modding btw.
Outsider
Fast Inserter
Fast Inserter
Posts: 115
Joined: Sat Jan 10, 2015 12:23 am
Contact:

Re: [MOD 0.12.5+] Advanced Logistics System

Post by Outsider »

waduk wrote:Yes, exactly that.
I'm aware there are no config option, i have to add the code.
I see in control.lua this line at 77 :

Code: Select all

normal = {
            name = "name",
            total = "total",
            woc = "wooden-chest",
            irc = "iron-chest",
            stc = "steel-chest",
            smc = "smart-chest",
        }
I also search where else the code being referenced, found it on main.lua :

So, is that the two files that i have to changed/add if i want to add my custom chest, or is more complicated than that ?
I'm a complete noob on modding btw.
Yes you are on the right track.. but it's not really straightforward and you will run into issues.

so you can add your custom chest to the list above, the left code is just an internal code and you can use anything here, the code to the right is the actual entity name, but simply adding a new chest type here won't work and it will cause errors, mainly because these codes are used to load the styles for the sorting/filter icons, so if you do add your own custom chest with a custom code, the mod won't be able to find it's style and will crash.

a simple solution here would be to replace on of the existing chests on the list with your own, for example the smart-chest, to do that just replace "smart-chest" on the codeToName list to your custom entity name "custom-chest" or whatever :)

the harder solution involves 2 options, one would involve code changes, which i will list here if you feel like doing it :

gui\items.lua - Line 70 - you need to increase the table colspan by how many new chest types you have added, the default is 8, so if you added just the one chest type make it 9

gui\items.lua - Line 97 - this is where the table headers including the chest icons are generated using the table you mentioned, at this point you really have two options.. add button styles for the chest type you add using the code you used which is too much work i guess, or just add a conditional exception in this loop for the chest type you added forcing it not to load the button style or load a different style or maybe just a text..
the code below is what you should use to replace line 97, note here i am having it use the actual item icon -- didn't really test it so might not work

Code: Select all

if code == "customcode" then
codeFlow.add({type = "checkbox", name = "itemSort_" .. code, style = "item-icons-" .. field})
else
codeFlow.add({type = "button", name = "itemSort_" .. code, style = "lv_button_" .. code .. buttonStyle})
end
gui\widgets.lua - lines 291 - 298 is where the chest filters are added you need to do the same here as well..
On line 295 :

Code: Select all

if code == "customcode" then
chestsFilterFrame.add({type = "checkbox", name = "itemInfoFilter_" .. code, style = "item-icons-" .. name .. buttonStyle})
else
chestsFilterFrame.add({type = "button", name = "itemInfoFilter_" .. code, style = "lv_button_" .. code .. buttonStyle})
end
NOTE:
if you'd like to skip these code edits, you could just add new button styles for your custom chest, this is done in styles/main.lua look around line 1456, each button has two style for example lv_button_ppc / lv_button_ppc_selected is for the passive provider chests..
so you'd need to add your own styles and also link them to an image, or just use one of the existing styles and just rename the code part "ppc, apc.." ect
Advanced Logistics System - Provides a detailed view of your logistics network and the items within it
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.5+] Advanced Logistics System

Post by waduk »

Hmm,..i really tempted to use the shortcut like you mentioned (replacing vanilla entities with my custom one).
To my recall,i never use wood, and iron chest (i planed to add two chest).
And it's easier to update when you release a new version of Advanced Logistics System.

Thank you soo much. I know it's hard, but i'm gonna try it.
Will report the result.
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.5+] Advanced Logistics System

Post by waduk »

Yeah !
I did it ! My 2nd modded mod (this one is the hardest !)
Thank you so much !
I use " add new button styles ", because that one seems the most easiest.
Pic

There's no problem/error so far. Hope it stays that way !
Outsider
Fast Inserter
Fast Inserter
Posts: 115
Joined: Sat Jan 10, 2015 12:23 am
Contact:

Re: [MOD 0.12.5+] Advanced Logistics System

Post by Outsider »

waduk wrote:Yeah !
I did it ! My 2nd modded mod (this one is the hardest !)
Thank you so much !
I use " add new button styles ", because that one seems the most easiest.
Pic

There's no problem/error so far. Hope it stays that way !
Well done, the icons look great :)
Advanced Logistics System - Provides a detailed view of your logistics network and the items within it
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.5+] Advanced Logistics System

Post by waduk »

Uuhh,..sorry for bothering you again, i just realize the network tab is becoming a mess :
Pic
I'm gonna re-trace what i'm doing wrong.
I admit i moved the files here and there (backup etc) , so it could be a mistake when replacing files.

But also, instead of modifying the gui.png, i make a copy of that files, expanding it to place my icon, renamed that into gui2.png.
Then i replace all the path in styles/main.lua; changed all path refering to gui.png to gui2.png.
As far as i know, this shouldn't become a problem because all original coordinate still the same.
Or this assumption is a mistake?
Original gui.png
Modified gui2.png
EDIT : I just realize i accidentally obscured some of the original icon with the template.
Gonna fix that. hoping that is the problem.

EDIT 2 : Fix the icon problem, didn't solved it...hmm

EDIT 3 : I think this is happen because the network tab also using 10 colspan that the normal tab has.
Outsider
Fast Inserter
Fast Inserter
Posts: 115
Joined: Sat Jan 10, 2015 12:23 am
Contact:

Re: [MOD 0.12.5+] Advanced Logistics System

Post by Outsider »

waduk wrote:Uuhh,..sorry for bothering you again, i just realize the network tab is becoming a mess :
Pic
I'm gonna re-trace what i'm doing wrong.
I admit i moved the files here and there (backup etc) , so it could be a mistake when replacing files.

But also, instead of modifying the gui.png, i make a copy of that files, expanding it to place my icon, renamed that into gui2.png.
Then i replace all the path in styles/main.lua; changed all path refering to gui.png to gui2.png.
As far as i know, this shouldn't become a problem because all original coordinate still the same.
Or this assumption is a mistake?
Original gui.png
Modified gui2.png
EDIT : I just realize i accidentally obscured some of the original icon with the template.
Gonna fix that. hoping that is the problem.

EDIT 2 : Fix the icon problem, didn't solved it...hmm

EDIT 3 : I think this is happen because the network tab also using 10 colspan that the normal tab has.
this is a colspan issue, each table has it's own colspan and it's set when the table is initialized, just make sure that network table has the right colspan count.. and it will be fixed, this is something you can do/test without having to restart the game so should be easy to figure out the right number.
Advanced Logistics System - Provides a detailed view of your logistics network and the items within it
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.5+] Advanced Logistics System

Post by waduk »

Outsider wrote:....
this is something you can do/test without having to restart the game so should be easy to figure out the right number.
Ahhh,..great to hear ! Thanks !
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.12.5+] Advanced Logistics System

Post by waduk »

Sorry, i can't make it to work.
The way i see it, both "Network Item" and "Normal Item" tab, using the same code in item.lua, line 77.
Problem is Network Item only need 8 column, while the Normal Item need 10 column.
The workaround is if i make additional 2 new Network chest and styles, so the Network Items will have the same column.
But i don't have a custom logistic chest (yet).

The other way is to somehow force Network item to not using the same code/line colspan like Normal Item. But i don't know how to do that.
Is it requiring a major code rewrote ?
If it is, i don't want to waste your time.
So either i'm gonna use the first workaround or maybe redo the whole thing (just replacing normal item in control.lua with my custom chest) :(
Post Reply

Return to “Mods”