problems with help() output
Case number: | 845813-2000767 |
Topic: | Game: Tools |
Opened by: | LociOiling |
Status: | Open |
Type: | Bug |
Opened on: | Tuesday, May 26, 2015 - 23:22 |
Last modified: | Thursday, October 29, 2020 - 22:22 |
I'm considering updating the list of functions found at http://foldit.wikia.com/wiki/Foldit_Lua_Functions
This page can be generated (semi-) automatically with the information returned by the help() function and a fixed table of LUA v1 equivalents. In reviewing the help() output, I've noticed some problems. It would be helpful is these could be corrected in a future release.
One outright error is that structure.TweakRotate appears without the leading parenthesis on its argument list:
void structure.TweakRotateinteger segmentIndex, number angle)
Other helpful information is omitted. For example, text for behavior.GetSlowFiltersDisabled says "[d]eprecated - use GetFiltersDisabled", which is helpful. But other deprecated or no-op functions, such as structure.TweakRotate, are not identified. (As far as I can tell, structure.TweakRotate exists, but does nothing.)
The suspected no-op functions include:
number behavior.GetBandStrengthFactor()
number behavior.GetBuriedSidechainShakeAccuracy()
number behavior.GetExposedSidechainShakeAccuracy()
integer behavior.GetShakeAccuracy()
number behavior.GetWiggleAccuracy()
void behavior.SetBandStrengthFactor(number factor)
void behavior.SetBuriedSidechainShakeAccuracy(number accuracy)
void behavior.SetExposedSidechainShakeAccuracy(number accuracy)
void behavior.SetShakeAccuracy(integer accuracy)
void behavior.SetWiggleAccuracy(number accuracy)
void structure.TweakRotate(integer segmentIndex, number angle)
void structure.TweakShift(integer segmentIndex, boolean shiftDirection)
void structure.TweakStraighten(integer segmentIndex)
It would be helpful if these function could be identified with "not implemented" or words to that effect.
Other functions, such as
current.GetExplorationMultiplier()
may be deprecated. As with the filter-toggling functions, "deprecated" would be helpful.
Finally, it would be helpful for the basic score functions
number current.GetScore()
number current.GetEnergyScore()
to be differentiated, making clear which is preferred, and which is deprecated.
I've created an updated wiki page: http://foldit.wikia.com/wiki/Foldit_Lua_Functions_TEST
Mostly automated based on help output, but some manual tweaking is still needed, as outlined above.
I looked at the Details under band.add() under the Foldit_Lua_Functions_TEST web page.
It the Details pointer seemed to point to the same web page as is pointed to by the
Foldit_Lua_Functions band.add() web page. Will any additions we do get over written
when the Foldit release is updated?
The "Detail" pages like http://foldit.wikia.com/wiki/Foldit_Lua_Function_band.Add are not affected by what I'm doing. My only goal is to replace the "main" page, http://foldit.wikia.com/wiki/Foldit_Lua_Functions
I believe the idea is that users add the detail pages as the need arises. I'm actually not sure the exact procedure for producing a page with all the standard sections, but you can certainly use the "classic editor" in source mode to copy a page you like, then paste it into the new page.
At the top of each detail page, you'll see a "LuaFunction" template like this one:
{{LuaFunction|returns=void|namespace=structure|functionname=TweakStraighten|arguments=(integer segmentIndex)|description=Straighten a sheet. Segment must be a sheet.|oldfunctionname=Unimplemented V2 function|}}
You can copy the template for the function you're working on from the main list, again using classic editor source mode.
The functions list on http://foldit.wikia.com/wiki/Foldit_Lua_Functions has now been updated.
See http://fold.it/portal/node/996467#comment-30545 for more detail.
Topic: General » Game: Tools |
Type: Suggestion » Bug |
Upgrading this to "bug", since there are some fixes needed. The original feedback kind of buried the problems in among the questions.
Filter functions
The help for the two preferred filter control functions:
help ( behavior.GetFiltersDisabled ) help ( behavior.SetFiltersDisabled )
returns the descriptions for their deprecated counterparts:
boolean behavior.GetSlowFiltersDisabled() (Deprecated - use GetFiltersDisabled) Return whether slow filters are currently disabled. If they are, CPU intensive filters are skipped and your score will not officially count. void behavior.SetSlowFiltersDisabled(boolean setting) (Deprecated - use SetFiltersDisabled) Set whether slow filters should be disabled. Turn on to skip some CPU intensive filters. Turn off to get credit for your score.
The help for these two functions should be updated to return the correct information.
TweakRotate
The help for the unimplemented TweakRotate function:
help ( structure.TweakRotate )
returns a signature that's missing the open parenthesis on the argument list:
void structure.TweakRotateinteger segmentIndex, number angle) Rotate a given segment by the angle specified. Segment must be a sheet or helix. Angle is in radians from -pi to pi.
The same problem occurs in long output of help().
The signature for TweakRotate in the help output should be updated to include the opening parenthesis.
In 20180711-7bdda27475-win_x86-devprev, the problems noted in the previous post are still present.
There are also some new functions, and the help () output for three of them has errors:
- bool filter.ConditionSatisfiedstring name
- number filter.GetBonusstring name
- bool filter.IsEnabledstring name
The help () output for these functions should be:
- bool filter.ConditionSatisfied(string name)
- number filter.GetBonus(string name)
- bool filter.IsEnabled(string name)
The specific help output has the same issues.
For example:
help ( filter.ConditionSatisfied )
returns
bool filter.ConditionSatisfiedstring name Is the condition satisfied or the filter active
which should be
bool filter.ConditionSatisfied(string name) Is the condition satisfied or the filter active
Still an issue as of 20180725-d14dae34c3-win_x86-devprev
To recap, there are a total of six functions with incorrect help output.
These commands return the detail for the deprecated counterparts:
*help ( behavior.GetFiltersDisabled )
*help ( behavior.SetFiltersDisabled )
The help() command and the equivalent detail command return incorrect signatures for these functions, as shown here:
*void structure.TweakRotateinteger segmentIndex, number angle)
*bool filter.ConditionSatisfiedstring name
*number filter.GetBonusstring name
*bool filter.IsEnabledstring name
Good news, the previous help errors listed above are fixed in 20201027-c8e345e846-win_x86-devprev.
Unfortunately, the new function metric.GetBonus has incorrect help output:
- number metric.GetBonusstring name
The left parenthesis is missing in the argument list.
One additional problem is that these help calls:
help ( behavior.GetFiltersDisabled )
help ( behavior.SetFiltersDisabled )
return the help for their deprecated counterparts:
boolean behavior.GetSlowFiltersDisabled()
(Deprecated - use GetFiltersDisabled) Return whether slow filters are currently disabled. If they are, CPU intensive filters are skipped and your score will not officially count.
void behavior.SetSlowFiltersDisabled(boolean setting)
(Deprecated - use SetFiltersDisabled) Set whether slow filters should be disabled. Turn on to skip some CPU intensive filters. Turn off to get credit for your score.
This is a bit confusing.