Where I Go Again Posted January 15, 2008 Share Posted January 15, 2008 I installed the latest builder 1.15 I loaded my lua file. I saved it to make everything "hold" I complied my cartridge and got an error message about an unexpected elseif function and no "end". Loaded the new lua file into a text editor. It seems the new builder hacked off half my input function. A rather complex input function at that. The first "if statement" was missing and the "end" was also missing. I cut-and-paste the old version into the new version. Loaded it back up into the lua file. And it still deletes the if-then-else input. (First line of code) I deleted the script. Then started over. Inputing the if-then-else function. Got halfway through it, saved it. Then cut and pasted the rest using the text editor. Then it finally worked. All that to say - if you are having a problem with your input functions in the new version, they may have gotten parsed. On the plus side, everything else seems to be working great in the new builder. Thanks, CJ Quote Link to comment
+davidloew Posted January 15, 2008 Share Posted January 15, 2008 (edited) I installed the latest builder 1.15 I loaded my lua file. I saved it to make everything "hold" I complied my cartridge and got an error message about an unexpected elseif function and no "end". Loaded the new lua file into a text editor. It seems the new builder hacked off half my input function. A rather complex input function at that. The first "if statement" was missing and the "end" was also missing. I cut-and-paste the old version into the new version. Loaded it back up into the lua file. And it still deletes the if-then-else input. (First line of code) I deleted the script. Then started over. Inputing the if-then-else function. Got halfway through it, saved it. Then cut and pasted the rest using the text editor. Then it finally worked. All that to say - if you are having a problem with your input functions in the new version, they may have gotten parsed. On the plus side, everything else seems to be working great in the new builder. Thanks, CJ ok, I'll have a look at that. Can you send me a sample of what your input function looked like before it got sliced and diced? It looks like there may have been some kind of parsing error in the if statement and that's probably what left you with just if and nothing else. David. Edited January 15, 2008 by davidloew Quote Link to comment
Where I Go Again Posted January 16, 2008 Author Share Posted January 16, 2008 This is compiled from two different version - so it may not match up exactly The user is asked a multiple choice question: What percentage of the mixture 10% A, 20% B, 30% C 20% A, 30% B, 10% C Not Sure Here's the function to see if the answer is correct. function zinputMixCompounds:OnGetInput(input) Mixture = input -- #GroupDescription=Mix the elements -- -- #Comment=Mix the element -- if Wherigo.NoCaseEquals(Mixture,"10% A, 20% B, 30% C") then Wherigo.MessageBox{Text=[[Congratulations! You got it right.]],Media=zmediaBarrel,} Wherigo.PlayAudio(zmediaComputerSound) zitempowder:MoveTo(Player) zitemMineral1:MoveTo(zoneMineralDeposit1) zitemMineral1.Commands["Grab"].Enabled = true zitemMineral2:MoveTo(zoneMineralDeposit2) zitemMineral2.Commands["Grab"].Enabled = true zitemMineral3:MoveTo(zoneMinderalDeposit3) zitemMineral3.Commands["Grab"].Enabled = true elseif Wherigo.NoCaseEquals(Mixture,"Not Sure") then Wherigo.MessageBox{Text=[[if you're not sure what to do, you can always seek out the Oracle.]],} else Wherigo.MessageBox{Text=[[Congrats! You've create a possibly deadly mixture.]],} Wherigo.PlayAudio(zmediaComputerSound) zitemBlackPowderMixture:MoveTo(Player) zitemMineral1r:MoveTo(zoneMineralDeposit1) zitemMineral2:MoveTo(zoneMineralDeposit2) zitemMineral3:MoveTo(zoneMineralDeposit3) zitemMineral1.Commands["Grab"].Enabled = true zitemMineral2.Commands["Grab"].Enabled = true zitemMineral3r.Commands["Grab"].Enabled = true end end When parsed it becomes: function zinputMixCompounds:OnGetInput(input) Mixture = input -- #GroupDescription=Script for Input of Mixture Answer -- -- #Comment=Script for Input of Mixture Answer Comment -- Wherigo.MessageBox{Text=[[Congratulations! You got it right.]],Media=zmediaBarrel,} Wherigo.PlayAudio(zmediaComputerSound) zitemMineral1r:MoveTo(zoneMineralDeposit1) zitempowder:MoveTo(Player) zitemMineral1.Commands["Grab"].Enabled = true zitemMineral1:MoveTo(zoneMineralDeposit1) zitemMineral2.Commands["Grab"].Enabled = true zitemMineral3:MoveTo(zoneCharcoalDeposit) zitemMineral3.Commands["Grab"].Enabled = true elseif Wherigo.NoCaseEquals(Mixture,"Not Sure") then Wherigo.MessageBox{Text=[[if you're not sure what to do, you can always seek out the Oracle.]],} else Wherigo.MessageBox{Text=[[Congrats! You've create a possibly deadly mixture.]],} Wherigo.PlayAudio(zmediaComputerSound) zitemPowderMixture:MoveTo(Player) zitemMineral1:MoveTo(zoneYellowMineralDeposit) zitemMineral2:MoveTo(zoneCharcoalDeposit) zitemMineral3:MoveTo(zoneWhiteMineralDeposit) zitemMineral1l.Commands["Grab"].Enabled = true zitemMineral2.Commands["Grab"].Enabled = true zitemMineral3.Commands["Grab"].Enabled = true end My guess is that it has something to do with the % symbol in the answer. The code will work for a couple of runs, then it gets parsed. Very strange. Thanks, CJ Quote Link to comment
+davidloew Posted January 16, 2008 Share Posted January 16, 2008 (edited) Thanks for the sample. The builder is crunching the "if Wherigo.NoCaseEquals(Mixture,"10% A, 20% B, 30% C") then" statement on the parsing. Because of this, it leaves the else and the end hanging. I'll have a look at it and get back to you. Try removing the commas from the statement: "10% A, 20% B, 30% C". This may be fumbling the parsing. I'll look at a fix for this and certainly confirm it. It's confirmed, the "," in the test is messing up the parsing... it was more than that. I will have a fix tomorrow for the builder that should deal with this statement. David. Edited January 16, 2008 by davidloew 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.