Treefarm Download

Topics and discussion about specific mods
Eunomiac
Burner Inserter
Burner Inserter
Posts: 12
Joined: Tue Jan 19, 2016 9:31 am
Contact:

Re: Treefarm Download

Post 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 :)

User avatar
Blu3wolf
Fast Inserter
Fast Inserter
Posts: 202
Joined: Thu Apr 09, 2015 5:20 am
Contact:

Re: Treefarm Download

Post 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!

katalex
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Mon Nov 10, 2014 7:44 pm
Contact:

Re: Treefarm Download

Post by katalex »

Eunomiac, thank you. Really work!!!

User avatar
Buggi
Fast Inserter
Fast Inserter
Posts: 100
Joined: Wed May 27, 2015 6:23 am
Contact:

Re: Treefarm Download

Post 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
- Buggi -
Here's my Humble YouTube channel: https://www.youtube.com/c/FlexibleGames

User avatar
vaderciya
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Sat Nov 07, 2015 1:55 am
Contact:

Re: Treefarm Download

Post 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??

kinnom
Filter Inserter
Filter Inserter
Posts: 705
Joined: Fri Dec 26, 2014 4:20 pm
Contact:

Re: Treefarm Download

Post by kinnom »

are there any optional dependencies messing stuff up?
no yes yes no yes no yes yes

User avatar
vaderciya
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Sat Nov 07, 2015 1:55 am
Contact:

Re: Treefarm Download

Post by vaderciya »

can anyone help me? D:

roy7
Filter Inserter
Filter Inserter
Posts: 337
Joined: Fri Dec 12, 2014 4:24 pm
Contact:

Re: Treefarm Download

Post 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.

User avatar
vaderciya
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Sat Nov 07, 2015 1:55 am
Contact:

Re: Treefarm Download

Post 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 ):

MiniMan
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Dec 19, 2014 9:05 am
Contact:

Re: Treefarm Download

Post 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

Eunomiac
Burner Inserter
Burner Inserter
Posts: 12
Joined: Tue Jan 19, 2016 9:31 am
Contact:

Re: Treefarm Download

Post 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?

roy7
Filter Inserter
Filter Inserter
Posts: 337
Joined: Fri Dec 12, 2014 4:24 pm
Contact:

Re: Treefarm Download

Post by roy7 »

Eunomiac wrote:Are there two forks of TreeFarm right now?
Indeed there are.

User avatar
vaderciya
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Sat Nov 07, 2015 1:55 am
Contact:

Re: Treefarm Download

Post 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

Eunomiac
Burner Inserter
Burner Inserter
Posts: 12
Joined: Tue Jan 19, 2016 9:31 am
Contact:

Re: Treefarm Download

Post 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).

roy7
Filter Inserter
Filter Inserter
Posts: 337
Joined: Fri Dec 12, 2014 4:24 pm
Contact:

Re: Treefarm Download

Post 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.

Eunomiac
Burner Inserter
Burner Inserter
Posts: 12
Joined: Tue Jan 19, 2016 9:31 am
Contact:

Re: Treefarm Download

Post 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?

User avatar
vaderciya
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Sat Nov 07, 2015 1:55 am
Contact:

Re: Treefarm Download

Post 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

User avatar
sinrise
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Jan 18, 2016 5:41 am
Contact:

Re: Treefarm Download

Post 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

User avatar
sinrise
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Jan 18, 2016 5:41 am
Contact:

Re: Treefarm Download

Post by sinrise »

I've tried this on 12.21, and 12.19 and I'm getting the exact same error.

capoeiramen
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Feb 21, 2016 12:39 am
Contact:

Re: Treefarm Download

Post 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

Post Reply

Return to “Mods”