42:24] <zwzsg> tan=sin/cos
 et atan ?
 hypot?
 atan = arc tangente = tan^-1 = inverse de tangente
inverse au sens fonction rciproque, hein, pas au sens littral 1/..
 dans TA c'est particulier, vu que t'as que des entiers
 pi entier?
3/5=0
 9/7=1
 Des entiers 32 bits, donc: 4294967296=0
 360 est represent par 65536
angle en degr dans les turn c'est parce que  <...>  fait *182
 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,....


? The BOS language only has a
single datatype, the integer. The
engine wants to pass a lot of
inherently real
numbers to the language
though. So what do we do? We
multiply those numbers by some
arbitrary constant! The
SetSpeed script for example
takes 500 times the metal
production of a metal extractor
as input, while it takes 3000
times the wind strength, for wind
generators.
? Vectors are even worse; they
are not only scaled by a factor
of 500, but the components
seem to be passed in z,x
order.
? The unit-local coordinate
system used by COB has the X
axis inverted compared to
Spring's global coordinate
system.
? Angles in COB are
represented using values in the
range -32768..32767, due to the
lack of real numbers.
? While a return statement
exists, most functions use
output arguments instead.
There's no way to know which
function arguments are input
arguments, and which are
output arguments.
? show piecename has a
special, context dependent,
meaning. When it's called
directly inside a FireWeapon
script,
it shows a flare, and when it's
called at any other time, it
unhides a piece.
DOWNLOAD:
http://spring.jobjol.nl/s
how_file.php?id=2091

Drop-Unit [Unit]; Drop unit 
Attach-Unit [Unit] To [Object]; Attach a Unit to selected object 
QueryTransport(piecenum) {}
BeginTransport(height) {}
EndTransport() {}
QueryTransport(piecenum) 
Not sure exactly what this does but by a guess it might be the object that is used to carry the unit. Below is the fragment from the arm atlas bos file. I believe that the statement "piecenum=1;" refrences the first object in the list for the transport, the one named "base".
QueryTransport(piecenum) {    piecenum=1;    }

 BeginTransport(height) 
This item sets the attachment point for the unit to be picked up by moving the object named "link" to the unit that will be picked up. The part (0-height) takes the height of the transport and turns it into a negative number and that is where "link" gets moved too. The "RequestState(ACTIVE);" handles the animation of the unit lowering because as like before in the "Activate()" function description above, it will refrence its own "Activatescr()" function which will have its own statements for lowering the unit to carry it and then raising it again to its original height.
BeginTransport(height)   {    move link to y-axis (0 - height) now;    start-script RequestState(ACTIVE);    }

 EndTransport() 
This is the ending part for the "BeginTransport(height)" function. It also contains the "RequestState(INACTIVE);" call and does the opposite of the above function.
EndTransport()   {    start-script RequestState(INACTIVE);    }


#define BUSY                 6  // set or get (used by misc. special case missions like transport ships)


 A Few Important Notes
The X-Axis in Total Annihilation is the Left/Right axis. For linear movements (i.e. "move"), a positive value is "" and a negative value is "". For angular movements (i.e. "turn"), a positive value is a "" rotation around the X-Axis, and a negative value is a "" rotation. Note that for angular movements, the value used is typically a "pitch" value that is passed into the appropriate subroutine to indicate the verticle angle at which an enemy unit is attacking.

The Y-Axis in Total Annihilation is the Up/Down axis. For linear movements (i.e. "move"), a positive value is "up" and a negative value is "down". (A good example of Y-Axis linear movement is in the raising and lowering of a big gun, such as the Annihilator). For angular movements (i.e. "turn"), a positive value is a "" rotation around the Y-Axis, and a negative value is a "" rotation. Note that for angular movements, the value used is typically a "heading" value that is passed into the appropriate subroutine to indicate the "compass direction" at which an enemy unit is attacking.

The Z-Axis in Total Annihilation unit terms is the Front/Back axis, according to whatever direction the unit, or piece of a unit, is facing. For linear movements (i.e. move) positive value is "forward" and a negative value is "backwards" with respect to whatever the piece is facing. (A good example of Z-Axis linear movement is in gun barrel recoil). For angular movements (i.e. "turn"), a positive value is a "" rotation around the Z-Axis, and a negative value is a "" rotation. 

Numbers in brackets [] seem to denote linear measurements, both in terms of direction and speed. Thus, a statement such as "move CannonR to z-axis [-2.4] speed [500];" would indicate that the piece "CannonR" would be moved backwards 2.4 units at a linear speed of 500. A unit value of [0] (zero) would indicate the "home" location of the object (i.e. wherever it started).

Numbers in angled brackets <> seem to denote angular measurements. A unit value of <0> (zero) would indicate the "home" orientation of the object along the specified axis.

Very few of the subroutines described in this section must be re-defined for your. If you do not define a subroutine of your own, a default subroutine with the same name is used in its place (?), or you may use some of the pre-defined routines that can be found in the .h files.

 File Format
Firstly let me break down the BOS file into its componets here. For all you C programmers, this is very much like C but in its basic form. This is a general format for the BOS file, including a list of most of the functions that have been found in the BOS files in totala.hpi. Mainly I will be using the Cavedog's ARM Battleship's (the Millenium) BOS file, and TADD's Core Hellfire's BOS file for examples, but I will try and cover the ones here as best as I can. I will also try to cover 2 topics here. The building functions and the transport functions.

piece <piece list>;
static-var <static variable list>;
#define <constant> <value>
#include <filename>

// This is a comment line
Create() {}
StartMoving() {}
StopMoving() {}
MotionControl() {}
AimPrimary(heading,pitch) {} 	  // See also stdtank.h
AimSecondary(heading,pitch) {}
AimTertiary(heading,pitch) {}
AimFromPrimary(piecenum) {}
AimFromSecondary(piecenum) {}
AimFromTertiary(piecenum) {}
QueryPrimary(piecenum) {}
QuerySecondary(piecenum) {}
QueryTertiary(piecenum) {}
FirePrimary() {}		  // See also stdtank.h
FireSecondary() {}
FireTertiary() {}
Activate() {}			  // See also stdscrpt.h
Deactivate() {}
SetMaxReloadTime(time) {}
RestoreAfterDelay() {}
HitByWeapon(anglex, anglez) {}	  // See also Hitweap.h
StartBuilding() {}
StopBuilding() {}
TargetHeading( heading ) {}
QueryNanoPiece(piecenum) {}
QueryLandingPad(piece1, piece2) {}
QueryBuildInfo(piecenum) {}
QueryTransport(piecenum) {}
Demo() {}
BeginTransport(height) {}
EndTransport() {}
SweetSpot(piecenum) {}
Killed() {}
TargetCleared(which) {}
RockUnit(anglex, anglez) {}	// See also Rockunit.h

// Miscellaneous pre-defined subroutines
Help() {}		        // From help.h
HelpScale( scale ) {}           // From help.h
SmokeUnit() {}		        // From SmokeUnit.h
InitState() {}		        // From statechg.h
RequestState(requestedstate) {} // From statechg.h
OpenYard() {}			// From yard.h
CloseYard() {}			// From yard.h

Most of the syntax within a BOS file follows the same semantic and syntactic conventions as the C programming language, so most of the information here will assume you know about "if" and "while" statements, as well as the use of the semicolons, assignment ("="), equals ("=="), etc. 

 BOS Functions
The contents of this section originated at the PWD web site's "PWD/DCS Cobbler Tutorial" web page. 

Note: Distances are in meters and Angles are in degrees.

Statement and Syntax Description 
Attach-Unit [Unit] To [Object]; Attach a Unit to selected object 
Cache [Object]; Disable texture animation ( default = disabled ) 
Call-Script [Script]([Parameters]); Call a script 
Dont-Cache [Object]; Enable texture animation ( default = disabled ) 
Dont-Shade [Object]; Disable shading ( default for building = enabled; default for moving units = disabled ) 
Drop-Unit [Unit]; Drop unit 
Emit-Sfx [Type] from [Object]; Emit a SFX ( fire or bubbles ) from a point ( pointbased ) or from a vertex ( vectorbased ). The different types of effects are defined in the SFXtype.h file. 
Explode [Object] type [Type]; Explode an object in a particular manner. 
Get [SysVar]; Get a sysvar (system variable) like BUILD_PERCENT_LEFT 
Hide [Object]; Hide an object ( default = all objects shown ) 
Jump [Destination];  
Jump if ([Value] == False) [Destination];  
Move [Object] to [Axis] [Position] Speed [Speed]; Move an object along a selected axis ( ?-axis ) with selected speed 
Move [Object] to [Axis] [Position] Now; Move an object immediatly 
Rand([Min], [Max]); Randomize a static-var value  
Return [Value]; Return to selected value 
Set [SysVar] To [Value]; Set a sysvar (system variable) to a value ( ex : SET ARMORED TO TRUE ) 
Set-Signal-Mask [Signal]; Set an ID ( 0 , 2 , 4 , 8 , etc.. ) for the signal mask. this is how the script can be killed. 
Shade [Object]; Enable shading ( default for building = enabled; default for moving units = disabled ) 
Show [Object]; Show an object ( default = all objects shown ) 
Signal [Signal]; Emit a signal ( 0 , 2 , 4 , 8 , etc.. ) to kill script with same signal-mask 
Sleep [Time]; make a little pause between 2 or more events 
Spin [Object] Around [Axis] Speed [Speed] Accelerate [Acceleration]; start spinning a object  
Spin [Object] Around [Axis] Speed [Speed]; spin an object directly to max speed 
Start-Script [Script]([Parameters]); Start a script 
Stop-Spin [Object] Around [Axis] Decelerate [Deceleration]; stop spinning an object with deceleration 
Stop-Spin [Object] Around [Axis]; stop spinning an object immediatly 
Turn [Object] to [Axis] [Bearing] Speed [Speed]; turn an object  
Turn [Object] to [Axis] [Bearing] Now; turn an object immediatly 
Wait-For-Move [Object] Along [Axis]; Wait until selected object has finished moving along selected axis 
Wait-For-Turn [Object] Around [Axis]; Wait until selected object has finished turning around selected axis 


//MAX_SPEED          75   // SET only.  Alters MaxVelocity
set 75 to (spd/1000);
if((get 1) == 0){sleep rand(250,300);
set 75 to spd;

#define KILL_UNIT                102 // get KILL_UNIT(unitId, SelfDestruct=true, Reclaimed=false)

#define PIECE_XZ             7  // get
#define PIECE_Y              8  // get

/*
todo=
UNIT_BUILD_PERCENT_LEFT   73 // GET only.  BUILD_PERCENT_LEFT, but comes with a unit parameter. 

HitByWeapon(anglex, anglez) {}     //Ce que fais l'unit lorsqu'elle est touche.
RockUnit(anglex, anglez) {} 

totest=
LOS_RADIUS                85 // set or get
AIR_LOS_RADIUS            86 // set or get
RADAR_RADIUS              87 // set or get
JAMMER_RADIUS             88 // set or get
SONAR_RADIUS              89 // set or get
SONAR_JAM_RADIUS          90 // set or get
SEISMIC_RADIUS            91 // set or get
DO_SEISMIC_PING           92 // get
SHIELD_POWER              95 // set or get
STEALTH                   96 // set or get
CHANGE_TARGET             98 // set, the value it's set to determines the affected weapon
MAX_SPEED          75   // SET only.  Alters MaxVelocity for the given unit. 
CLOAKED                   76
WANT_CLOAK                77
GROUND_HEIGHT       16  // get land height, 0 if below water
IN_WATER            28// GET only.  If less than 0 then the unit must be in water (0 is the water level).

POW                       80 // get[LCC]Licho[CA]> power x^y


HEADING                   82 // get[LCC]Licho[CA]> unit direction

MIN                      131 // get
MAX                      132 // get //get MIN 3 4 5 will returns 5

ABS                      133 // get remove the - ?
ATAN                14  // get ordinary two-parameter atan
HYPOT               15  // get ordinary two-parameter hypot



tested =
PRINT         81 // get, so multiple args can be passed thats prints it in spring console  ingame  use for debug values i tried to print heading :) get PRINT heading = get HEADING   get PRINT heading and it displayed numbers depending on how is unit turned
BUILD_PERCENT_LEFT  17  // get 0 = unit is built and ready, 1-100 = How much to build 
emit-sfx 4095 + 1 from base; //Weapon1 detonates 
emit-sfx 2047 + 1 from base; //Weapon1 shoot
ACTIVATION           1  // set or get onoffable
STANDINGMOVEORDERS   2  // set or get 0fix 1zone 2libre 
STANDINGFIREORDERS   3  // set or get 0secur 1riposter 2tirer
HEALTH               4  // get (0-100%)
INBUILDSTANCE        5  // set or getLecture/Ecriture Indique si l'unit de construction est en train de construire 
YARD_OPEN           18  // set or get (change which plots we occupy when building opens and closes)Lecture/Ecriture Indique quels endroits sont occups/librs par une usine. 
BUGGER_OFF          19  // set or get (ask other units to clear the area)
ARMORED         20   // SET or GET.  Turns on the Armored state.  

=unknow

#define BUSY                 6  // set or get (used by misc. special case missions like transport ships)
#define PIECE_XZ             7  // get
#define PIECE_Y              8  // get
#define UNIT_XZ              9  // get
#define UNIT_Y              10  // get
#define UNIT_HEIGHT         11  // get
#define XZ_ATAN             12  // get atan of packed x,z coords
#define XZ_HYPOT            13  // get hypot of packed x,z coords
#define ATAN                14  // get ordinary two-parameter atan
#define HYPOT               15  // get ordinary two-parameter hypot

CURRENT_SPEED       29 // SET only,  new speed for the next frame ONLY.
#define ON_ROAD             34
#define HEADING                   82 // get
#define TARGET_ID                 83 // get
#define LAST_ATTACKER_ID          84 // get
#define CEG_DAMAGE                99 // set
#define COB_ID                   100 // get


Activate() {}                      //totala syntax
Deactivate() {}                    //totala syntax.
SetMaxReloadTime(time) {}          //totala syntax.?
RestoreAfterDelay() {}             //totala syntax.?
TargetHeading( heading ) {}        //??
TargetCleared(which) {}            //totala syntax.?
*/ 

#define SHATTER			1		// The piece will shatter instead of remaining whole
#define EXPLODE_ON_HIT		2		// The piece will explode when it hits the ground
#define FALL			4		// The piece will fall due to gravity instead of just flying off
#define SMOKE			8		// A smoke trail will follow the piece through the air
#define FIRE			16		// A fire trail will follow the piece through the air
#define BITMAPONLY		32		// The piece will not fly off or shatter or anything.  Only a bitmap explosion will be rendered.
#define NOCEGTRAIL		64		// Disables the cegtrail for the specific piece (defined in the unit fbi)

 QueryLandingPad(piece1, piece2) 
I'm not sure but I believe this is called when an air vehicle wants to land at a repair pad. "piece1" and "piece2" are set to the object where the aircraft should land. Since the repair pads have only one choice, "piece1" and "piece2" are both set to "landpad". The aircraft carriers however alternate the values: 
// Arm Carrier
piece base,landpad1,landpad2;
QueryLandingPad(piece1,piece2){
    piece1=1;		//1 refers to the first object declared in the piece list, landpad1
    piece2=2;
    padflip = !padflip;
    if (padflip){
piece1=2;
        piece2=1;
        }
    }

 QueryBuildInfo(piecenum) 
This function defines what object piece is used to attach the unit thats being built too. Only construction plants as well as the ship yards use this. Mobile construction units dont use this. The format is:
QueryBuildInfo(piecenum)
    {
    piecenum=pad;
    }

Just defining what piece is used to locate the unit thats being built. I believe it attaches the unit to this piece so when the pad is spinning, the unit will spin with it.

 QueryTransport(piecenum) 
Not sure exactly what this does but by a guess it might be the object that is used to carry the unit. Below is the fragment from the arm atlas bos file. I believe that the statement "piecenum=1;" refrences the first object in the list for the transport, the one named "base".
QueryTransport(piecenum) {
    piecenum=1;
    }

 BeginTransport(height) 
This item sets the attachment point for the unit to be picked up by moving the object named "link" to the unit that will be picked up. The part (0-height) takes the height of the transport and turns it into a negative number and that is where "link" gets moved too. The "RequestState(ACTIVE);" handles the animation of the unit lowering because as like before in the "Activate()" function description above, it will refrence its own "Activatescr()" function which will have its own statements for lowering the unit to carry it and then raising it again to its original height.
BeginTransport(height)   {
    move link to y-axis (0 - height) now;
    start-script RequestState(ACTIVE);
    }

 EndTransport() 
This is the ending part for the "BeginTransport(height)" function. It also contains the "RequestState(INACTIVE);" call and does the opposite of the above function.
EndTransport()   {
    start-script RequestState(INACTIVE);
    }