View topic - Bos to Lua conversion page



All times are UTC + 1 hour


Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: 29 Jun 2010, 06:28 
Cursed Zero-K Developer
User avatar

Joined: 07 Nov 2007, 21:48
Location: Horse
Use at your own risk.

Disclaimer:

Don't use Lua scripts unless you know what you're doing.
Lua scripts may run slower than Cob scripts.
Lua scripts may behave differently from Cob scripts.
Lua scripts may not be fully functional.
The Bos to Lua conversion page is incomplete.
The Bos to Lua conversion page will not fully convert your code.
The Bos to Lua conversion page can and will create bad code.
Using a low level hierarchy to parse a higher level hierarchy is not correct.
Do not look directly at the Bos to Lua conversion page.
The Bos to Lua conversion page is your only friend.


Last edited by CarRepairer on 12 Feb 2013, 09:13, edited 1 time in total.

Top
 Offline Profile  
 
PostPosted: 29 Jun 2010, 09:00 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
That is pretty nifty. One question, though- I thought that Lua didn't handle move / turn / spin the same way as BOS. Has that been fixed? I see the numbers are the same, so I'm presuming yes.

I don't see anything else that's really sticking out there that can't be addressed with minor bug-fixes (on the modder's part, and gee, we only have to do it once).


Top
 Offline Profile  
 
PostPosted: 29 Jun 2010, 09:02 
Moderator

Joined: 12 Oct 2007, 08:24
Quote:
Do not look directly at the Bos to Lua conversion page.
Oops I didn't read the disclaimer, how many hours do I have left to live?

How easy would a batch bos -> lua conversion page be to create?


Top
 Offline Profile  
 
PostPosted: 29 Jun 2010, 09:09 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
Hmm. Needs to handle long lines. Quotes cause major problems.

And includes don't get converted.

None of this is the end of the world, just noting bugs.


Last edited by Argh on 29 Jun 2010, 09:18, edited 1 time in total.

Top
 Offline Profile  
 
PostPosted: 29 Jun 2010, 09:17 
Moderator

Joined: 12 Oct 2007, 08:24
There;s a bug with function conversion
cob: CALL-SCRIPT scriptName();
lua: CALL-SCRIPT scriptName()

Functions should be localised by default. Also "get" in cob is could be converted to a lua function equivalent.

Another bug, local variables are still declared as "var myVariable" in lua instead of "local myVariable".


Top
 Offline Profile  
 
PostPosted: 29 Jun 2010, 09:21 
Moderator

Joined: 12 Oct 2007, 08:24
Another strange bug:
COB
Code:
         turn rshoulder to x-axis <70> speed <135>;
         turn rshoulder to y-axis <15> speed <270>;
         turn rforearm to x-axis <-40> speed <270>;
         turn lshoulder to x-axis <-20> speed <135>;
         turn lshoulder to y-axis <-15> speed <270>;
         turn lforearm to x-axis <-40> speed <270>;
         Turn rshin to x-axis <85> speed<540>;   
         Turn rthigh to x-axis <-100> speed<270>;
         Turn lthigh to x-axis <30> speed<270>;
         Turn chest to y-axis <20> speed <90>;   
         wait-for-move hips along y-axis;      
         move hips to y-axis [1.2] speed <8400>;
         wait-for-move hips along y-axis;
         turn rshin to x-axis <10> speed <630>;
         move hips to y-axis [0] speed <8400>;

LUA
Code:
         Turn( rshoulder , x_axis, math.rad(70), 135 )
         Turn( rshoulder , y_axis, math.rad(15), 270 )
         Turn( rforearm , x_axis, math.rad(-40), 270 )
         Turn( lshoulder , x_axis, math.rad(-20), 135 )
         Turn( lshoulder , y_axis, math.rad(-15), 270 )
         Turn( lforearm , x_axis, math.rad(-40), 270 )
         Turn rshin to x-axis <85> speed<540>   
         Turn rthigh to x-axis <-100> speed<270>
         Turn lthigh to x-axis <30> speed<270>
         Turn chest to y-axis <20> speed <90>   
         wait-for-move hips along y-axis      
         Move( hips , y_axis, 1.2 , 8400 )
         wait-for-move hips along y-axis
         Turn( rshin , x_axis, math.rad(10), 630 )
         Move( hips , y_axis, 0 , 8400 )

It may be due to a multi line piece definition when copied into the cob window.


Top
 Offline Profile  
 
PostPosted: 29 Jun 2010, 09:28 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
math.rad should be localized as well. Or we need an equivalent to STANDARD_COMMANDS.h that is auto-included.

Oh, and...

Move( hips , y_axis, 1.2 , 8400 )

Will have some funny results ;)

If the move / turn / spin distance / radius / velocity is not enclosed in brackets, it's a raw number, and it needs to be converted to float by dividing by the correct constant for linear / angular.


Top
 Offline Profile  
 
PostPosted: 29 Jun 2010, 11:07 
Game Developer
User avatar

Joined: 25 Jun 2006, 07:44
Location: Germany
CarRepairer wrote:
Do not look directly at the Bos to Lua conversion page.

Do not taunt the Bos to Lua conversion page.
The Bos to Lua conversion page may randomly accelerate to unsafe speed.


Top
 Offline Profile  
 
PostPosted: 29 Jun 2010, 12:49 
Modeler
User avatar

Joined: 28 Apr 2005, 20:07
Location: Next to the girl with kaleidascope eyes
Do not submerge the Bos to Lua conversion page in water, even partially.

Even if it doesn't give out a complete script, if it can get most of the leg work out of the way, I'm all for it.


Top
 Offline Profile  
 
PostPosted: 29 Jun 2010, 15:51 
Cursed Zero-K Developer
User avatar

Joined: 07 Nov 2007, 21:48
Location: Horse
Yes, is it like Happy Fun Ball or the Aperture Science Portal device? Who knows?

Thanks for buggy examples, I'll try to fix them later today.

Edit:
Google_Frog wrote:
There;s a bug with function conversion
cob: CALL-SCRIPT scriptName();
lua: CALL-SCRIPT scriptName()

Functions should be localised by default. Also "get" in cob is could be converted to a lua function equivalent.

Another bug, local variables are still declared as "var myVariable" in lua instead of "local myVariable".

Both these things (call-script and var) should work. If they are not working for you, paste me an example (like you did with your other post).


Top
 Offline Profile  
 
PostPosted: 29 Jun 2010, 16:16 
Community Representative
User avatar

Joined: 08 Sep 2008, 21:59
Location: small cars
do not feed the bos to lua conversion page after midnight.
the bos to lua conversion page is for enjoyment only and will not prevent pregnancy
wait at least 30 minutes after eating before using the bos to lua conversion page

edit:

if the bos to lua conversion page lasts longer than 4 hours, consult your physician


Top
 Offline Profile  
 
PostPosted: 30 Jun 2010, 10:02 
Modeler
User avatar

Joined: 28 Apr 2005, 20:07
Location: Next to the girl with kaleidascope eyes
Do not reverse the polarity of the Bos to Lua conversion page.


Top
 Offline Profile  
 
PostPosted: 30 Jun 2010, 10:16 
Redacted
User avatar

Joined: 11 Jul 2007, 16:47
Guessmyname wrote:
Do not reverse the polarity of the Bos to Lua conversion page.
lua to bos D:


Top
 Offline Profile  
 
PostPosted: 30 Jun 2010, 10:27 
Battletech Developer
User avatar

Joined: 21 May 2007, 01:09
Location: New Zealand
Do not insert metal objects into the bos to Lua conversion page.


Top
 Offline Profile  
 
PostPosted: 30 Jun 2010, 14:07 
Modeler
User avatar

Joined: 13 May 2008, 15:51
Location: Universe
Do not press the red button on the bos to lua conversion page.
Do not use the bos to lua conversion page in the shower.
Warning: May contain small parts! Keep the bos to lua conversion page away from childern younger than 3 years.


Top
 Offline Profile  
 
PostPosted: 30 Jun 2010, 15:07 
Modeler
User avatar

Joined: 28 Apr 2005, 20:07
Location: Next to the girl with kaleidascope eyes
Do not drive under the influence of the Bos to Lua page.
Do not drive under the Bos to Lua page.
Do not allow the Bos to Lua page to drive.
Do not drive in the vicinity of the Bos to Lua page.
Do not expose cars to the Bos to Lua page.
Do not approach the Bos to Lua page in a vehicle.

If any of the above occur, call for help immediately.


Top
 Offline Profile  
 
PostPosted: 01 Jul 2010, 04:36 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
The Bos to Lua page is in no way affiliated to the production of lua . In the event that lua is outputted, the result is to be disregarded immediately.


Top
 Offline Profile  
 
PostPosted: 01 Jul 2010, 07:11 
Battletech Developer
User avatar

Joined: 21 May 2007, 01:09
Location: New Zealand
Do not attempt to stop the bos to Lua conversion page with hands, feet or genitals.
The bos to Lua conversion page is not designed for use as a flotation device.


Top
 Offline Profile  
 
PostPosted: 01 Jul 2010, 10:14 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring on 04/24/12
Staring at the bos to Lua conversion page has been known in some rare cases to cause pregnancies. If you experience a burning sensation while using the bos to Lua conversion page, please stop usage immediately and consult your physician.


Top
 Offline Profile  
 
PostPosted: 20 Aug 2012, 13:38 

Joined: 20 Feb 2010, 12:17
translation of the above:

bos -> lua conversion isn't fully functional.



...isn't it?


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.