Bos to Lua conversion page
Moderator: Moderators
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Bos to Lua conversion page
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.
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.
Re: Bos to Lua conversion page
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).
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).
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Bos to Lua conversion page
Oops I didn't read the disclaimer, how many hours do I have left to live?Do not look directly at the Bos to Lua conversion page.
How easy would a batch bos -> lua conversion page be to create?
Re: Bos to Lua conversion page
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.
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, 10:18, edited 1 time in total.
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Bos to Lua conversion page
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".
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".
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Bos to Lua conversion page
Another strange bug:
COB
LUA
It may be due to a multi line piece definition when copied into the cob window.
COB
Code: Select all
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>;
Code: Select all
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 )
Re: Bos to Lua conversion page
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.
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.
Re: Bos to Lua conversion page
Do not taunt the Bos to Lua conversion page.CarRepairer wrote:Do not look directly at the Bos to Lua conversion page.
The Bos to Lua conversion page may randomly accelerate to unsafe speed.
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
Re: Bos to Lua conversion page
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.
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.
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Bos to Lua conversion page
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:
Thanks for buggy examples, I'll try to fix them later today.
Edit:
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).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".
Re: Bos to Lua conversion page
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
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
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
Re: Bos to Lua conversion page
Do not reverse the polarity of the Bos to Lua conversion page.
Re: Bos to Lua conversion page
lua to bos D:Guessmyname wrote:Do not reverse the polarity of the Bos to Lua conversion page.
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Bos to Lua conversion page
Do not insert metal objects into the bos to Lua conversion page.
Re: Bos to Lua conversion page
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.
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.
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
Re: Bos to Lua conversion page
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.
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.
Re: Bos to Lua conversion page
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.
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Bos to Lua conversion page
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.
The bos to Lua conversion page is not designed for use as a flotation device.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Bos to Lua conversion page
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.
Re: Bos to Lua conversion page
translation of the above:
bos -> lua conversion isn't fully functional.
...isn't it?
bos -> lua conversion isn't fully functional.
...isn't it?