Page 3 of 4
Re: Lua vs cob
Posted: 19 Apr 2010, 02:39
by Forboding Angel
zwzsg wrote:Tobi wrote:Yeah for next release I'll remove COB, even if it's just to pester you
I wouldn't be the most pestered.
In fact I would welcome it, as that would mean the death of BA.

I have to say, he has a compelling argument ;p
Re: Lua vs cob
Posted: 19 Apr 2010, 13:16
by KDR_11k
It's easier to learn the entirety of the BOS system compared to the entirety of the Lua system but that's just because BOS is so stupidly simple that trying to go beyond the simplest things will require a lot of hacking and ingenuity. It's like arguing Milkshape 3D vs Blender. MS3D has a much simpler GUI and everything but you'll run into the limits so fast you'll waste more time working against the GUI than with it.
Honestly the only reason I'm still using BOS is because I still haven't bothered to learn the Lua equivalents but if you look into my BOS code these days you'll rarely ever find a unit that does not have some extensive Lua hooks for things you can't do with BOS alone. With pure Lua the interface would be simplified, the number of files involved reduced and likely the workload for maintenance reduced (if you want to change e.g. the behaviour of the mass drivers perk in THIS you have to recompile almost every BOS in the game even though the values are centralized in a .h).
Re: Lua vs cob
Posted: 19 Apr 2010, 18:03
by CarRepairer
KDR_11k wrote:Honestly the only reason I'm still using BOS is because I still haven't bothered to learn the Lua equivalents
Are you familiar with the transformation mapping of the set of lowercase letters to uppercase letters?

Re: Lua vs cob
Posted: 19 Apr 2010, 18:25
by zwzsg
Code: Select all
Spring.UnitScript.Turn ( p, 1, 0)
turn p to x-axis <0> now;
Not just a case of case.
That is the second time you made snide remarks based on pure lies and disinformation.
Re: Lua vs cob
Posted: 19 Apr 2010, 20:06
by FLOZi
zwzsg wrote:Code: Select all
Spring.UnitScript.Turn ( p, 1, 0)
turn p to x-axis <0> now;
Not just a case of case.
That is the second time you made snide remarks based on pure lies and disinformation.
Most functions are pre-localised, and there are named variables for the axes.
Who is spreading disinformation again?
Re: Lua vs cob
Posted: 19 Apr 2010, 20:20
by zwzsg
So,
Code: Select all
Turn(p, x_axis, 0)
Turn p to x-axis 0 now;
Still far from the transformation mapping of the set of lowercase letters to uppercase letters.

Re: Lua vs cob
Posted: 19 Apr 2010, 21:46
by CarRepairer
zwzsg wrote:So,
Code: Select all
Turn(p, x_axis, 0)
Turn p to x-axis 0 now;
Still far from the transformation mapping of the set of lowercase letters to uppercase letters.

Man you must think KDR is a complete moron to say this is too complex. I was making a little joke to illustrate the point that he could learn the lua formats in almost no time at all.
Re: Lua vs cob
Posted: 19 Apr 2010, 22:38
by Forboding Angel
A perfect example of easy to read syntax!!!! Because well, that ^^ is so much easier to tell what it does than this:
Re: Lua vs cob
Posted: 19 Apr 2010, 23:35
by Tobi
Re: Lua vs cob
Posted: 20 Apr 2010, 01:25
by Forboding Angel
Nice, you forgot adding subsequent weapons and emitting weapons as well as ceg's though.
Re: Lua vs cob
Posted: 20 Apr 2010, 09:31
by Tobi
A stumpy only has one weapon ...
Re: Lua vs cob
Posted: 20 Apr 2010, 09:51
by zwzsg
Nice tutorial!

Re: Lua vs cob
Posted: 20 Apr 2010, 10:45
by Das Bruce
Tobi wrote:A stumpy only has one weapon ...
I think he means as lessons.
Re: Lua vs cob
Posted: 20 Apr 2010, 11:39
by Tobi
zwzsg wrote:Nice tutorial!

Thanks.
Das Bruce wrote:Tobi wrote:A stumpy only has one weapon ...
I think he means as lessons.
Yeah I know, that's for another time though.
He can't seriously expect me to cramp everything into a single tutorial
Maybe I'll make some example sometime where the power of Lua over BOS truely shines.
In the mean time I licensed the post as CC-BY-SA-3.0 so you may actually use the code or improve the tutorial. Also I would accept tutorial submissions if anyone is interested. They have to be written in
markdown, sources are
here.
Re: Lua vs cob
Posted: 20 Apr 2010, 11:48
by ScarySquirrel
Wait, coberrors are from *drumroll* COBOL?
As in, COBOL cobol?
Holy... the things you learn.
Re: Lua vs cob
Posted: 20 Apr 2010, 11:51
by Tobi
No
Re: Lua vs cob
Posted: 20 Apr 2010, 13:08
by AF
COBOL is a ghastly language, here is Hello world in cobol:
Code: Select all
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
PROCEDURE DIVISION.
DISPLAY 'Hello, world'.
STOP RUN.
Here is hello world in DOS:
Re: Lua vs cob
Posted: 20 Apr 2010, 13:52
by Das Bruce
AF wrote:DOS is a programming language
Whut.
Re: Lua vs cob
Posted: 20 Apr 2010, 13:57
by Forboding Angel
Das Bruce wrote:AF wrote:DOS is a programming language
Whut.
I suppose you could call batch scripts programming, in the absolute loosest(<-- fail grammar) form of the term.
Re: Lua vs cob
Posted: 20 Apr 2010, 14:25
by zwzsg
Stumpy is the archetypal RTS unit. A generic bland tank, with a body, a turret, a gun. It's the perfect choice for a tutorial, with just a little animation to show turn and move in context, while staying very simple. And it's directly portable to 90% of units.
Adding more weapons "is left as an exercise for the readers". For weapons on separate turrets, I hope anybody can figure the 1 in function name becomes a 2 for the second weapon. Though some explanation for the signal would be useful. The bitmask thing is not obvious. For weapons sharing the same turret, they'd require advanced scripting. For one weapon spread over two parallel barrels on the same turret, hmm, yeah, it's common enough that you'd want a tutorial on that. But it would still be lesson 2. Lesson 1 has to be kept simple!
It's true that a new tutorial, on new unit scripting method, should not use a hide/show flare but a CEG. I guess Tobi wanted to stay close to the Cavedog scripts roots, or to avoid having to explain how to add CEG to a unit definition. Miss the hide in the create btw.
Well, in the end, praise upon Tobi for writing that tut, and shame upon me and other ranters for disparaging instead of feeding teh wiki.