New functions to return selected segments in lua

Case number:845813-987849
Topic:Game: Tools
Opened by:TheGUmmer
Opened on:Sunday, June 13, 2010 - 21:46
Last modified:Saturday, July 27, 2013 - 04:41


Currently in the selection interface you can select one, two, or more sections of segments and run limited scripts against them. Would it be possible to have some lua functions that return the selection number and start and end segments numbers? This way scripts could be run with out hard coding the the segment you want to work with.

get_selections_count() returns number of selections.
get_selection_start(selection number) returns start of selection supplied
get_selection_end(selection number) returns end of selection supplied
get_selections() returns all selections in an array (selection number, selection start, selection end)


(Sun, 06/13/2010 - 21:46  |  9 comments)

Joined: 09/18/2009
Groups: SETI.Germany

I second that.
At the moment, you have to do these entries "by hand" using a table, also for freezing, which always needs double the code.

Joined: 09/18/2009
Groups: SETI.Germany

I were already pleased with just a boolean information, which returns is_selected(index)=true if it is selected and false if it is not selected (for frozen segments (backbone,sidechain), too).

Joined: 04/19/2008
Groups: None

Fully agree with Crashguard303, I'd like to see a is_selected(index), is_backbone_frozen(index) and is_sidechain_frozen(index).

Tlaloc's picture
User offline. Last seen 1 day 10 hours ago. Offline
Joined: 08/04/2008
Groups: Mojo Risin'

I created a wiki page for suggestions for new functions:

Please add all suggested new functions there, as well as creating a suggestion in feedback. Hopefully, we can come to some consensus on what functions should be implemented and how.

Joined: 09/18/2009
Groups: SETI.Germany

Good Idea!
I also think a single page for desired lua functions makes sense, so we don't need to fish them out of all the single feedback posts.

By the way:
Is there already wiki-entry which shows "emulated" basic functions (like integer and absolute value) we can use, as long as the standard-library is not included?

Joined: 06/17/2010

Want it too! Badly!

Joined: 05/09/2008
Groups: Void Crushers

bump, so all the new scripters can see it

Joined: 08/06/2010
Groups: Contenders

I was looking at the example gui compress recipe. It allows the user to select segments then bands other segments to it. It seems like functions exposed to the gui recipes should be exposed to the script recipes. I think I'd have to look harder to figure out how the actions are specified and if I could get to the functions via the scripts. Since I didn't study it too hard I can't do more than suspect action0, action1, etc. are the name of the functions and the gui scripts are just tables processed by some LUA function. I'm probably completely wrong.

{action0, arg1, arg2}
{commnet, 'this is a comment so just ignore it'}
{action2, arg1}
for i=1,#recipe do

function comment(x)

function action0 (args)

spmm's picture
User offline. Last seen 17 hours 38 min ago. Offline
Joined: 08/05/2010
Groups: Void Crushers
Status: Open » Closed

this can be done now re-open if it can't


Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Amazon, Microsoft, Adobe, RosettaCommons