Jump to content

Onex's Pot Farm!


LacidOnex

Recommended Posts

UPDATED AND STILL NOT WORKING :P Im going to bed - few questions about errors im getting:

 

1: Im using a texture pack, and in the info file i point to the .pack but it doesnt work. the name of my original tilesheet is also different than the packed file, will that cause an issue?

 

2: I keep getting exceptions about items not being items when it loads my main .txt... any ideas why?

 

3: Mods I see have all have something like ISFarmingMenu{}; but it keeps causing stack traces and/or nil errors, is that okay?

 

REQUIRES SOUL FILCHERS FARMING TIME <3 https://steamcommunity.com/sharedfiles/filedetails/?id=928422722

 

Onex's Pot Farm.7z

Edited by LacidOnex
Link to comment
Share on other sites

2) you'll have to hook into Events.OnFillContainer instead of using SuburbsDistributions to add fine control like that

 

3) The entire copying of files like that is a bad habit. It breaks mod compatibility when 2 mods overwrite the same files, and also makes mods harder to maintain when developers change something in the vanilla files.  But yes, you can just include your changed bits, a detailed explanation can be found here https://theindiestone.com/forums/index.php?/topic/22996-resolved-change-only-1-function-from-original/

Link to comment
Share on other sites

Im only using the version that requires your mod now - i put a link in the top for anyone who doesnt have it. I'm gunna keep bug smashing, maybe spend some time on stackoverflow and see if I can figure out why im getting this nil error every time.

Link to comment
Share on other sites

OPotISFarmingMenu{};   This is bad lua syntax....its basically trying to pass a {} table to a function named OPotISFarmingMenu (which is nil a nil value).

Even if that was a function, its bad lua syntax because it doesn't enclose the {} argument with a set of ( ) brackets (even though its still technically valid).  This would cause your nil error.  I'd assume what you meant to do was:

OPotISFarmingMenu = {} 

and assign a table to that variable.  Further down in that file you have:

OPotFarmMenu.doOpotFarmMenu = function(.....)

Which assigns the function into the OPotFarmMenu, which would also cause a nil error (table doesn't exist, did you mean OPotISFarmingMenu?)

 

Link to comment
Share on other sites

1 hour ago, Fenris_Wolf said:

OPotISFarmingMenu = {} 

is actually = {}; but yes, thank you. I fixed a TON of other syntax stuff, its running now, Im proofing menu compatibility with Soul Filchers mod.

 

Im having an issue with this now, I'm not sure what Soul Filcher intends me to point to since his menus build themselves... heres the whole thing, you can see an error code in line 73 of OPotISFarmingMenu if you try and plant anything

 

 

Onex's Pot Farm.7z

Link to comment
Share on other sites

The ; is actually irreverent and not required. lua only uses ; to separate multiple code statements on the same line, its not necessary for lines that only contain a single statement

without debugging the whole code (and looking at the other mod as well), a few obvious things that stands out for me at line 73 are:

 

OPotISFarmingMenu.onSeed

looks to be a unset nil value. Given the name 'onSeed', I assume this is supposed to be a function triggered when the seed is planted?

 

OPotfarming_vegetableconf.props

this isn't defined in the OPotfarming_vegetableconf table (from OPotfarming_vegetableconf.lua), there is a farming_vegetableconf.props table though.  Going to that file, a few other things stand out:

 

OPotFarmingMainw {}

missing = sign

 

OPotfarming_vegetableconf table assigned values before declaring, there should be a OPotfarming_vegetableconf = {}

OPotfarming_vegetableconf.sprite table assigned values before declaring, OPotfarming_vegetableconf.sprite = {}

 

These are just from quick glances though, not actually loading and testing, or fully reading the code.

Link to comment
Share on other sites

ohgod that w must have snuck in like 3 revisions ago...

 

I fixed the sprite table issues, I had names them wrong and I guess I was using an earlier naming convention so FarmingMain has been named properly now.

 

From what Ive gathered, Soul Filchers mod should handle the on.seed function. I wouldn't be surprised if theres more rougue w's in my code, but heres what I have so far. I'm still trying to figure out whats wrong with this line, i double checked and all the tables it checks should be there now...

 

local OnexIMOption = subMenu:addOption("Indica Mids", worldobjects, ISFarmingMenu.onSeed, customseedsList.OnexIMSeed, OPotfarming_vegetableconf.props["OnexIM"].seedsRequired, "OnexIM", currentPlant, sq, player);

local OnexIMOption = subMenu:addOption("Indica Mids", worldobjects, ISFarmingMenu.onSeed, customseedsList.OnexIMSeed, OPotfarming_vegetableconf.props["OnexIM"].seedsRequired, "OnexIM", currentPlant, sq, player);

 

Onex's Pot Farm.zip

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...