As part of our New Year's feedback clean up, may I suggest an ongoing bug post? With Lua V2 in the main we should see a fresh crop of them. I suspect this one from 2010 is mostly full of resolved issues: http://fold.it/portal/node/986954.
Here's my first two:
d = dialog.CreateDialog(test)
d.AddTextbox('Label',nil) – crash
error(nil) – crash
Reality check - the second parameter in the dialog.AddTextbox function is meant to be a string value.
You know this, right? (use two double quotation marks for nothing - "")
I tested dialog.AddButton, dialog.AddCheckbox, dialog.AddLabel, dialog.AddSlider, dialog.AddTextbox, and dialog.CreateDialog functions, replacing expected strings with nul, and it crashes. One would therefore assume that this will occur with any functions that are passed a nul, when they expect a string.
Assertion crasher – band.GetLength() on any band created with band.Add() or band.AddToBandEndpoint() to a band created with band.Add(). Both main and beta client, the GetLength fix from http://fold.it/portal/node/991361 has not been applied in either, yet.
ERROR: seqpos >= 1
ERROR:: Exit from: D:\scooper\foldit\release_server\mini-interactive-main\rosetta_source\src\core/conformation/Conformation.hh line: 288
17: BaseThreadInitThunk +18 bytes (no line)
18: RtlInitializeExceptionChain +99 bytes (no line)
19: RtlInitializeExceptionChain +54 bytes (no line)
Actualy there should be 2 lists.
And these should be pinned down on the feedback at the top.
Both lists should be maintained by the foldit group.
List 1: Known errors, with information about the status. Solved ones should stay there for a couple of months, so reappearence can be noted.
List 2: Known non errors. F.i. that it is possible that scores jump very wildly during scripts. (That happened to me and I thought it was a bug, but later rerunning and checking showed it was 1 clash that caused it)
And maybe also something like that for the suggestions.
Bug from 1/28/2012 has been fixed.
A couple of things that need addressing:
1) Fix the parameter to structure.RebuildSelected () so that it does the correct number of rebuilds. If this is impractical for some weird reason, or if there's major overhead in setting up a rebuild, then a function that lets you step back through the Undo graph would be a perfectly acceptable alternative.
2) If Lua's exception handling allows it, allow a "Cleanup" function to be called on unexpected termination, such as when the user cancels a script. This has assumed additional importance with all the new behaviour sliders: cancelling a script often leaves CI, WAcc, etc, in an indeterminate state and there is currently no way for a script to set these back to their initial state.
Tried to use IsFrozen on 537, it does not find the not frozen parts.
Same with IsMutable, does not find the not mutable parts.
It turns out that you can create a Cleanup function already in Lua V2. V2 supports the xpcall function (see the Lua documentation). Clicking the Cancel button actually generates an error that can be trapped. Here is an example of using a cleanup function in V2 to reset the clash importance back to 1.00 if you hit cancel. Try hitting the Cancel button while it is performing the WiggleAll and watch it reset back to 1.00.
function test()
print("In test")
behavior.SetClashImportance(.01)
structure.WiggleAll(25)
behavior.SetClashImportance(1.00)
print("Done")
end
function cleanup()
print("Cleaning up")
behavior.SetClashImportance(1.00)
end
xpcall(test, cleanup)
I was bitten by this today.
It took me 3 crashes and a lot of headscratching to figure out that I made an error in a variable name, ListH instead of listH.
Anyhow this kind of error should be catched, the script may crash but the game shouldn't.