Nils Posted March 21, 2014 Share Posted March 21, 2014 Sorry for the two threads at once but they aren't strictly related. I'm adding some new plant/seed types in my mod. I've created the plant and the seeds. I'm able to insert both onto my character. I can eat the plant, make recipes with it. All that works. The only problem I'm having is that I don't know how to get the Sow Seed menu to recognize my new plant types. I'm also not sure how to tell it what art to use when planted and during the growth cycles. Any help is appreciated. Link to comment Share on other sites More sharing options...
vitaminlost Posted March 22, 2014 Share Posted March 22, 2014 please check it media>lua>Farming>ISUI>ISFarmingMenu-- plant seed subMenu &ISFarmingMenu.haveSeed media>lua>Translate>EN>Farming_ED-- vegetables name (type of seed) Nils 1 Link to comment Share on other sites More sharing options...
Nils Posted March 22, 2014 Author Share Posted March 22, 2014 Thanks vitaminlost! That's exactly what I needed. Link to comment Share on other sites More sharing options...
Nils Posted March 22, 2014 Author Share Posted March 22, 2014 Sorry, looks like I spoke too soon. You definitely have me in the right direction, vitaminlost, so thanks, but now after creating a new entry all of the entries on the Sow Seed are gone, presumably because I crashed the entire farming menu. Stack Trace reads: function: doFarmingMenu -- file: ISFarmingMenu.lua line #117 (where my new entry is)attempted index: seedsRequired of non-table: null I assume the problem is I didn't specify how many seeds my new plant takes but I didn't see the option to specify it elsewhere in the script. (Although I did see and add to the haveSeed function). Edit: Found the farming_vegetableconf file. Looks like I need to add entries here too? Dabbling now. Link to comment Share on other sites More sharing options...
vitaminlost Posted March 22, 2014 Share Posted March 22, 2014 please check it and add newplants code.basicFarming file--basicFarming.rottenThis farming_vegetableconf file--farming_vegetableconf.grow...--farming_vegetableconf.icons--farming_vegetableconf.props Nils 1 Link to comment Share on other sites More sharing options...
Nils Posted March 22, 2014 Author Share Posted March 22, 2014 vitaminlost, you've been such a great help! Unfortunately I'm not 100% there. The menu is fixed and I can plant! Unfortunately the plant has no image. I used the tomato images for defaults. The tomato icon shows up when I get Info on the plant, but the plant itself is invisible. Link to comment Share on other sites More sharing options...
vitaminlost Posted March 22, 2014 Share Posted March 22, 2014 basicFarming file line #219?-- grow the plant elseif(planting.typeOfSeed == getText("Farming_NEW PLANTS NAME")) thenplanting = farming_vegetableconf.grow NEW PLANTS NAME(planting, nextGrowing, updateNbOfGrow); Nils 1 Link to comment Share on other sites More sharing options...
Nils Posted March 22, 2014 Author Share Posted March 22, 2014 Thanks again for all of your help, vitaminlost. I'm not sure how I missed the growPlant function, but I found it thanks to you. (Although mine sits at line 307 and the getText seems to be replaced with a string. Maybe we're on different builds?) In any case, the plant is now visible! But! Now the info panel, which was working before, is broken. The tomato icon still appears, but all of the text is missing and I get a stack trace:function: render -- file: ISFarmingInfo.lua line #58Object tried to call nil in renderI've checked the ISFarmingInfo but I don't see any new definitions that need to be made in there. After double checking the other files to make sure I didn't have a simple typo or missing something else obvious but without actually changing anything I reloaded and got a new stack trace when checking the info panel:function: createChildren -- file: ISFarmingWindow.lua line #27Obviously I've still missed something. Help me vitaminlost, you're my only hope! Link to comment Share on other sites More sharing options...
vitaminlost Posted March 23, 2014 Share Posted March 23, 2014 broken info panel?please screen shot Link to comment Share on other sites More sharing options...
Nils Posted March 23, 2014 Author Share Posted March 23, 2014 Looks like my problem has evolved again. There was a small update today (~200k) that changed my problem. Before, I was getting an info panel with an icon but no text. Now, when I click on info, no window appears at all. Link to comment Share on other sites More sharing options...
vitaminlost Posted March 23, 2014 Share Posted March 23, 2014 My game is the build23.what is New plant name?If you tell it to me, i'll write and test the code. Link to comment Share on other sites More sharing options...
Nils Posted March 23, 2014 Author Share Posted March 23, 2014 I'm running build 25 so that's at least a little bit of the problem. vitaminlost, I would love it if you could fix my scripts for me, but I would love it more if you could tell me what I'm missing so I can fix it myself in the future. You know, teach a man to fish and all that. Here's a zip of what I have so far:Edit: files old, link removed. Link to comment Share on other sites More sharing options...
vitaminlost Posted March 24, 2014 Share Posted March 24, 2014 Oh...build25...it will not work in my PC.guessed the process. -------------------------------------game start updefault file readyour MOD file read default ISFarmingMenu file >> overwrite >> your MOD ISFarmingMenu file(+cannabis's category) *you can sowing cannabis seedbutdefault basicFarming file(non cannabis's category) & default farming_vegetableconf file(non cannabis's category) sonon table null >> broken info ---------------------------------------I...think soyou should add the code in your MOD folder.your MOD basicFarming file(+cannabis's category) &your MOD farming_vegetableconf file(+cannabis's category) Link to comment Share on other sites More sharing options...
Nils Posted March 24, 2014 Author Share Posted March 24, 2014 For guessing the process, you've done a great job. I actually do have the basicFarming and farming_vegetableconf file included in the mod, but they're in the server folder, not the client, because they got moved over in build 25. Just to try it, I put all three files in the client folder, but I'm still getting errors. When I get a chance I'll switch to an older build and see if that's my problem. Thanks again for all your help. Link to comment Share on other sites More sharing options...
vitaminlost Posted March 25, 2014 Share Posted March 25, 2014 I'm sorry but I guess I missed your point.I found your FARMING MOD( basicfariming &farming_vegetableconf file)build25 plants data seems to be manage by ISPlant file.and Management of object has a new. If you want to test for the time being.ISFarminginfo file -- title of the plant if false and isClient() then self:drawTextCentre(self.plant.typeOfSeed, 120, 25, title_rgb["r"], title_rgb["g"], title_rgb["b"], 1, UIFont.Normal); else if self.plant:getObject() then self:drawTextCentre(self.plant:getObject():getObjectName(), 120, 25, title_rgb["r"], title_rgb["g"], title_rgb["b"], 1, UIFont.Normal); else self:drawTextCentre("Dead " .. self.plant.typeOfSeed, 120, 25, title_rgb["r"], title_rgb["g"], title_rgb["b"], 1, UIFont.Normal); end endI think the need for modification of this part. Link to comment Share on other sites More sharing options...
Nils Posted March 26, 2014 Author Share Posted March 26, 2014 Well, vitaminlost, it looks like you were basically right this whole time. I think my problem was using outdated lua files. I started over, copying the latest lua files from build 25c, and then going in and adding new plant entries whenever I saw them. You already pointed them out but for the sake of putting it in one place, those files are: client/Farming/ISUI/ISFarmingMenu.luaserver/Farming/basicFarming.luaserver/Farming/farming_vegetableconf.luashared/Translate/EN/Farming_EN.txt Loaded the mod up and everything works great. I can plant, water, see info. No errors! Now, as soon as we can add plant textures, my mod will be complete. Thank you again for answering all of my questions! Link to comment Share on other sites More sharing options...
vitaminlost Posted March 26, 2014 Share Posted March 26, 2014 I'm sure your MOD would be a nice works! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now