BOS Operators???
Moderator: Moderators
It breaks out the innermost block.KDR_11k wrote:I never use break because I have no idea which block it breaks out of.
All that looks like virtual machine kinda stuff; like simplifying all the code. If you know what I mean.Argh wrote:And what does @NewScript do?
@PopFVar? @PopSVar? Sounds like they feed values into variables to avoid divide-by-zeroes. Probably just old stuff from Cavedog debugging.
And why @endif, @endelse, @endwhile???
return FALSE; stops an aiming function or you can use a signal to break out of it. Break is a keyword to break out of a while or for loop.Argh wrote:Sooo... can Break stop an aiming function? Cuz that'd be... erm... useful.
And why @endif, @endelse, @endwhile???
The @ ones are precompiler keywords I guess, i.e. #endif.
Code: Select all
var y;
while (x < 5) {
++x;
for (y = 0; y < 5000; ++y) {
if (y >= 5) break;
}
if (x > 2) break;
}
Last edited by rattle on 21 Mar 2007, 15:49, edited 1 time in total.
I think they're interpretations of }, actually. If they were precompiler statements we'd see ifdef, ifndef, etc listed there as well. BTW, is there a precompiler statement that repeats a chunk of text N times with a certain keyword replaced with the number of the iteration (so if I had e.g. ten LLTs on a unit I'd script one of them and tell the precompiler to make 9 more copies of that code)?
BUMP
After checking Spring code and scriptors compiler.cfg I can reveal
From Spring
and
From Scriptor. The '?' operator is the BITWISE_AND we were all missing. I have updated my Compiler.cfg accordingly 
After checking Spring code and scriptors compiler.cfg I can reveal
Code: Select all
const int BITWISE_AND = 0x10035000;
and
Code: Select all
Operator= ? ;
Value=10035000;

Cool! Why not use & for it instead?
Anyway...
The results are right however. Should have done some more testing.
Anyway...
lol :Prattle wrote:? is a min(x,y) function.
Code: Select all
var i; i = 10?9; i is 9. i = 10?11; i is 10.
The results are right however. Should have done some more testing.
I wish there was such one me too.KDR_11k wrote:is there a precompiler statement that repeats a chunk of text N times with a certain keyword replaced with the number of the iteration
So that we can tick "run as slow as a slideshow even on a quad core" on our list our features copied from SupCom?Dragon45 wrote:When can we just jump to LUA and cut out BOS altogether?
No, the real question is, can we use Compiler.cfg to add new keywords to the language (after they've been coded in Spring source)? I still want some kill-unit(id) and morph-into("unitname") and two arguments "set"!
Nice find on the bitwise AND.
zwzsg
kill-unit(id) and morph-into("type") are exactly the kinds of functions
that can be left to the COB<-->LUA interface (in terms of the amount
of times that they would likely be called, not their functionality.
With regards to adding new GET ids, that's fine for quick info grabs,
but isn't as nice as a named call-script solution for routines. I plan on
finishing my COB->ScriptMoveType interface (same run-time binding
trick as for lua_ routines), and then you'll see how much cleaner it looks.
Using a call-script also makes it possible to use more then the 4 args
that GET is limited to.
example:
kill-unit(id) and morph-into("type") are exactly the kinds of functions
that can be left to the COB<-->LUA interface (in terms of the amount
of times that they would likely be called, not their functionality.
With regards to adding new GET ids, that's fine for quick info grabs,
but isn't as nice as a named call-script solution for routines. I plan on
finishing my COB->ScriptMoveType interface (same run-time binding
trick as for lua_ routines), and then you'll see how much cleaner it looks.
Using a call-script also makes it possible to use more then the 4 args
that GET is limited to.
example:
Code: Select all
call-script ScriptMovePhysics(
0, 100, 200, // positon
0, 10, 0, // velocity
0, 30, 0 // rotation
)