Page 1 of 3

Re: [0.11.5] Belt Utilities

Posted: Mon Dec 08, 2014 7:11 pm
by berni1212
I am With Alpha we Test it in MP.

For now its Really good without anyproblems :)
No bugs for now we will Report them if we find some :)

Re: [0.11.5] Belt Utilities

Posted: Tue Dec 09, 2014 7:33 am
by CorrettoSambuca
Alright, I'll update the post and remove the old 1.2.2 version.
Thank you for the testing!

Re: [0.11.5] Belt Utilities

Posted: Tue Dec 09, 2014 8:47 am
by berni1212
CorrettoSambuca wrote:Alright, I'll update the post and remove the old 1.2.2 version.
Thank you for the testing!
No Problem Sir :)

Re: [0.11.5] Belt Utilities

Posted: Wed Dec 10, 2014 12:25 am
by Skellitor301
Any possibility this mod could also have compatable components for the Dytech mod? Since the mod adds a few more faster belts it would be ideal if this mod could tell if dytech logistics is installed and add in the research options and items for the faster belts. I like both that and this mod, but the slow down from extreme belts to express belt is irksome.

Re: [0.11.5] Belt Utilities

Posted: Wed Dec 10, 2014 12:40 am
by cullyn
I have only made it compatible with 0.11.5 and multiplayer, there is no intention at this stage to add any features due to my limited knowledge and time available.

Re: [0.11.5] Belt Utilities

Posted: Wed Dec 10, 2014 1:42 am
by Skellitor301
ah alright, thanks for answering my question :)

Re: [0.11.x] Belt Utilities

Posted: Thu Feb 05, 2015 5:51 pm
by gnz
This mod seems to break saving in 0.11.15 for now. See kovarex note about it here. Apparently fixed in .16 whenever that will be released.

Re: [0.11.x] Belt Utilities

Posted: Fri Feb 06, 2015 9:28 am
by kovarex
Yes, but the fix is just kind of patch of this mod doing something wrong.

The problem is here:

Code: Select all

function onLoad()

    for i,j in pairs(game.forces) do
        if j.technologies["logistics"].researched == true and j.recipes["basic-divider"] ~= true then
            j.technologies["logistics"].researched = false
            j.technologies["logistics"].researched = true
        end
        if j.technologies["logistics-2"].researched == true and j.recipes["fast-divider"] ~= true then
            j.technologies["logistics-2"].researched = false
            j.technologies["logistics-2"].researched = true
        end
        if j.technologies["logistics-3"].researched == true and j.recipes["express-divider"] ~= true then
            j.technologies["logistics-3"].researched = false
            j.technologies["logistics-3"].researched = true
        end
    end
end
The code is kind of evil (not only because it should move the technologies table into local variable, so it doesn't create the full table of technologies objects for every j.technologies["something"]), because it can change the data state on save and load and can desynchronise the game and make other problems.

The proper way to enable recipes for already researched technologies when the mod is loaded is to use the lua migrations. Take a look at data/base/migrations folder in the base game.

The
2014-03-20_Factorio_0.9.5.lua:

Code: Select all

if game.isdemo() then
  return
end

game.player.force.resettechnologies()
game.player.force.resetrecipes()

for index, force in pairs(game.forces) do
  if force.technologies["oil-processing"].researched then
    force.recipes["lubricant"].enabled = true
  end
end
This code ensures, that when someone had oil-processing already researched, he will get the lubricant recipe, but also this code is always only called when loading save before the specified version, so it is not executed again and again on every game load.

Re: [0.11.x] Belt Utilities

Posted: Fri Feb 06, 2015 10:51 pm
by WonderDog
Here is a quick fix for 11.15 build.

As kovarex's post added migration code and removed control.lua

Edit: Updated from FreeER's code and removed lubricant (copy paste error)

Re: [0.11.x] Belt Utilities

Posted: Fri Feb 06, 2015 11:48 pm
by FreeER
WonderDog wrote:As kovarex's post added migration code and removed control.lua
According to this comment by kovarex:
kovarex wrote:not only because it should move the technologies table into local variable, so it doesn't create the full table of technologies objects for every j.technologies["something"]
This would be a better way to do it (avoids recreation of technologies/recipes table), though admittedly it's only done once now instead of every load so it's not as big of an issue as before...
migration code

Re: [0.11.x] Belt Utilities

Posted: Sat Feb 07, 2015 7:57 am
by cullyn
let me find my hosted code and make the changes posted above.

Edit: i see people with more knowledge than me have taken a look. Thanks guys.

Re: [0.11.x] Belt Utilities

Posted: Mon Feb 09, 2015 6:16 pm
by SHiRKiT
I am sorry, but I've got an issue that I can't trace down to who's causing. Kovaerx thinks it's an issue on your side, but I can't confirm. Could you please take a look at https://forums.factorio.com/forum/vie ... =30&t=8492?

Thanks for the mod by the way. I love using it in specific situations where I save belt lanes instead of building a whole new one =] I love to save space!

Edit: Ignore my post, just saw even kovarex posted the solution here! :D

Re: [0.11.x] Belt Utilities

Posted: Wed Feb 11, 2015 5:29 pm
by CorrettoSambuca
I updated the main post with this download link, and rewrote it a bit.
Thank you everyone for the support; a special mention to WonderDog for the code and of course Kovarex for giving this tiny mod his time!

Re: [0.11.x] Belt Utilities

Posted: Sun Mar 29, 2015 8:58 pm
by jockeril
I love the idea of this mod !

I thought there should be something like this while watching a YouTuber mess up a build... :D

I might give it a try now that I'm starting a new 0.11.19 map

Re: [0.11.x] Belt Utilities

Posted: Sun Mar 29, 2015 9:40 pm
by aklesey1
Author can you make compatibilty with belts and splitters from dytech transportaion (new dytech) and bob logistics - may be as separate mods, I would be very grateful :D

Re: [0.11.x] Belt Utilities

Posted: Sun Apr 05, 2015 6:02 pm
by CorrettoSambuca
Unfortunately I have zero time and even less skills for modding, I just mantain the post. So if anyone posts an update/upgrade of the mod I'll link it in the main post, but I literally cannot do it myself...

Re: [0.11.x] Belt Utilities

Posted: Fri Apr 10, 2015 4:56 am
by Assisting
CorrettoSambuca wrote:Unfortunately I have zero time and even less skills for modding, I just mantain the post. So if anyone posts an update/upgrade of the mod I'll link it in the main post, but I literally cannot do it myself...
Well. It must be said that I'm new to this community, as you can probably tell, but I know my way around coding and I've got a little bit of experience with Lua. All of the source code seems straightforward enough, anyway. Let me see what I can do.

Re: [0.11.x] Belt Utilities

Posted: Sun Jul 12, 2015 2:22 pm
by GotLag
Hi everyone!

I'm going to release a new version when 0.12 comes out, but it's going to be a break from the previous version as I'm not including the divider-style entity, as its behaviour was always a bit hackish and had some visual bugs. On the plus side, I've got these things working properly now:
Image
Using the same technique I can also make a single-tile entity that will block one lane while allowing the other to pass, but I don't have a sprite for it yet.

I'd like to thank Cullyn, WonderDog and FreeER for updating this mod, and CorrettoSambuca for maintaining this thread.
I'd also like to apologise for my god-awful onLoad() script, I was very much learning as I went when I did it.

Re: [0.11.x] Belt Utilities

Posted: Fri Jul 17, 2015 5:27 pm
by GotLag
Changes to belt mechanics in 0.12.0 have completely broken the method I was using to block lanes, it may take a while to find a viable alternative.

Re: [0.11.x] Belt Utilities

Posted: Sat Jul 18, 2015 10:27 am
by jockeril
GotLag wrote:Changes to belt mechanics in 0.12.0 have completely broken the method I was using to block lanes, it may take a while to find a viable alternative.
Can you please also change the name of the mod file to be the same as the thread name (I think it's more fitting and it will help with finding the thread when wanting to remember what it is from looking in the mods folder - like I just did...)

tnx :geek: