Just finished touching up my notes on checksum. It's not comprehensive information, it's sorta just notes to help you if you already have a working understanding of how the checksum does its thing.
        
Quib Mask
Edit: stupid smiley code...
[This message has been edited by Quib Mask (edited July 10, 2004).]
                
                
            Code:
        
    # Jedi Knight Cog Checksum Notes
#
# CHECKSUM.TXT
#
# NOT A Script - Just info
#
# [QM]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
# ========================================================================================
Symbols that are equivalent
operators
- + / * % = == != > < >= <= ! && || & | ^ Return
values, variables and verbs
1 X "text" call blah
the () in X() are equivalent to an operator
the X in X() is equivalent to a value, variable or verb
# ........................................................................................
Code that isn't counted when calculating the checksum
commas, such as
1, 1, 1;
SetPulse(0), 1;
semi-colons, such as
1;
if(0);
messages within the "code" area, such as
activated:
startup:
stop_power:
exceptions to these are
semi-colons within a for() loop declaration
(see the "Information about for() loops" section for specifics)
in some force power cogs you can't move code from above to below stop_power:
or vice versa (so its placement is crucial to passing checksum)
# ........................................................................................
Vectors in '0 0 0' form
these seem to be their own checksum type and can't be converted to or from
the way to form a vector without this is VectorSet(0, 0, 0);
keep in mind that you can't compare vectors with ==
if(VectorSet(0, 0, 0) == '0 0 0') won't work
you'll need to use
if(VectorDist(VectorSet(0, 0, 0), '0 0 0') == 0)
or
if(!(VectorDist(VectorSet(0, 0, 0), '0 0 0') == 0))
if(VectorDist(VectorSet(0, 0, 0), '0 0 0') != 0)
won't work well, because != only works with integers
it'll truncate the VectorDist() results
# ........................................................................................
Useful conversions
X();
is equivalent to
-1;
Return;
is equivalent to
-
call blah;
is equivalent to
1;
if(1) is true
if(0) is false
# ........................................................................................
Information about for() loops
if() sorta equals for()
in a for() loop, the contained semi-colons (;) count as an operator
-1, -1, -1, -1, -1, -1, if(0) { }
is equivalent to
for(i=0; i<10; i=i+1) { }
# ........................................................................................
Information concerning if() and else
if(0)
is equivalent to
else {1;}
in other words
if
is equivalent to
else
and
(0)
is equivalent to
{1;}
you just can't have if without the (0) though
# ........................................................................................
Information on curly brackets and parenthesis
{} is equivalent to ()
if(0) { }
is equivalent to
if((0))
however
if(0) { }
is NOT equivalent to
if(X())
also
if((0))
is NOT equivalent to
if(X())
the () in X() is not the same as the () in (0)
the () in X() is an operator, the () in (0) are bracketsQuib Mask
Edit: stupid smiley code...
[This message has been edited by Quib Mask (edited July 10, 2004).]
 
![http://forums.massassi.net/html/biggrin.gif [http://forums.massassi.net/html/biggrin.gif]](http://forums.massassi.net/html/biggrin.gif)