Units:.bos/.COB


this list is extracted from the spring76b1_changelog.txt & from tutorials

the file animation .cob need to have the same name of the .fbi and be build from a .txt file renamed to .bos and compiled with scriptor or others tools le fichier d'animation .cob doit avoir le meme nom que le fichier .fbi corespondant et est fabriqu2 a partir d'un fichier .txt renomm2 en .bos et compiler avec scriptor_v1 ou un autre program equivalent (cobbler dont work for spring ... servo is a 3d editor for making stop animation by olding parts for walker or visual moves (only anims) :it seem is fonction are integrated to upspring154

warning : compiling .bos(text) with scriptor have special issue(bug)= try to found any diference between the next sentences: the firsts are not working(writed by me) , & the seconds work(copy past from existing files) maybe some others instruction can have same problem: so copy syntax from existing files (before to rewrite your code 10times) Aimweapon1(y,x){}BUG AimFromweapon1(a){}BUG Fireweapon1(){}BUG QueryWeapon1(q){} Queryweapon1(q){}//? AimFromWeapon1(a){} AimWeapon1(y, x){}//ok FireWeapon1(){}//OK


//[tags/] [spring_0.76b1/] [rts/] [Sim/] [Units/] [COB/] [CobInstance.h]

map:64=32000 position(=?footprint=?16pixel?): Les distances sont en mètres (1 mètre =1 pixel) et les angles sont en degrés. - Bump the unit-limit to 10000.


COB Ce type de fichier est du BOS compilé.

Il n'est pas éditable directement (sauf pour les gars calés en programmation).
On peut le décompiler avec Uncobble pour l'enregistrer en BOS.avec Scriptor & DeScriptor v0.73
Pour compiler le BOS, on peut utiliser Cobbler.
Le fichier COB doit porter le nom de l'unité et être placé dans le répertoire scripts. 

BOS Le fichier BOS est un fichier texte qui explique au jeu les animations de l'unité.

Il doit être compilé au format COB avec un logiciel comme scriptor_v1 (Scriptor & DeScriptor v0.73)       ou  COBBLER.
Seul le fichier COB est nécessaire au fonctionnement de l'unité.

Dans TA, les axes sont comme ceux de 3DOBuilder : X de gauche à droite, Y de bas en haut et Z d'arrière en avant. Le format du fichier est similaire au C, du point de vue syntaxique.

Il y a donc des règles à respecter : 

Il y a toujours un ; à la fin de chaque ligne, sauf celles commençant par un #. Une procédure commence par { et fini par }. Pour les structures conditionnelles on utilise : if (condition)

      { 
      Actions; // L'action est réalisée si la condition est vraie
      } 

ou while (condition)

      { 
      Actions; // L'action est répétée tant que la condition est vraie
      }

Pour la condition on utilise les opérateurs == (égal à), != (différent de) ou une variable VRAI (TRUE=1) or FAUX (FALSE=0) Les opérations sont : x + y (addition), x - y (soustraction), x * y (multiplication), x / y (division), !x (opposé de x, sachant que TRUE=!FALSE et 1=!0).

Syntaxe du fichier : // Les 2 slaches introduisent un commentaire.

 piece pièce1,pièce2,... ;  //Pièces de l'objet 3DO utilisées dans ce fichier

static-var var1,var2,... ; //Variables utilisées dans le fichier //(pour faire alterner les canons d'une tour, par exemple)

  1. define constante valeur //Assigne une valeur à une constante,
//et cette constante sera remplacée par sa valeur en compilant
  1. include nom_fichier.h //Ajoute un fichier contenant des procédures (comme SmokeUnit.h)

//qui seront utilisées dans le fichier // Procédures prédéfinies Help() {} // Fichier help.h HelpScale( scale ) {} // Fichier help.h SmokeUnit() {} // Fichier SmokeUnit.h InitState() {} // Fichier statechg.h RequestState(état) {} // Fichier statechg.h, état= ACTIVE ou INACTIVE OpenYard() {} // Fichier yard.h CloseYard() {} // Fichier yard.h


[QueryWeapon<1-16> AimWeapon<1-16> AimFromWeapon<1-16> FireWeapon<1-16> functions in scripts.] using: primary secondary tertiary in .cob instead 1 2 3 limit at3 weapon but allow totala compatibility(need .fbi related tag and 3weapon maxi)

Create() {}evenement lors du debut de creation StartMoving() {}evenement lors du debut de mouvement StopMoving() {}evenement lors de la fin de mouve MotionControl() {} AimPrimary(y, x) {} // heading et pitch définissent les angles de rotations pour les canons (pour viser) AimSecondary(y, x) {} //Pour utiliser plusieurs canons pour une arme, utilisez une variable qui changera de AimTertiary(y, x) {} //valeur à chaque tir pour déterminer quel canon tire. AimFromPrimary(a) {a=nomdelapiece} //est la pièce qui sert à viser (pour les calculs de visée) AimFromSecondary(piecenum) {} AimFromTertiary(piecenum) {} . QueryPrimary(piecenum) {} //Piecenum est la pièce d'où part le coup QuerySecondary(piecenum) {} //De même pour utiliser plusieurs canons servez-vous de la même variable pour QueryTertiary(piecenum) {} //déterminer d'où part le coup. FirePrimary() {} // Définir ici les mouvements tels que le recul d'un canon, après le tir. FireSecondary() {} FireTertiary() {} Activate() {} //Définir ici les actions à effectuer lors de l'activation de l'unité. Deactivate() {} //Définir ici les actions à effectuer lors de la désactivation de l'unité. SetMaxReloadTime(time) {} //Définir ici la durée avant la mise en repos de l'unité (Restore_delay=x*time;). RestoreAfterDelay() {} //Définir ici les actions à effectuer lors du repos de l'unité (ex pour l'Exterminator) HitByWeapon(anglex, anglez) {} //Ce que fais l'unité lorsqu'elle est touchée. StartBuilding() {} //Actions à effectuer quand l'unité commence à construire StopBuilding() {} //Actions à effectuer quand la construction est terminée TargetHeading( heading ) {} //?? QueryNanoPiece(piecenum) {} //Piecenum est la pièce d'où part le jet d'énergie QueryLandingPad(piece1, piece2) {} //Piece1 et piece2 sont les pièces où les avions se posent pour être réparés. QueryBuildInfo(piecenum) {} //Piecenum est la pièce sur laquelle l'unité est construite (usines seulement) QueryTransport(piecenum) {} //Piecenum est la pièce à laquelle s'attache l'unité pour être transportée Demo() {} //Actions spécifiques qui seront vues avec UnitViewer. BeginTransport(height) {} //Actions à effectuer lors du chargement d'une unité EndTransport() {} //Actions à effectuer lors du déchargement d'une unité SweetSpot(piecenum) {} //Piecenum est la pièce qui dessine le cadre vert et permet la sélection de l'unité Killed() {} //Définir ici les actions survenant quand l'unité est tuée. TargetCleared(which) {} //Actions à effectuer quand l'unité ciblée est morte (arrêter la rotation d'un canon) RockUnit(anglex, anglez) {} //Avec rockunit.h, définit le balancement d'une unité (quand elle tire par exemple)


Fonction et syntaxe Description Exemple

Attach-Unit Unité To Objet; = Attache une unité à l'objet (pour les unités de transport comme le bateau) Attach-Unit unitid To link; Cache Objet; = Désactive l'animation d'une texture Cache arm; Call-Script Procédure(Paramètres); = Appelle une procédure call-script BoomCalc( get UNIT_XZ(unitid),get UNIT_Y(unitid) + get UNIT_HEIGHT(unitid) ); Dont-Cache Objet; = Active une animation de texture (Désactivée par défaut ) Dont-Cache turret; Dont-Shade Objet; = Désactive les ombres sur l'unité. Activé pour les bâtiments. Dont-Shade wing1; Drop-Unit Unité; = Largue l'unité attachée Drop-unit unitid; Emit-Sfx Type_d'effet from Objet; == Emet un effet (comme le feu ou les bulles pour les bateaux) à partir de l'objet. = Les types d'effets sont décrits dans le fichier SFXTYPE.H Emit-Sfx SFXTYPE_WAKE1 from wake1; Explode Objet type Type_d'explosion; = Explose un objet selon le type choisi. = Voir le fichier EXPTYPE.H pour les types d'explosions. = Explode link type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; Get Variable_système;

Donne la valeur d'une variable système (comme BUILD_PERCENT_LEFT) Get BUILD_PERCENT_LEFT

Hide Objet; = Cache un objet (Tous les objets sont visibles par défaut) Hide flare; Jump Destination; = Effectue un saut à la destination. Aucun exemple trouvé dans TA Jump if (Valeur == False) Destination; = Effectue un saut conditionnel à la destination. Aucun exemple trouvé dans TA Move Objet to Axe-axis <Position> Speed <Vitesse>; = Déplace un objet à une position selon un axe (x, y ou z) à une certaine vitesse. = move rgun to z-axis [-1.5] speed [25]; =On peut mettre < > ou [ ] Move Objet to Axe-axis <Position> Now; = Déplace un objet immédiatement. move barrel1 to z-axis [-1.5] now; Rand(Valeur_Min, Valeur_Max); = Renvoie une valeur aléatoire comprise entre le minimum et le maximum. i = rand(1,3); Return (Value); = Renvoie une valeur au jeu. Return (0); Set Variable_système To Valeur; = Assigne une valeur à une variable système. Set ARMORED To TRUE Set-Signal-Mask Signal; = Assigne un ID (0, 2, 4, 6, ...) a un signal, déterminant comment une procédure peut être stoppée. = set-signal-mask SIG_MOVEMENT; Shade Objet; = Active les ombres sur les objets. Shade gun; Show Objet; = Rend un objet visible. Show flare; Signal Signal; = Envoie un signal (0, 2, 4, 6, ...) pour arrêter la procédure dont le masque de signal est le même. = signal SIG_MOVEMENT; Sleep Durée; = Fait une pause entre deux actions. sleep 150; Spin Objet Around Axe-Axis Speed Vitesse Accelerate Accélération; = Fait tourner un objet indéfiniment, avec une certaine accélération, = à une certaine vitesse. spin rotor around y-axis speed <2000> accelerate <100>; Spin Objet Around Axe-Axis Speed Vitesse; = Fait tourner un objet indéfiniment directement à la vitesse max. spin pad around y-axis speed <30>; Start-Script Procédure(Paramètres); = Lance une procédure START-SCRIPT RequestState( ACTIVE ); Stop-Spin Objet Around Axe-Axis Decelerate Décélération; = Stoppe la rotation de l'objet avec une décélération. stop-spin rotor around y-axis decelerate <30>; Stop-Spin Objet Around Axe-Axis; = Stoppe la rotation de l'objet immédiatement. stop-spin pad around y-axis; Turn Objet to Axe-Axis Angle Speed Vitesse; = Fait tourner un objet à tel angle autour d'un axe à une certaine vitesse. TURN top to z-axis <-90> SPEED <36>; Turn Objet to Axe-Axis Angle Now; = Fait tourner un objet immédiatement. TURN top to z-axis <0> NOW; Wait-For-Move Objet Along Axe-Axis; = Crée une pause jusqu'à ce que l'objet ait fini de bouger le long de l'axe voulu. = wait-for-move tige2 along z-axis; Wait-For-Turn Objet Around Axe-Axis; = Crée une pause jusqu'à ce que l'objet ait fini de tourner autour de l'axe voulu. = wait-for-turn tige1 around x-axis;

                                     Index of BOS function :

Distances are in meters and Angles are in degrees Sleep [Time]; // make a little pause between 2 or more events Cache [Object]; // Disable texture animation ( default = disabled ) Dont-Cache [Object]; // Enable texture animation ( default = disabled ) Shade [Object]; // Enable shading ( default for building = enabled; default for moving units = disabled ) Dont-Shade [Object]; // Disable shading ( default for building = enabled; default for moving units = disabled ) Show [Object]; // Show an object ( default = all objects shown ) Hide [Object]; // Hide an object ( default = all objects shown Emit-Sfx [Type] from [Object]; // Emit a SFX ( fire or bubbles ) from a point ( pointbased ) or from a vertex ( vectorbased ) Explode [Object] [Type]; // Explode an object 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 Stop-Spin [Object] Around [Axis] Decelerate [Deceleration]; // stop spinning an object with deceleration Stop-Spin [Object] Around [Axis]; // stop spinning an object immediatly 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 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 Start-Script [Script]([Parameters]); // Start a script Call-Script [Script]([Parameters]); // Call a script Get [SysVar]; // Get a sysvar like BUILD_PERCENT_LEFT Return [Value]; // Return to selected value Set [SysVar] To [Value]; // Set a sysvar to a value ( ex : SET ARMORED TO TRUE ) Rand([Min], [Max]); // Randomize a static-var value . still not supported by the cobbler Set-Signal-Mask [Signal]; // Set an ID ( 0 , 2 , 4 , 8 , etc.. ) for the signal mask. this is how the script can be killed. Signal [Signal]; // Emit a signal ( 0 , 2 , 4 , 8 , etc.. ) to kill script with same signal-mask

Still not tried : Attach-Unit [Unit] To [Object]; // Attach a Unit to selected object Drop-Unit [Unit]; // Drop unit Jump [Destination]; Jump if ([Value] == False) [Destination];


spring76b1// Indices for set/get value// Get Variable_système; Get [SysVar]; // Get a sysvar like BUILD_PERCENT_LEFT //Get Variable_système;

Donne la valeur d'une variable système (comme BUILD_PERCENT_LEFT) 

(ex: Get BUILD_PERCENT_LEFT")

Set [SysVar] To [Value]; // Set a sysvar to a value ( ex : SET ARMORED TO TRUE )

Donne la valeur d'une variable système (comme BUILD_PERCENT_LEFT) Get BUILD_PERCENT_LEFT

//Get Variable_système;

Donne la valeur d'une variable système (comme BUILD_PERCENT_LEFT) Get BUILD_PERCENT_LEFT

  1. define constante valeur //Assigne une valeur à une constante,
//et cette constante sera remplacée par sa valeur en compilant
  1. define ACTIVATION 1 // set or get
  2. define STANDINGMOVEORDERS 2 // set or get
  3. define STANDINGFIREORDERS 3 // set or get
  4. define HEALTH 4 // get (0-100%)
  5. define INBUILDSTANCE 5 // set or get
  6. define BUSY 6 // set or get (used by misc. special case missions like transport ships)
  7. define PIECE_XZ 7 // get
  8. define PIECE_Y 8 // get
  9. define UNIT_XZ 9 // get
  10. define UNIT_Y 10 // get
  11. define UNIT_HEIGHT 11 // get
  12. define XZ_ATAN 12 // get atan of packed x,z coords
  13. define XZ_HYPOT 13 // get hypot of packed x,z coords
  14. define ATAN 14 // get ordinary two-parameter atan
  15. define HYPOT 15 // get ordinary two-parameter hypot
  16. define GROUND_HEIGHT 16 // get land height, 0 if below water
  17. define BUILD_PERCENT_LEFT 17 // get 0 = unit is built and ready, 1-100 = How much is left to build
  18. define YARD_OPEN 18 // set or get (change which plots we occupy when building opens and closes)
  19. define BUGGER_OFF 19 // set or get (ask other units to clear the area)
  20. define ARMORED 20 // set or get

/*#define WEAPON_AIM_ABORTED 21

  1. define WEAPON_READY 22
  2. define WEAPON_LAUNCH_NOW 23
  3. define FINISHED_DYING 26
  4. define ORIENTATION 27*/
  5. define IN_WATER 28
  6. define CURRENT_SPEED 29

//#define MAGIC_DEATH 31

  1. define VETERAN_LEVEL 32
  2. define ON_ROAD 34
  3. define MAX_ID 70
  4. define MY_ID 71
  5. define UNIT_TEAM 72
  6. define UNIT_BUILD_PERCENT_LEFT 73
  7. define UNIT_ALLIED 74
  8. define MAX_SPEED 75
  9. define CLOAKED 76
  10. define WANT_CLOAK 77
  11. define GROUND_WATER_HEIGHT 78 // get land height, negative if below water
  12. define UPRIGHT 79 // set or get
  13. define POW 80 // get
  14. define PRINT 81 // get, so multiple args can be passed
  15. define HEADING 82 // get
  16. define TARGET_ID 83 // get
  17. define LAST_ATTACKER_ID 84 // get
  18. define LOS_RADIUS 85 // set or get
  19. define AIR_LOS_RADIUS 86 // set or get
  20. define RADAR_RADIUS 87 // set or get
  21. define JAMMER_RADIUS 88 // set or get
  22. define SONAR_RADIUS 89 // set or get
  23. define SONAR_JAM_RADIUS 90 // set or get
  24. define SEISMIC_RADIUS 91 // set or get
  25. define DO_SEISMIC_PING 92 // get
  26. define CURRENT_FUEL 93 // set or get
  27. define TRANSPORT_ID 94 // get
  28. define SHIELD_POWER 95 // set or get
  29. define STEALTH 96 // set or get
  30. define CRASHING 97 // set or get, returns whether aircraft isCrashing state
  31. define CHANGE_TARGET 98 // set, the value it's set to determines the affected weapon
  32. define CEG_DAMAGE 99 // set
  33. define COB_ID 100 // get
  34. define PLAY_SOUND 101 // get, so multiple args can be passed
  35. define KILL_UNIT 102 // get KILL_UNIT(unitId, SelfDestruct=true, Reclaimed=false)
  36. define ALPHA_THRESHOLD 103 // set or get
  37. define SET_WEAPON_UNIT_TARGET 106 // get (fake set)
  38. define SET_WEAPON_GROUND_TARGET 107 // get (fake set)

// NOTE: [LUA0 - LUA9] are defined in CobThread.cpp as [110 - 119]

  1. define FLANK_B_MODE 120 // set or get
  2. define FLANK_B_DIR 121 // set or get, set is through get for multiple args
  3. define FLANK_B_MOBILITY_ADD 122 // set or get
  4. define FLANK_B_MAX_DAMAGE 123 // set or get
  5. define FLANK_B_MIN_DAMAGE 124 // set or get
  6. define WEAPON_RELOADSTATE 125 // get (with fake set)
  7. define WEAPON_RELOADTIME 126 // get (with fake set)
  8. define WEAPON_ACCURACY 127 // get (with fake set)
  9. define WEAPON_SPRAY 128 // get (with fake set)
  10. define WEAPON_RANGE 129 // get (with fake set)
  11. define WEAPON_PROJECTILE_SPEED 130 // get (with fake set)
  12. define MIN 131 // get
  13. define MAX 132 // get
  14. define ABS 133 // get

// NOTE: shared variables use codes [1024 - 5119]

spring

Variables systèmes TRUE=1 & FALSE=0 & TRUE=!FALSE & 1=!0 Variable Actions et valeurs Description ACTIVATION Lecture/Ecriture 0 ou 1 Indique si l'unité est active ou non. ARMORED Lecture/Ecriture TRUE ou FALSE Indique si l'unité est protégée ou non (comme pour la centrale solaire) ATAN Lecture BUGGER_OFF Lecture/Ecriture BUILD_PERCENT_LEFT Lecture 0 à 100 Renvoie le pourcentage de l'état de construction de l'unité. Si cette valeur est 0 (FALSE), l'unité est finie. BUSY Lecture/Ecriture Indique si l'unité est occupée (comme pour les avions de transport) GROUND_HEIGHT Lecture Renvoie la hauteur du sol HEALTH Lecture Renvoie l'état de santé de l'unité HYPOT Lecture INBULIDSTANCE Lecture/Ecriture Indique si l'unité de construction est en train de construire PIECE_XZ Lecture/Ecriture PIECE_Y Lecture STANDINGFIREORDERS Lecture/Ecriture 0 à 2 Indique l'ordre donné à l'unité (Halte au feu/Riposter/Feu à volonté) STANDINGMOVEORDERS Lecture/Ecriture 0 à 2 Indique l'ordre donné à l'unité (Position....) UNIT_HEIGHT Lecture Renvoie la hauteur de l'unité UNIT_XZ Lecture UNIT_Y Lecture XZ_ATAN Lecture XZ_HYPOT Lecture YARD_OPEN Lecture/Ecriture Indique quels endroits sont occupés/libérés par une usine. // SFX Occupy States setSFXoccupy(setSFXoccupy_argument) { terrain_code = setSFXoccupy_argument; // 0 -> Transported: Unit is being loaded // 1 -> Sea: Unit does not have upright=1 and is going into sea. Or unit has upright=1 and is going into shore. (From unloading, or ground, or deep sea for upright unit) // 2 -> Sea: Unit has upright=1 and goes into deep sea. (From shore, or unloading) // 3 -> ???? // 4 -> Land: Unit is being created, goes from sea (or shore if upright=1) to dry ground, or is unloaded

  1. define SFXOCCUPY_AIR 5

10071000 explode_piece <piece> ( <flags> -- ) 00 10 07 10 Explode Explodes the object with a type of explosion Pre-condition: TYPE on Stack, command followed by an object number. Post-condition: Type gone from stack, object explodes. Types d'explosions (EXPTYPE.H)

  1. define SHATTER 1 // The piece will shatter instead of remaining whole
  2. define EXPLODE_ON_HIT 2 // The piece will explode when it hits the ground
  3. define FALL 4 // The piece will fall due to gravity instead of just flying off
  4. define SMOKE 8 // A smoke trail will follow the piece through the air
  5. define FIRE 16 // A fire trail will follow the piece through the air
  6. define BITMAPONLY 32 // The piece will not fly off or shatter or anything. Only a bitmap explosion will be rendered.

Utilisez le trait vertical | pour séparer les types (ex SHATTER | FALL | EXPLODE_ON_HIT | BITMAP1) SHATTER : La pièce explose en faces au lieu de rester entière EXPLODE_ON_HIT : La pièce explosera en touchant le sol FALL : La pièce retombera au lieu de s'envoler SMOKE : La pièce sera suivie par un nuage de fumée FIRE : La pièce sera suivie par une traînée de feu BITMAPONLY : La pièce ne sera pas éjectée, on ne verra qu'une simple explosion // Bitmap Explosion Types (these will be changed eventually) Les paramètres suivants sont les explosions à afficher lorsque la pièce (ou les face s'il y a SHATTER) explose avec BITMAPONLY ou tombe avec EXPLODE_ON_HIT et FALL

  1. define BITMAP1 256
  2. define BITMAP2 512
  3. define BITMAP3 1024
  4. define BITMAP4 2048
  5. define BITMAP5 4096
  6. define BITMAPNUKE 8192
  7. define BITMAPMASK 16128 // Mask of the possible bitmap bits

BITMAP1 : Explosion type 1 BITMAP2 : Explosion type 2 BITMAP3 : Explosion type 3 BITMAP4 : Explosion type 4 BITMAP5 : Explosion type 5 BITMAPNUKE : Explosion nucléaire // New in TA:K

  1. define EXPTYPE_XLARGESMOKE 65536

1000F000 emit_sfx_from_piece <piece> ( <flags> -- ) 00 F0 00 10 Emit-SFX A call to this will cause an object to emit smoke. Pre-condition: The stack contains the kind of smoke to emit. Post-condition: The smoke type is removed from the stack and the unit is smoking.

  1. define SFXTYPE_POINTBASED 256
  2. define SFXTYPE_WHITESMOKE (SFXTYPE_POINTBASED | 1)
  3. define SFXTYPE_BLACKSMOKE (SFXTYPE_POINTBASED | 2)
  4. define SFXTYPE_SUBBUBBLES 256 | 3

// New in TA:K

  1. define SFXTYPE_SMALLDAMAGEFLAME (SFXTYPE_POINTBASED | 4)
  2. define SFXTYPE_MEDIUMDAMAGEFLAME (SFXTYPE_POINTBASED | 5)
  3. define SFXTYPE_LARGEDAMAGEFLAME (SFXTYPE_POINTBASED | 6)

// Vector-based special effects

  1. define SFXTYPE_VTOL 0
  2. define SFXTYPE_THRUST 1
  3. define SFXTYPE_WAKE1 2
  4. define SFXTYPE_WAKE2 3
  5. define SFXTYPE_REVERSEWAKE1 4
  6. define SFXTYPE_REVERSEWAKE2 5

// Types d'effets (SFXTYPE.H) SFXTYPE_VTOL : feu SFXTYPE_THRUST : ? SFXTYPE_WAKE1 :sillage long des bateaux SFXTYPE_WAKE2 : Même effet SFXTYPE_REVERSEWAKE1 : sillage large des hovercrafts (bulles) SFXTYPE_REVERSEWAKE2 : Idem SFXTYPE_WHITESMOKE : Je pense que ça émet de la fumée blanche à partir d'un point. SFXTYPE_BLACKSMOKE : Même chose en noir SFXTYPE_SUBBUBBLES : Je pense que ça émet des bulles pour un sous-marin ou une unité sous-marine


10052000 compare_less_equal ( <value> <value> -- <result> ) 00 20 05 10 VAL1 <= VAL2 Does less than or equal to comparison. Pre-condition: VAL1 is on stack followed by VAL2. Post-condition: Both numbers are gone and replaced with result. T - 1 F - 0

10051000 compare_less ( <value> <value> -- <result> ) 00 10 05 10 VAL1 < VAL2 A call to this function will do a less than compare with the two values on the stack Pre-condition: VAL1 is placed on stack and then VAL2. Post-condition: VAL1 & VAL2 removed from stack, replaced with 1(T) or 0(F).

10033000 multiply ( <value> <value> -- <result> ) 00 30 03 10 Multiply A call to this function multiplies two numbers. Stack: <VAL1> Stack: <Answer> <VAL2> Post Data: <None>

00 20 03 10 - Subtract <VAL2> from <VAL1> Stack: <VAL1> Stack: <Answer> <VAL2> Post Data: <None>

00 50 05 10 == Do a binary compare of two values. Pre-condition: The two values to compare are on the stack. Post-condition: The two values are removed and replaced with 1 for T or 0 for F.

00 60 05 10 != VAL1 and VAL2 are checked to see if same. Pre-condition: VAL1 and VAL2 are on stack. Post-condition: Numbers are removed from stack, and replaced with 0-Diff 1-Same.

00 A0 05 10 NOT Dose a bitwise not of a Number Stack: <VAL1> Stack: <NOT VAL1> Post Data: <None>

10066000 jump_if_false_offset <offset> ( -- ) 00 60 06 10 If Test value and branch execution. If <VAL1> does not equal 0 then the offset is ignored. If <VAL1> is anything else execution will continue at the location of the offset. Stack: <VAL1> Stack: <Empty> Post Data: <Offset>

10064000 jump_offset <offset> ( -- ) 00 40 06 10 Jump A call to this function will cause code execution to continue at the destination relative to the code block start. Pre-condition: Value following command is the address to jump to relative to the start of the code block. Post-condition: Code execution continues at new location.

10036000 bitwise_or ( <value> <value> -- <result> ) 10 60 03 10 Bitwise OR Dose a Bitwise or with two numbers. Pre-condition: VAL1 and VAL2 on stack. Post-condition: Numbers are removed and replaced with the result. Initial CVS entry after repository move.


Fonction et syntaxe Description Exemple

Attach-Unit Unité To Objet; Attache une unité à l'objet (pour les unités de transport comme le bateau) Attach-Unit unitid To link;

Cache Objet; Désactive l'animation d'une texture Cache arm;

Call-Script Procédure(Paramètres); Appelle une procédure call-script BoomCalc( get UNIT_XZ(unitid),get UNIT_Y(unitid) + get UNIT_HEIGHT(unitid) );

Dont-Cache Objet; Active une animation de texture (Désactivée par défaut ) Dont-Cache turret; 00 80 00 10 Don't-cache Turns graphic caching off Pre-condition: Value following command is number of object to effect. Post-condition: The above object is no longer cached.

Dont-Shade Objet; Désactive les ombres sur l'unité. Activé pour les bâtiments. Dont-Shade wing1; 00 E0 00 10 Don't-shade Turns graphic shading off Pre-condition: Value following command is number of object to effect. Post-condition: The above object is no longer shaded.

Drop-Unit Unité; Largue l'unité attachée Drop-unit unitid;

Emit-Sfx Type_d'effet from Objet; Emet un effet (comme le feu ou les bulles pour les bateaux) à partir de l'objet.

Les types d'effets sont décrits dans le fichier SFXTYPE.H Emit-Sfx SFXTYPE_WAKE1 from wake1; 

1000F000 emit_sfx_from_piece <piece> ( <flags> -- ) 00 F0 00 10 Emit-SFX A call to this will cause an object to emit smoke. Pre-condition: The stack contains the kind of smoke to emit. Post-condition: The smoke type is removed from the stack and the unit is smoking.

Explode Objet type Type_d'explosion; Explose un objet selon le type choisi.

Voir le fichier EXPTYPE.H pour les types d'explosions. 

Explode link type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP1; 10071000 explode_piece <piece> ( <flags> -- ) 00 10 07 10 Explode Explodes the object with a type of explosion Pre-condition: TYPE on Stack, command followed by an object number. Post-condition: Type gone from stack, object explodes.

Get Variable_système; Donne la valeur d'une variable système (comme BUILD_PERCENT_LEFT) Get BUILD_PERCENT_LEFT

Hide Objet; Cache un objet (Tous les objets sont visibles par défaut) Hide flare; 00 60 00 10 Hide Object Hides an object Stack: <Empty> Stack: <Empty> Post Data: <Object #>

Jump Destination; Effectue un saut à la destination. Aucun exemple trouvé dans TA Jump if (Valeur == False) Destination; Effectue un saut conditionnel à la destination.

Aucun exemple trouvé dans TA 

Move Objet to Axe-axis <Position> Speed <Vitesse>;

Déplace un objet à une position selon un axe (x, y ou z) à une certaine vitesse.
move rgun to z-axis [-1.5] speed [25];

On peut mettre < > ou [ ] 00 10 00 10 Move object This will cause an object to move a distance on an axis. Stack: <Speed> Stack: <Empty> <Distance> Post Data: <Object #> <Axis #> Move Objet to Axe-axis <Position> Now; Déplace un objet immédiatement. move barrel1 to z-axis [-1.5] now;

Rand(Valeur_Min, Valeur_Max); Renvoie une valeur aléatoire comprise entre le minimum et le maximum. i = rand(1,3); 10041000 rand ( <value -- ) 00 10 04 10 Random Number A call to this function will return a random integer in the range of high and low. Pre-condition: Low boundary is placed on stack, and then the High boundary is placed on stack. Post-condition: The stack contains the random number.

Return (Value); Renvoie une valeur au jeu. Return (0); 10065000 return ( <result> -- ) 00 50 06 10 Return from function A call to this function will exit the function with the return value that is on the stack. Pre-condition: The value to return has been placed on the stack. Post-condition: The function is exited with the return value removed from the stack.

Set Variable_système To Valeur; Assigne une valeur à une variable système. Set ARMORED To TRUE Set-Signal-Mask Signal; Assigne un ID (0, 2, 4, 6, ...) a un signal, déterminant comment une procédure peut être stoppée. set-signal-mask SIG_MOVEMENT; Shade Objet; Active les ombres sur les objets. Shade gun; Show Objet; Rend un objet visible. Show flare; 00 50 00 10 Show Object Shows an object after it has been hidden Stack: <Empty> Stack: <Empty> Post Data: <Object #>

Signal Signal; Envoie un signal (0, 2, 4, 6, ...) pour arrêter la procédure dont le masque de signal est le même.

signal SIG_MOVEMENT; 

Sleep Durée; Fait une pause entre deux actions. sleep 150; 10013000 sleep ( <time> -- ) 00 30 01 10 Sleep Cause a unit to delay in execution. Stack: <Length> Stack: <Empty> Post Data: <None>

Spin Objet Around Axe-Axis Speed Vitesse Accelerate Accélération;

Fait tourner un objet indéfiniment, avec une certaine accélération, à une certaine vitesse.
spin rotor around y-axis speed <2000> accelerate <100>; 

00 30 00 10 Spin Object Causes an object to spin at a speed, on an axis. Pre-condition: Speed is on the stack, The Object # follows the command, and is followed by the Axis

  1. . (0-x 1-y 2-z)

Post-condition: The object is spinning and the speed is removed from the stack. Spin Objet Around Axe-Axis Speed Vitesse; Fait tourner un objet indéfiniment directement à la vitesse max.

spin pad around y-axis speed <30>; 

Start-Script Procédure(Paramètres); Lance une procédure START-SCRIPT RequestState( ACTIVE ); Stop-Spin Objet Around Axe-Axis Decelerate Décélération; Stoppe la rotation de l'objet avec une décélération.

stop-spin rotor around y-axis decelerate <30>; 

Stop-Spin Objet Around Axe-Axis; Stoppe la rotation de l'objet immédiatement. stop-spin pad around y-axis; Turn Objet to Axe-Axis Angle Speed Vitesse; Fait tourner un objet à tel angle autour d'un axe à une certaine vitesse. TURN top to z-axis <-90> SPEED <36>; 00 20 00 10 Turn Object Causes an object to turn on an axis, at a speed, to a direction Stack: <Speed> Stack: <Empty> <Direction> Post Data: <Object #> <Axis #> Turn Objet to Axe-Axis Angle Now; Fait tourner un objet immédiatement. TURN top to z-axis <0> NOW; Wait-For-Move Objet Along Axe-Axis; 00 20 01 10 Wait-for-move Wait for an object to complete it's move. Stack: <Empty> Stack: <Empty> Post Data: <Object #> <Axis #> Crée une pause jusqu'à ce que l'objet ait fini de bouger le long de l'axe voulu.

wait-for-move tige2 along z-axis; 

Wait-For-Turn Objet Around Axe-Axis;

Crée une pause jusqu'à ce que l'objet ait fini de tourner autour de l'axe voulu. 

wait-for-turn tige1 around x-axis; 00 10 01 10 Wait-for-turn A call to this will wait for an object to finish turning. Stack: <Empty> Stack: <Empty> Post Data: <Object #> <Axis #>

00 10 06 10 Start-script A call to this function will start a new function, terminating all activity in the current function permanently. Stack: <Parameter1> Stack: <Empty> <ParameterN> Post Data: <Function #> <Number Of Parameters>

10042000 get_unit_value ( <value_id> -- <value> ) 00 20 04 10 Get value from port A call to this function will return the value that is stored in the port number stored on the stack. Pre-condition: The number of the port to check has been placed on the stack. Post-condition: The port number is removed from stack, replaced by the value stored in that port.

00 30 06 10 Call-script A call to this function will call a function, returning to the execution point after completion. Pre-condition: Stack holds the parameters to pass, command is followed by the number of the function to call (1st is 0), the function number is followed by the number of parameters to pass. Post-condition: Script execution begins in new function, all parameters are removed from the stack.

00 80 06 10 Set-Signal-Mask Do not know Stack: <Signal #> Stack: <Empty> Post Data: <None>

00 70 06 10 Signal Do not know Stack: <Signal #> Stack: <Empty> Post Data: <None>

10021001 push_constant <constant> ( -- <constant> ) 01 10 02 10 Put Constant dword onto stack A call to this function will put the dword following the command onto the data stack. Pre-condition: Command is followed by dword constant to place on stack. Post-condition: The dword value is now at the top of the stack.

10021002 push_variable <variable> ( -- <value> ) 02 10 02 10 Put local var onto stack A call to this function will place the value of a variable onto the stack. Stack: <Empty> Stack: <Value Of Var> Post Data:

10023002 pop_variable <variable> ( <value> -- ) 02 30 02 10 Set local var to value Sets the local variable to a value. Pre-condition: Value is on stack. Command followed by variable number. Post-condition: Local variable is equal to the number on the stack, the number is removed from the stack.

04 10 02 10 Put Static Var on Stack Will put the given static var onto the stack. Pre-condition: Command is followed by static var number. Post-condition: Stack contains value of the var number specified.

04 30 02 10 Set a static-var equal to a value A call to this function will set the static-variable supplied equal to a constant value Pre-condition: Stack holds the number to be assigned to the static-var, the number following the command, holds the number of the static-variable to change. Post-condition: The static-var is now set to the value, and the value has been removed from the stack.

10022000 stack_allocate ( -- ) 00 20 02 10 Create local variable Creates a dword sized placeholder in the local variable space, this command is called for both incoming function parameters, as well as Var statements. The parameters are created first then the variables. Pre-condition: None Post-condition: None


COB news for spring changelog76b1: - Give a COB error instead of crashing for invalid explosion generator indices

 or weapon indices in emit-sfx. #

- Added COB call to "ShotX" that happens shortly before weaponX uses

 QueryWeaponX, use this for switching firepoints in bursts or when using
 multiple projectiles. 

- StartBuilding now supplies the pitch as the second parameter to help with

 custom build FX. 

- Fixed cob bitwise not operator (was logical not.) - Added a MOD COB opcode for modulo division - Introduces the COB get/set variable 103, ALPHA_THRESHOLD. It ranges from 0-255

 and changes the glAlphaFunc to use that alpha value as its minimum. In
 practice this allows disintegration-style effects or the reverse for build animations.

- Transport AI now calls the cob function 'StartUnload' which is called once

 when transport starts to lower during land flood method. 

- Dropped units call the cob functions 'falling' and 'landed' so that you may

 start and stop a parachute animation. 

- Added the 'cobID' unitDef tag, and the COB_ID (100) COB GET type - Added the BlockShot#(unitID, block) COB call-in - set block to non-zero to

 block the unit firing at unitID

- Added the cob GET/SET STEALTH command (96) - Added CRASHING (97) get/set constant to COB. Can be used to get/set whether an

 aircraft is crashing. Is ignored for non-CAirMoveType units.
 (including CTAAirMoveType aircraft)

- Added global, team, and ally GET/SET variables to COB scripts

   1024 - 2047:  1024 global variables
   2048 - 2175:  128  variables per team      (the COB script unit's team)
   2176 - 2303:  128  variables per allyteam  (the COB script unit's allyteam)

- Added 8 shared per-unit variables (example: GET UNIT_VAR_START -unitID value) - Added the SET_WEAPON_UNIT_TARGET (106) and SET_WEAPON_GROUND_TARGET (107)

 COB GET codes  (used GET because of its extra parameters)
  -  GET  SET_WEAPON_UNIT_TARGET    weaponID  unitID          userTarget
  -  GET  SET_WEAPON_GROUND_TARGET  weaponID  xzCoord yCoord  userTarget 

- Added TargetWeightX COB call-in and CHANGE_TARGET cob set var.

 COB call-in TargetWeightX(targetID, weight), weight defaults to 65536 which
 represents 1.0 and is multiplied with the target's value to determine priorities.
 Set CHANGE_TARGET to Y makes weaponY pick a new target.

- Adds the COB set constant CEG_DAMAGE (99), which defines the damage value for

 all CEGs triggered by emit-sfx 1024 + x to allow for some variability in the
 emitted effects (to e.g. make a charging energy ball grow larger or have smoke
 get progressively darker as the unit's HP decreases).

- Added a new get call, PLAY_SOUND, to play a sound that can be heard only by

 allies, enemy, in los, etc. GET PLAY_SOUND(sound number, volume,
 who hears the sound, where to play the sound) (see r4974 for full docs)

- Get health now allows a unit ID to be passed. - Added COB and Lua access to some more weapon variables.

 New COB constants, all get-only (but not read-only):
 WEAPON_RELOADSTATE 125 (frame number of the next shot/burst)
 WEAPON_RELOADTIME 126 (in frames)
 WEAPON_ACCURACY 127
 WEAPON_SPRAY 128
 WEAPON_RANGE 129
 WEAPON_PROJECTILESPEED 130
 All of these use the first param (starting at 1) as the weapon index whereby positive 
 means read and negative means write the second param to the value. In the latter case
 the previous value is returned.

- HitByWeaponId(z,x,id,damage) will be called instead of HitByWeapon if it exist

 in script.

- Implemented COB get/set constant STANDINGMOVEORDER (2) - Implemented COB get/set constant STANDINGFIREORDER (3) - Added a new COB query call, "QueryLandingPadCount".

 - if not defined, Spring will assume 16 as the maximum number of pads
 - it takes one argument, which is initially set to 16, the number
   returned in arg0 will be used as the maximum number of pads.

- Fixed logical XOR,AND,OR (they were implemented as binary XOR,AND,OR) - Added COB get/set constant UPRIGHT (79) - Added COB get constant POW (80) with 2 arguments x and y: it returns x^y. - Added COB get constant PRINT (81) which prints it's 4 arguments to infolog. - Added COB get constant HEADING (82) - Added COB get constant TARGET_ID (83) - Added COB get constant LAST_ATTACKER_ID (84) - Added COB get/set constant LOS_RADIUS (85) - Added COB get/set constant AIR_LOS_RADIUS (86) - Added COB get/set constant RADAR_RADIUS (87) - Added COB get/set constant JAMMER_RADIUS (88) - Added COB get/set constant SONAR_RADIUS (89) - Added COB get/set constant SONAR_JAM_RADIUS (90) - Added COB get/set constant SEISMIC_RADIUS (91) - Added COB get constant DO_SEISMIC_PING (92) - Added COB get/set constant CURRENT_FUEL (93) - Added COB get constant TRANSPORT_ID (94) - Added COB get/set constant SHIELD_POWER (95) - Added COB get/set constants LUA0-LUA9 (110-119) - Added GROUND_WATER_HEIGHT (78) to get in cob script.

 Same as GROUND_HEIGHT (16) but in water it returns negative water depth instead of 0.

- Calling emit-sfx 2048 from a script will now allways fire the weapon. Emit-sfx 4096 will now take over the previous behavior of detonating the weapon at the piece position. - Added CLOAKED (76) and WANT_CLOAK (77) to get/set in cob script. - New COB "get"/"set" constant: 75 MAX_SPEED get/sets the max speed of the unit (multiplied with 64k) A few new COB "get" constants:

  70 MAX_ID             returns maximum number of units - 1
  71 MY_ID              returns ID of current unit
  72 UNIT_TEAM	         returns team of unit given with parameter
  73 UNIT_BUILD_PERCENT_LEFT   basically BUILD_PERCENT_LEFT, but comes with a unit parameter
  74 UNIT_ALLIED        is unit given with parameter allied to the unit of the current COB script. 1=allied, 0=not allied

-COB support for Getting/Setting veteran level and unit speed. The returned veteran level is unit experience multiplied by 100 Unit speed can be set to something nonzero only when the current speed is nonzero, it can always be set to zero. -UnitDestroyed/EnemyDestroyed get the attacker unit id if any (by submarine) -SetSfxOccupy now updates correctly when unit is being transported -Added support for aircrafts auto landing to repair when health gets low -When a unit has finished firing a burst the script function EndBurst<weaponnum> will now be called,

use this instead of Fire<weaponnum> to switch pod/barrel etc to fire from to lessen friendly fire incidents

-Added support for set/get of unit variable ACTIVATION (allowing solars to close under attack for example) -Added call to cob function SetMaxReloadTime for better ta unit compatibility - New COB GET/SETS

   FLANK_B_MODE         120 // set or get
   FLANK_B_DIR          121 // set or get, set is through get for multiple args
   FLANK_B_MOBILITY_ADD 122 // set or get
   FLANK_B_MAX_DAMAGE   123 // set or get
   FLANK_B_MIN_DAMAGE   124 // set or get

- Adds [flankingBonus] { defaultMode = 1; } to modrules. New unitDef parameters:

   int    flankingBonusMode
   float  flankingBonusMax
   float  flankingBonusMin
   float  flankingBonusMobilityAdd
   float3 flankingBonusDir

- Added SimpleGroundFlash to explosion generator. - Added the abillity to call explosiongenerators and weaponfire from within script via emit-sfx command.

 Explosiongenerators to be called via script are defined in the unit TDF file in a section called SFXTypes, with tags explosiongenerator+n=some_explosion
 and then called via emit-sfx 1024+n.  
 Weaponfire are called via emit-sfx 2048+weapon_to_fire.

Added the abillity to call explosiongenerators and weaponfire from within script via emit-sfx command.

 Explosiongenerators to be called via script are defined in the unit TDF file in a section called SFXTypes, with tags explosiongenerator+n=some_explosion
 and then called via emit-sfx 1024+n.  
 Weaponfire are called via emit-sfx 2048+weapon_to_fire.

[QueryWeapon<1-16> AimWeapon<1-16> AimFromWeapon<1-16> FireWeapon<1-16> functions in scripts.]

Retrieved from "http://spring.clan-sy.com/wiki/Units:.bos/.COB"

This page has been accessed 189 times. This page was last modified 23:34, 30 October 2008.




Page editing toolbox

Browse
Main Page
Community portal
Current events
Recent changes
Random page
Help
Donations
Edit
View source
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Log in
Special pages
New pages
File list
Statistics
Bug reports
More...

Site layout created by Roflcopter.