Page 2 of 6

Re: Treefarm Download

Posted: Wed Jan 20, 2016 12:37 am
by Eunomiac
Fixed it!

I think.

And you can too with this simple hack, which should allow you to load and play your game until an official fix is available for download: Open up the TreeFarm-Lite.zip file, double-click on the Treefarm Lite folder, and extract the "control.lua" file found there. Open control.lua in a text editor, and insert the following four lines (the ones between "BEGIN FIX" and "END FIX"). It doesn't really matter where you put them, but sticking it right before the first "script.on_event" is as good a place as any (as shown below):

Code: Select all

-- BEGIN FIX
script.on_load(function()
  seedTypeLookUpTable = {}
  populateSeedTypeLookUpTable()
end)
-- END FIX

script.on_event(defines.events.on_player_created, function(event) ...
Finally, save the file, then drag it back into the TreeFarm-Lite.zip archive, overwriting the control.lua file in there. (You won't be able to do this if Factorio is running, so exit out of it first.)

To explain: SeedTypeLookUpTable is a local variable that needs to be reinitialized when the game is loaded. TF-Lite v0.2.4 changed the script.on_load() event to script.on_configuration_changed(), but according to the wiki, the on_configuration_changed() event doesn't fire every time the game is loaded---only when mods are changed or updated. So, in v0.2.4, loading a game without any changes to mods doesn't fire the on_configuration_changed() event, and doesn't populate SeedTypeLookUpTable. Because SeedTypeLookUpTable doesn't have any values in it, any reference to it results in a nil value---the error we're all seeing. The above hack/fix simply repopulates SeedTypeLookUpTable every time the game is loaded.

Could this cause problems? I don't see how, but it's possible. Is there a better and/or more elegant way to do this? Almost certainly---as I said, I know Lua, but I know nothing about Factorio's implementation of it :)

Re: Treefarm Download

Posted: Wed Jan 20, 2016 1:13 am
by Blu3wolf
There is an easier way to do this, actually, but its subtle...

Just try using 0.2.3 over 0.2.4. Apologies for the confusion!

Re: Treefarm Download

Posted: Wed Jan 20, 2016 12:42 pm
by katalex
Eunomiac, thank you. Really work!!!

Re: Treefarm Download

Posted: Thu Jan 21, 2016 12:28 am
by Buggi
Actually there was a little more scripting involved than just simple renaming things. You might run into further script errors.

I have a fully working and tested updated version here:
https://forums.factorio.com/forum/vie ... 20&t=18870

Re: Treefarm Download

Posted: Fri Jan 22, 2016 5:04 am
by vaderciya
I'm using Factorio 0.12.20 with bobs mods and a few others, but I can't seem to get treefarm to show up, I've tried the latest versions of both treefarm lite, and treefarm AC, and It just won't show up as loaded in the game. But I really need this mod to work, can anyone help me??

Re: Treefarm Download

Posted: Fri Jan 22, 2016 7:05 am
by kinnom
are there any optional dependencies messing stuff up?

Re: Treefarm Download

Posted: Sat Jan 23, 2016 5:38 am
by vaderciya
can anyone help me? D:

Re: Treefarm Download

Posted: Sat Jan 23, 2016 3:04 pm
by roy7
vaderciya wrote:can anyone help me? D:
If you click mods from main menu does it show up? If it is in red there is a problem.

Re: Treefarm Download

Posted: Sun Jan 24, 2016 4:43 am
by vaderciya
roy7 wrote:
vaderciya wrote:can anyone help me? D:
If you click mods from main menu does it show up? If it is in red there is a problem.
I put it in the mods folder, but in the mods tab in-game it doesn't show up, but the rest of the mods do just fine ):

Re: Treefarm Download

Posted: Mon Jan 25, 2016 3:48 am
by MiniMan
Using Treefarm 0.2.3 this error comes up if I try to load a save.

"Error while running on_load:__Treefarm-Lite__/control.lua.58: attempt to index global 'game' (a nil value)"

I'm using Factorio 12.21

Re: Treefarm Download

Posted: Mon Jan 25, 2016 8:36 pm
by Eunomiac
Buggi wrote:Actually there was a little more scripting involved than just simple renaming things. You might run into further script errors.

I have a fully working and tested updated version here:
https://forums.factorio.com/forum/vie ... 20&t=18870
Hrm, I'm a bit confused: The one at that link is a lower version number than this one. Are there two forks of TreeFarm right now?

Re: Treefarm Download

Posted: Mon Jan 25, 2016 9:07 pm
by roy7
Eunomiac wrote:Are there two forks of TreeFarm right now?
Indeed there are.

Re: Treefarm Download

Posted: Mon Jan 25, 2016 9:28 pm
by vaderciya
I'm still having the problem where neither of the treefarm versions show up in the in-game mods section, but I know for sure that both are in the mod folder, in the factorio files,
I need treefarm to work so I can have lots of wood for bob's mods
I greatly need, and appreciate help

Re: Treefarm Download

Posted: Tue Jan 26, 2016 6:05 pm
by Eunomiac
roy7 wrote:
Eunomiac wrote:Are there two forks of TreeFarm right now?
Indeed there are.
Which one should I use? Is one of them less up-to-date with the most recent Factorio builds and/or less compatible with Treefarm-AC?
vaderciya wrote:... I need treefarm to work so I can have lots of wood for bob's mods
Regarding Bob's Mods, the "intended" progression is to replace wood from trees with synthetic wood, which you make using Heavy Oil (I think you gain access to it with the Oil Processing technology). Depending on how far along you are, that should help you move forward in Bob's Mods.

Regarding Treefarm, I can't think of a single reason why Treefarm-Lite wouldn't appear in the mods list, assuming you downloaded the .zip file and put it in your mods directory. Try deleting the .json file in the mods directory (or moving it somewhere else), so that Factorio regenerates a fresh one, AND delete the Treefarm mods, redownload them, and put them into your mods folder. Then start up Factorio and see if they appear. If none of that works, then I'd suggest a fresh Factorio install---just backup your saves as well as all the mods that do work (just to save you the effort of redownloading them).

Re: Treefarm Download

Posted: Tue Jan 26, 2016 7:19 pm
by roy7
vaderciya wrote:I'm still having the problem where neither of the treefarm versions show up in the in-game mods section, but I know for sure that both are in the mod folder, in the factorio files,
I need treefarm to work so I can have lots of wood for bob's mods
I greatly need, and appreciate help
Bob's uses Heavy Oil -> Syntheic Wood as a long term solution. However, you might look at the Greenhouse mod. It can make wood and doesn't cause performance problems at high # of factories like Treefarm can. Treefarm does add a variety of other things though. Personally I've been using greenhouses for wood and TreeFarm for everything other than wood growing.

Re: Treefarm Download

Posted: Sun Jan 31, 2016 2:08 am
by Eunomiac
roy7 wrote:
Eunomiac wrote:Are there two forks of TreeFarm right now?
Indeed there are.
Sorry to ask again, but I think I hid my first try by sticking it in the middle of an unrelated reply: Which fork should I use? Is one of them more stable than the other, more compatible with Treefarm-AC and Bobs Mods, or otherwise superior?

Re: Treefarm Download

Posted: Sun Feb 14, 2016 4:38 am
by vaderciya
Eunomiac wrote:
roy7 wrote:
Eunomiac wrote:Are there two forks of TreeFarm right now?
Indeed there are.
Which one should I use? Is one of them less up-to-date with the most recent Factorio builds and/or less compatible with Treefarm-AC?
vaderciya wrote:... I need treefarm to work so I can have lots of wood for bob's mods
Regarding Bob's Mods, the "intended" progression is to replace wood from trees with synthetic wood, which you make using Heavy Oil (I think you gain access to it with the Oil Processing technology). Depending on how far along you are, that should help you move forward in Bob's Mods.

Regarding Treefarm, I can't think of a single reason why Treefarm-Lite wouldn't appear in the mods list, assuming you downloaded the .zip file and put it in your mods directory. Try deleting the .json file in the mods directory (or moving it somewhere else), so that Factorio regenerates a fresh one, AND delete the Treefarm mods, redownload them, and put them into your mods folder. Then start up Factorio and see if they appear. If none of that works, then I'd suggest a fresh Factorio install---just backup your saves as well as all the mods that do work (just to save you the effort of redownloading them).

I've played a lot of bob's mods, so I'm very much aware that the intended purpose is to make synthetic wood out of heavy oil. However, I don't want to do that. I make extremely large factories in my games, even larger with bobs mods. And I used treefarm before to just generate a lot of wood for me. It is infinitely better than using so much heavy oil that needs to be used for other things.

On a more important note, I can confirm that the .zip files are in the mods directory, I also tried generating a new mods file and putting a fresh version of treefarm in that, it did not work. I also backed up my saves and removed factorio completely from my computer, reinstalled it, repeated the earlier steps, and still no dice.

I can live without it, but I'd really rather prefer to use it, as it's a really good essential mod.
I really appreciate everyone's help and assistance

Re: Treefarm Download

Posted: Sun Feb 14, 2016 8:07 am
by sinrise
Factorio 12.22. I'm getting the line 58 'attempt to index global 'game' error but it only happens when I try to load a save. I can start a new game and the mods seems to work fine, but the minute I try to load the game again, I get the error. I'm using TFL 12.23 and AC 12.23. Too bad this happened several hours into a build :(. I tried using Factorio 12.21 but the savegames aren't compatible. :( :( Any ideas?
Image

Re: Treefarm Download

Posted: Sun Feb 14, 2016 10:15 pm
by sinrise
I've tried this on 12.21, and 12.19 and I'm getting the exact same error.

Re: Treefarm Download

Posted: Sun Feb 21, 2016 12:42 am
by capoeiramen
sinrise wrote:Factorio 12.22. I'm getting the line 58 'attempt to index global 'game' error but it only happens when I try to load a save. I can start a new game and the mods seems to work fine, but the minute I try to load the game again, I get the error. I'm using TFL 12.23 and AC 12.23. Too bad this happened several hours into a build :(. I tried using Factorio 12.21 but the savegames aren't compatible. :( :( Any ideas?
Image
this mod work for me, its weird, that i've foun it on russian internet :D (work for newest factorio 0,12,x)

http://factorio.pp.ua/addition/Treefarm