PageRenderTime 46ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/evolutiondev.sdd/Scripts/STANDARD_COMMANDS_WORLDovm_builder.h

http://evolutionrts.googlecode.com/
C Header | 183 lines | 96 code | 11 blank | 76 comment | 0 complexity | 31d64f017a0f601b73b2e9d68592b4ea MD5 | raw file
  1. // Argh's Standard Commands Script
  2. // This script is released under the terms of the PURE license.
  3. #ifndef STANDARD_COMMANDS_PURE_H_
  4. #define STANDARD_COMMANDS_PURE_H_
  5. //
  6. // Vector-based special effects
  7. //
  8. #define SFXTYPE_WAKE1 3 // Calls Spring to show a standard FX if the Unit is over water (may show on water surface if on land, use with detection methods)
  9. //
  10. // Point-based (piece origin) special effects
  11. //
  12. #define SHATTER 1 // Has odd effects in S3O, due to triangular models. Use with caution.
  13. #define EXPLODE_ON_HIT 2 // DOES NOT WORK PROPERLY IN SPRING, REFERENCE ONLY
  14. #define FALL 4 // The piece will fall due to gravity, based partially on myGravity value
  15. #define SMOKE 8 // Creates 1 "smoke" particle each frame at the Piece's center, using standard values, as of Spring 0.75b2
  16. #define FIRE 16 // Creates one "flame" and one "smoke" particle at the Piece's center, using standard values, as of Spring 0.75b2
  17. #define BITMAPONLY 32 // DOES NOT WORK PROPERLY IN SPRING, REFERENCE ONLY
  18. //
  19. // Bitmap Explosion Types
  20. //
  21. #define BITMAP_PURE 10000001 //This is for any call to a BITMAP event, however it's not really necessary. Just for helping out older conversion mods.
  22. //
  23. // Indices for SET/GET value
  24. #define ACTIVATION 1 // SET or GET, used by all scripts that call Activate() through UI or BOS command
  25. #define STANDINGMOVEORDERS 2 // SET or GET, now works in 0.75b to SET all states (Hold Position, Manuever, Roam). Values 0, 1, 2
  26. #define STANDINGFIREORDERS 3 // SET or GET, now works in 0.75b to SET all states (Hold Fire, Fire at Will, Fire Back). Values 0, 1, 2
  27. #define HEALTH 4 // GET or SET, in 0.74b or above. Can set the hitpoints of the relevant Unit. Use carefully, can create odd behaviors.
  28. #define INBUILDSTANCE 5 // SET or GET, used to tell Spring that a Factory is now able to build objects and emit nano-particles.
  29. #define BUSY 6 // SET or GET, will operate in Spring to pause loading state, for flying transports only.
  30. #define PIECE_XZ 7 // GET, for position calculation, returns two values, XZ, in packed coordinates.
  31. #define PIECE_Y 8 // GET, for position calculation, returns one value, Y. Good for height changes.
  32. #define UNIT_XZ 9 // GET, for position calculation of Unit, reads from centroid of Base.
  33. #define UNIT_Y 10 // GET, for position calculation of Unit, reads from centroid of Base.
  34. #define UNIT_HEIGHT 11 // GET, for position calculation of Unit, reads from Unit's current height value.
  35. #define XZ_ATAN 12 // GET atan of packed x,z coords. Good for angular changes over time. Not fast math, use with care.
  36. #define XZ_HYPOT 13 // GET hypot of packed x,z coords. Good for angular changes over time. Not fast math, use with care.
  37. #define ATAN 14 // GET ordinary two-parameter atan, as integer. Runs most efficiently if sent raw values- i.e., 182 instead of <1.0>
  38. #define HYPOT 15 // GET ordinary two-parameter hypot, as integer. Runs most efficiently if sent raw values- i.e., 65536 instead of [1.0]
  39. #define GROUND_HEIGHT 16 // GET, asks Spring for value of GROUND_HEIGHT based on map values
  40. #define BUILD_PERCENT_LEFT 17 // GET, returns a value from Spring stating how much of the Unit has been built. Only returns every SlowUpdate, however.
  41. #define YARD_OPEN 18 // SET or GET. Spring defines squares as "open" or "closed" for pathfinding purposes based on that state.
  42. #define BUGGER_OFF 19 // SET or GET, causes Units around the Unit if SET to 1 to try to move a minimum distance away, when invoked!
  43. #define ARMORED 20 // SET or GET. Turns on the Armored state. Uses value of Armor defined in unit FBI, which is a float multiple of health.
  44. #define IN_WATER 28 // GET only. If model centroid Y < 0, then returns TRUE (0 Y is the water level). Better detection methods exist.
  45. #define CURRENT_SPEED 29 // SET or GET. Can return the current velocity in raw format. Useful for checking acceleration values, etc.
  46. #define VETERAN_LEVEL 32 // SET or GET. Can make units super-accurate, or keep them inaccurate, and also effects hitpoints. Use with care!
  47. #define MAX_ID 70 // GET only. Returns maximum number of units - 1
  48. #define MY_ID 71 // GET only. Returns ID of current unit
  49. #define UNIT_TEAM 72 // GET only. Returns team of unit given with parameter
  50. #define UNIT_BUILD_PERCENT_LEFT 73 // GET only. Like BUILD_PERCENT_LEFT, but comes with a unit parameter.
  51. #define UNIT_ALLIED 74 // GET only. Is this unit allied to the unit of the current COB script? 1 = allied, 0 = not allied
  52. #define MAX_SPEED 75 // SET only. Alters MaxVelocity for the given unit. Can be SET to anything lower than the max. speed in FBI, value of 1 == 0
  53. #define CLOAKED 76 //SET or GET. GETs current status of cloak.
  54. #define WANT_CLOAK 77 //SET or GET. GETs current value of WANT_CLOAK (1 or 0)
  55. #define GROUND_WATER_HEIGHT 78 //GET only. Returns negative values if unit is over water.
  56. #define UPRIGHT 79 //SET or GET. Can allow you to SET the upRight state of a Unit.
  57. #define POW 80 //GET the power of a number
  58. #define PRINT 81 //Special, read below:
  59. /*Prints the value of up to 4 vars / static-vars into the Spring chat. Very useful for debugging.
  60. Usage is:
  61. var myTest;
  62. myTest = GET POW (262144, 32768);
  63. GET PRINT (myTest)
  64. Would return:
  65. "Value 1: 131072, 2: 0, 3: 0, 4: 0" to the Chat interface.*/
  66. #define HEADING 82 //SET and GET. Allows unit HEADING to be returned, SET to value of previous HEADING every frame to keep units from turning.
  67. #define TARGET_ID 83 //GET. Returns ID of currently targeted Unit. -1 if none, -2 if force-fire, -3 if Intercept, -4 if the Weapon doesn't exist.
  68. #define LAST_ATTACKER_ID 84 //GET. Returns ID of last Unit to attack, or -1 if never attacked. Could theoretically be used to implement special control over weapon systems for a Unit, but I have never seen this done yet.
  69. #define LOS_RADIUS 85 //SET. SETs the LOS Radius (per Ground). Could be used in conjunction with Activate().
  70. #define AIR_LOS_RADIUS 86 //SET. SETs the LOS Radius (per Air). Could be used in conjunction with Activate().
  71. #define RADAR_RADIUS 87 // SET or GET, just like the Unit def.
  72. #define JAMMER_RADIUS 88 // SET or GET, just like the Unit def.
  73. #define SONAR_RADIUS 89 // SET or GET, just like the Unit def.
  74. #define SONAR_JAM_RADIUS 90 // SET or GET, just like the Unit def.
  75. #define SEISMIC_RADIUS 91 // SET or GET, just like the Unit def.
  76. #define DO_SEISMIC_PING 92 //GET (GET DO_SEISMIC_PING(size)) Emits a Seismic Ping. Can be seen by all players regardless of LOS.
  77. #define CURRENT_FUEL 93 // SET or GET, Fuel level is currently (0.75b2) being used for Aircraft only- when 0, Aircraft return to an Air Repair location. Could be used for dynamic fuel based on time of flight (as opposed to weapons use) or for more detailed control over weapons than Spring's defaults.
  78. #define TRANSPORT_ID 94 // GET. Returns ID of the Transport the Unit is in. -1 if not loaded.
  79. #define SHIELD_POWER 95 // GET / SET. Manipulates Shield, if Unit has one, good for timed Shield disruptions. Set to 0 every frame if you want to keep a Shield down for some reason.
  80. #define STEALTH 96 // set or get
  81. #define CRASHING 97 // set or get, returns whether aircraft isCrashing state
  82. #define CHANGE_TARGET 98 // set, the value it's set to determines the affected weapon
  83. #define CEG_DAMAGE 99 // set
  84. #define COB_ID 100 // get
  85. #define PLAY_SOUND 101 //GET only. Plays sounds via these instructions:
  86. /*
  87. 1) Adds a new get call, PLAY_SOUND, to play a sound that can be heard only by allies, enemy, in los, etc.
  88. 2) changes get health to allow a unit ID to be passed
  89. 3) adds a call to create() at the end of ReloadCOB
  90. GET PLAY_SOUND(sound number, volume, who hears the sound, where to play the sound)
  91. To set up sounds to use with GET PLAY_SOUND, put a function like this near the top of your bos:
  92. Sounds()
  93. {
  94. play-sound ("movement", 10);
  95. play-sound ("pew", 10);
  96. play-sound ("reporting", 10);
  97. }
  98. The sound number is based on the order the sounds appear, staring from 0. To call the songs by name, add #defines like this:
  99. Sounds()
  100. {
  101. play-sound ("movement", 10);
  102. #define movement 0
  103. play-sound ("pew", 10);
  104. #define pew 1
  105. play-sound ("reporting", 10);
  106. #define reporting 2
  107. }
  108. To actually call the sound, you use a line such as this:
  109. GET PLAY_SOUND (pew, 655360);
  110. 1) sound number - as above
  111. 2) volume - similar to the volume for play-sound, more affecting the distance where it is audible than actual volume
  112. - given as a float multiplied by 65536
  113. 3) who hears the sound
  114. 0 = anyone with the unit in ALOS
  115. 1 = anyone with the unit in LOS
  116. 2 = anyone with the unit in ALOS or radar
  117. 3 = anyone with the unit in LOS or radar
  118. 4 = everyone
  119. 5 = the unit's allies
  120. 6 = the unit's team
  121. 7 = the unit's enemies
  122. 4) where to play the sound
  123. - if 0, the sound is played from the unit's position
  124. - if 1, the sound is played directly from the speakers, the same way unit replies are*/
  125. #define KILL_UNIT 102 //GET. Kills the Unit this frame. Supplying no unit number kills the calling unit (for convenience). Returns zero if the target doesn't exist.
  126. /////////////////////////////////////////////////////////////////////////////////////////////////////////////LuaCOB
  127. #define LUA0 110 // All are SET / GET, for passing args to LuaCOB interface.
  128. #define LUA1 111
  129. #define LUA2 112
  130. #define LUA3 113
  131. #define LUA4 114
  132. #define LUA5 115
  133. #define LUA6 116
  134. #define LUA7 117
  135. #define LUA8 118
  136. #define LUA9 119
  137. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  138. #define FLANK_B_MODE 120 // set or get
  139. #define FLANK_B_DIR 121 // set or get, set is through get for multiple args
  140. #define FLANK_B_MOBILITY_ADD 122 // set or get
  141. #define FLANK_B_MAX_DAMAGE 123 // set or get
  142. #define FLANK_B_MIN_DAMAGE 124 // set or get
  143. //Weapon Modifications, via COB
  144. /*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.
  145. In the latter case the previous value is returned.*/
  146. #define WEAPON_RELOADSTATE 125 //(frame number of the next shot/burst)
  147. #define WEAPON_RELOADTIME 126 //(in frames)
  148. #define WEAPON_ACCURACY 127
  149. #define WEAPON_SPRAY 128
  150. #define WEAPON_RANGE 129
  151. #define WEAPON_PROJECTILESPEED 130
  152. /////////////////////////////////////////////////////////////////////////////////////////Signal Definitions below. Can be any power-of-two for OTA, may in Spring be any integer.
  153. #define SIG_AIM1 2
  154. #define SIG_AIM2 4
  155. #define SIG_AIM3 8
  156. #define SIG_AIM4 16
  157. #define SIG_AIM5 32
  158. //////////////////////////////////////////////////////////////////////////////////////////////////////////////LuaCOB, standard calls (mod-specific, this needs to be hacked by designer, unfortunately poorly documented by me)
  159. lua_PlayUnitSound() { return 0; }
  160. lua_PlayLocalSound() { return 0; }
  161. lua_PlayWorldSound() { return 0; }
  162. #endif // STANDARD_COMMANDS_PURE_H_