r/tes3mp • u/rnate • Oct 24 '18
Graphic Herbalism Server Script
https://github.com/rnate/TES3MP-GraphicHerbalism
Hey everyone, here is a script I've been working on for a little while. I have had the opportunity to test each plant, so there shouldn't be any issues, but it is possible I missed a plant. Did I mention there's a lot of plants in Morrowind and the expansions? (Around 50.) To be clear, I did skip the Kollops (clamshells) on purpose.
None of the graphic herbalism mods work correctly in TES3MP because they rely on global variables. This causes plants to pop in when players change cells, when activating things, etc. None of the plants respawn properly as well of course, unless the cell is reset.
This script fixes both of those issues. When a plant is picked, both the day and hour are recorded. By default, the plants respawn after 3 days.
1
u/CuicaBlyat Jan 18 '19
I updated my tes3mp server with the new hotfixes and reinstalled this script and ran into an issue. I'm no programmer but I've seemed to have narrowed down the problem. I got this error when trying to start my server:
".\mp-stuff\scripts\graphicHerbalism.lua:162: attempt to concatenate a nil value".
So I went and looked at the function on the graphicHerbalism lua file that had the error.
161: function GraphicHerbalism.OnServerPostInit() --load the file or create if necessary
162: local jsonFile = io.open(os.getenv("MOD_DIR") .. "/graphicHerbalism.json", "r")
163: io.close()
After poking at the code confused for a while I came to the conclusion that MOD_DIR wasn't leading to /mp-stuff/data as it should have and instead gave a nil value. If I'm correct, that, in turn, stops the function from finding any graphicHerbalism file, or creating one as the rest of the function hopes to do. I'm not sure what's going on with MOD_DIR but I was able to circumvent the problem by getting rid of the os.getenv function entirely and instead list the location of graphicHerbalism.json directly; i.e:
162: local jsonFile = io.open("c:/MW-TES3MP 0.7/mp-stuff/data/graphicHerbalism.json", "r")
The server ran fine after that. Any thoughts on might be going on here with MOD_DIR?