Back to Recipes Homepage
recipe picture
Recipe: Rav3n_pl LUA v1 in v2
Created by Rav3n_pl 70 1760
4.6
Your rating: None Average: 4.6 (5 votes)

Profile

Name: Rav3n_pl LUA v1 in v2
ID: 31012
Created on: Fri, 08/12/2011 - 07:45
Updated on: Fri, 08/12/2011 - 15:35
Description:

Library that allows use 99% v1 scripts in dev v2 update w/o any chnage. Just add it at front of your v1 code and paste into v2 script. Now you can use v1 and v2 commands v2 script.



Best For


Comments

Joined: 06/17/2010
Recipe ONLY FOR SCRIPT MAKERS!

This recipe DOES NOTHING!
It is only translation library.
If you not making LUA scripts by yourself it is USELESS for you!

Joined: 01/19/2011
Works great, except for the

Works great, except for the replace_ss(ss) function. I always get an error at the line that says structure.SetSecondaryStructure(i, ss). The error is
bad argument #2 to 'SetSecondaryStructure' (string expected, got nil)

I also got this error when i attempted to make an all loops function for one of my own scripts, so i don't know what the problem could be...

Joined: 06/17/2010
You need pass

ss code you want change to.

select_index(x)
replace_ss("L")

or use new code instead, like

for i=ss,se do
structure.SetSecondaryStructure(i,"L")
end

This library is temporary solution anyway :)

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

Yeah, as I was afraid of.
Those functions, which have just another name but the same number (and order) of parameters, renaming is simple.
It get's tricky if there are more parameters.

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

I also considered using this library, but this does lengthen the code, so I rather replace it.

But nice workaround, thanks for your work!

Joined: 08/06/2010
Groups: Contenders
it's an easy place to start converting.

Thanks for the helpful script.

function replace_aa(aa)
for i=1,structure.GetCount() do
if selection.IsSelected(i) then
structure.SetAminoAcid(i, aa)
end
end
end
function replace_ss(ss)
for i=1,structure.GetCount() do
if selection.IsSelected(i) then
structure.SetSecondaryStructure(i,ss)
end
end
end

can be replaced with:

function replace_aa(aa)
structure.SetAminoAcidSelected(aa)
end
function replace_ss(ss)
structure.SetSecondaryStructureSelected(ss)
end

Joined: 06/17/2010
Code

can be also converted https://fold.it/portal/node/991521

Want to try?
Add to Cookbook!
To download recipes to your cookbook, you need to have the game client running.
Parent

none

Children
Authors
Sitemap

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