48xor48 Posted July 20, 2018 Share Posted July 20, 2018 Hi, trying to bring the LUA code of my Wherigo into a form that is accepted by the online compiler, I've discovered that an item command named "Debug" causes the compiler to return an invalid GWZ file error. TCmd_Diary = { Read = Wherigo.ZCommand({ Text = "Lesen", CmdWith = false, Enabled = false, EmptyTargetListText = "" }), Debug = Wherigo.ZCommand({ Text = "Debug", CmdWith = false, Enabled = false, EmptyTargetListText = "" }), } TCmd_Diary.Read.Custom = true TCmd_Diary.Read.Id = "2761" TCmd_Diary.Read.WorksWithAll = true TCmd_Diary.Debug.Custom = true TCmd_Diary.Debug.Id = "2762" TCmd_Diary.Debug.WorksWithAll = true That was an iterative bug hunting. I've reduced the code to some images and the cartridge settings until it compiled, and then added code blocks until the error occurred after the item commands. Then removing command block for command block until it compiled again. Adding the Diary back - boom. Then I removed the 4 lines for the "Debug" command - success. Finally I've removed the command completely from the game, built a new GWZ file without it, and all the other 18,000 lines of LUA code compiled just fine. I hope I haven't caused any trouble with these experiments, I've got 2 times a Service Unavailable in the process, where I needed to close the browser and logon again. Quote Link to comment
Ranger Fox Posted July 21, 2018 Share Posted July 21, 2018 I think you're referring to the compiler on Wherigo.com. Some people in the Wherigo Foundation are notified when someone's cartridge doesn't pass the Wherigo Foundation's compiler (in case there's a bug we need to fix or help we can give). I have seen some errors, but the most frequent ones are due to the person not including an image file with the cartridge. (Please note my casing in the command names below.) On to your issue. I was able to reproduce it by creating an empty cartridge with one character. I attached two commands to that character, one of them being "Debug". Groundspeak's Builder was able to compile the cartridge, but the online compile at Wherigo.com was not. I could cause an exception in the compiler by creating the command "end", but not "End". "nil" breaks the Builder's compiler as well. I suspected most of lua's reserved keywords would break the compiler. You can find that list in the lua 5.1 reference manual. I knew about the lua debug library, but didn't realize "Debug" was something that would trip up the compiler. It does not cause the Wherigo Foundation's compiler to throw an error, so that's wonderful, though that doesn't do you much good as you have to host the cartridge on Wherigo.com to pass the geocache review. This is a nice piece of information I haven't heard anyone find before. No, you didn't cause any trouble with the experiments--at least not to the community. If you manage to take down Wherigo.com with your testing, that might be good in the long run as I would hope it would encourage someone to look into the issue and fix it. I'm all for some attention being thrown Wherigo's way. I've tried many ways over the years. Quote Link to comment
48xor48 Posted July 22, 2018 Author Share Posted July 22, 2018 Thank you very much for researching this further. I took a look into an old cartridge, and the original Builder prefixes everything (zmedia, cart, zone, ...), but not the commands. Though I haven't tested now if the critical names are catched in the Builder itself, when you define the commands, but my guess is no. I'm done for now with the cartridge. After 5 years of work (with a large pause within thanks to Pokemon) and developing my own scripting based compiler for it, it's finally published on Wherigo.com, and the geocache was published yesterday. If I have to touch it again for fixes or to make it compatible to more players, I'm going to add prefixes for everything that's currently not prefixed, just to be on the safe side for any future extensions and new cartridges. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.