I have to say, he has a compelling argument ;pzwzsg wrote:I wouldn't be the most pestered.Tobi wrote:Yeah for next release I'll remove COB, even if it's just to pester you![]()
In fact I would welcome it, as that would mean the death of BA.
Lua vs cob
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Lua vs cob
Re: Lua vs cob
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).
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).
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Lua vs cob
Are you familiar with the transformation mapping of the set of lowercase letters to uppercase letters?KDR_11k wrote:Honestly the only reason I'm still using BOS is because I still haven't bothered to learn the Lua equivalents

Re: Lua vs cob
Code: Select all
Spring.UnitScript.Turn ( p, 1, 0)
turn p to x-axis <0> now;
That is the second time you made snide remarks based on pure lies and disinformation.
Re: Lua vs cob
zwzsg wrote:Not just a case of case.Code: Select all
Spring.UnitScript.Turn ( p, 1, 0) turn p to x-axis <0> now;
That is the second time you made snide remarks based on pure lies and disinformation.
Code: Select all
Turn(p, x_axis, 0)
Who is spreading disinformation again?
Re: Lua vs cob
So,
Still far from the transformation mapping of the set of lowercase letters to uppercase letters. 
Code: Select all
Turn(p, x_axis, 0)
Turn p to x-axis 0 now;

- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Lua vs cob
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.zwzsg wrote:So,Still far from the transformation mapping of the set of lowercase letters to uppercase letters.Code: Select all
Turn(p, x_axis, 0) Turn p to x-axis 0 now;
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Lua vs cob
Code: Select all
Turn(p, x_axis, 0)
Code: Select all
Turn p to x-axis 0 now;
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Lua vs cob
Nice, you forgot adding subsequent weapons and emitting weapons as well as ceg's though.
Re: Lua vs cob
A stumpy only has one weapon ...
Re: Lua vs cob
Nice tutorial! 

Re: Lua vs cob
I think he means as lessons.Tobi wrote:A stumpy only has one weapon ...
Re: Lua vs cob
Thanks.zwzsg wrote:Nice tutorial!
Yeah I know, that's for another time though.Das Bruce wrote:I think he means as lessons.Tobi wrote:A stumpy only has one weapon ...
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.
- ScarySquirrel
- Posts: 82
- Joined: 29 Apr 2007, 04:25
Re: Lua vs cob
Wait, coberrors are from *drumroll* COBOL?
As in, COBOL cobol?
Holy... the things you learn.
As in, COBOL cobol?
Holy... the things you learn.
Re: Lua vs cob
COBOL is a ghastly language, here is Hello world in cobol:
Here is hello world in DOS:
Code: Select all
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
PROCEDURE DIVISION.
DISPLAY 'Hello, world'.
STOP RUN.
Code: Select all
echo Hello World
Re: Lua vs cob
Whut.AF wrote:DOS is a programming language
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Lua vs cob
I suppose you could call batch scripts programming, in the absolute loosest(<-- fail grammar) form of the term.Das Bruce wrote:Whut.AF wrote:DOS is a programming language
Re: Lua vs cob
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.
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.