rocketfx.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. // ----------------------------------------------------------------------------
  2. // Placeholder explosion with required sounds, debris, and particle datablocks.
  3. // These datablocks existed in now removed scripts, but were used within some
  4. // that remain: see cheetahCar.cs
  5. //
  6. // These should be made more generic or new fx created for the cheetah turret's
  7. // projectile explosion effects.
  8. //
  9. // I've removed all effects that are not required for the current weapons. On
  10. // reflection I really went overboard when originally designing these effects!
  11. // ----------------------------------------------------------------------------
  12. // ----------------------------------------------------------------------------
  13. // Sound
  14. // ----------------------------------------------------------------------------
  15. datablock SFXProfile(RocketLauncherExplosionSound)
  16. {
  17. filename = "art/sound/weapons/Crossbow_explosion";
  18. description = AudioDefault3d;
  19. preload = true;
  20. };
  21. //----------------------------------------------------------------------------
  22. // Debris
  23. //----------------------------------------------------------------------------
  24. datablock ParticleData(RocketDebrisTrailParticle)
  25. {
  26. textureName = "art/particles/impact";
  27. dragCoeffiecient = 0;
  28. inheritedVelFactor = 0.0;
  29. constantAcceleration = 0.0;
  30. lifetimeMS = 1200;//1000;
  31. lifetimeVarianceMS = 299;//500;
  32. useInvAlpha = true;//false;
  33. spinSpeed = 1;
  34. spinRandomMin = -300.0;
  35. spinRandomMax = 0;
  36. colors[0] = "1 0.897638 0.795276 0.4";
  37. colors[1] = "0.795276 0.795276 0.795276 0.6";
  38. colors[2] = "0 0 0 0";
  39. sizes[0] = 0.5;//1.0;
  40. sizes[1] = 2;
  41. sizes[2] = 1;//1.0;
  42. times[0] = 0.0;
  43. times[1] = 0.498039;
  44. times[2] = 1.0;
  45. animTexName = "art/particles/impact";
  46. times[3] = "1";
  47. };
  48. datablock ParticleEmitterData(RocketDebrisTrailEmitter)
  49. {
  50. ejectionPeriodMS = 6;//8;
  51. periodVarianceMS = 2;//4;
  52. ejectionVelocity = 1.0;
  53. velocityVariance = 0.5;
  54. thetaMin = 0.0;
  55. thetaMax = 180.0;
  56. phiReferenceVel = 0;
  57. phiVariance = 360;
  58. ejectionoffset = 0.0;//0.3;
  59. particles = "RocketDebrisTrailParticle";
  60. };
  61. datablock DebrisData(RocketDebris)
  62. {
  63. shapeFile = "art/shapes/weapons/shared/rocket.dts";
  64. emitters[0] = RocketDebrisTrailEmitter;
  65. elasticity = 0.5;
  66. friction = 0.5;
  67. numBounces = 1;//2;
  68. bounceVariance = 1;
  69. explodeOnMaxBounce = true;
  70. staticOnMaxBounce = false;
  71. snapOnMaxBounce = false;
  72. minSpinSpeed = 400;
  73. maxSpinSpeed = 800;
  74. render2D = false;
  75. lifetime = 0.25;//0.5;//1;//2;
  76. lifetimeVariance = 0.0;//0.25;//0.5;
  77. velocity = 35;//30;//15;
  78. velocityVariance = 10;//5;
  79. fade = true;
  80. useRadiusMass = true;
  81. baseRadius = 0.3;
  82. gravModifier = 1.0;
  83. terminalVelocity = 45;
  84. ignoreWater = false;
  85. };
  86. // ----------------------------------------------------------------------------
  87. // Splash effects
  88. // ----------------------------------------------------------------------------
  89. datablock ParticleData(RocketSplashMist)
  90. {
  91. dragCoefficient = 1.0;
  92. windCoefficient = 2.0;
  93. gravityCoefficient = 0.3;
  94. inheritedVelFactor = 0.0;
  95. constantAcceleration = 0.0;
  96. lifetimeMS = 600;
  97. lifetimeVarianceMS = 100;
  98. useInvAlpha = false;
  99. spinRandomMin = -90.0;
  100. spinRandomMax = 500.0;
  101. spinSpeed = 1;
  102. textureName = "art/particles/smoke";
  103. colors[0] = "0.7 0.8 1.0 1.0";
  104. colors[1] = "0.7 0.8 1.0 0.5";
  105. colors[2] = "0.7 0.8 1.0 0.0";
  106. sizes[0] = 0.2;//0.5;
  107. sizes[1] = 0.4;//0.5;
  108. sizes[2] = 0.8;
  109. times[0] = 0.0;
  110. times[1] = 0.5;
  111. times[2] = 1.0;
  112. };
  113. datablock ParticleEmitterData(RocketSplashMistEmitter)
  114. {
  115. ejectionPeriodMS = 5;
  116. periodVarianceMS = 0;
  117. ejectionVelocity = 3.0;
  118. velocityVariance = 2.0;
  119. ejectionOffset = 0.15;
  120. thetaMin = 85;
  121. thetaMax = 85;
  122. phiReferenceVel = 0;
  123. phiVariance = 360;
  124. overrideAdvance = false;
  125. lifetimeMS = 250;
  126. particles = "RocketSplashMist";
  127. };
  128. datablock ParticleData(RocketSplashParticle)
  129. {
  130. dragCoefficient = 1;
  131. windCoefficient = 0.9;
  132. gravityCoefficient = 0.3;
  133. inheritedVelFactor = 0.2;
  134. constantAcceleration = -1.4;
  135. lifetimeMS = 600;
  136. lifetimeVarianceMS = 200;
  137. textureName = "art/particles/droplet";
  138. colors[0] = "0.7 0.8 1.0 1.0";
  139. colors[1] = "0.7 0.8 1.0 0.5";
  140. colors[2] = "0.7 0.8 1.0 0.0";
  141. sizes[0] = 0.5;
  142. sizes[1] = 0.25;
  143. sizes[2] = 0.25;
  144. times[0] = 0.0;
  145. times[1] = 0.5;
  146. times[2] = 1.0;
  147. };
  148. datablock ParticleEmitterData(RocketSplashEmitter)
  149. {
  150. ejectionPeriodMS = 4;
  151. periodVarianceMS = 0;
  152. ejectionVelocity = 7.3;
  153. velocityVariance = 2.0;
  154. ejectionOffset = 0.0;
  155. thetaMin = 30;
  156. thetaMax = 80;
  157. phiReferenceVel = 00;
  158. phiVariance = 360;
  159. overrideAdvance = false;
  160. orientParticles = true;
  161. orientOnVelocity = true;
  162. lifetimeMS = 100;
  163. particles = "RocketSplashParticle";
  164. };
  165. datablock ParticleData(RocketSplashRingParticle)
  166. {
  167. textureName = "art/particles/wake";
  168. dragCoefficient = 0.0;
  169. gravityCoefficient = 0.0;
  170. inheritedVelFactor = 0.0;
  171. lifetimeMS = 2500;
  172. lifetimeVarianceMS = 200;
  173. windCoefficient = 0.0;
  174. useInvAlpha = 1;
  175. spinRandomMin = 30.0;
  176. spinRandomMax = 30.0;
  177. spinSpeed = 1;
  178. animateTexture = true;
  179. framesPerSec = 1;
  180. animTexTiling = "2 1";
  181. animTexFrames = "0 1";
  182. colors[0] = "0.7 0.8 1.0 1.0";
  183. colors[1] = "0.7 0.8 1.0 0.5";
  184. colors[2] = "0.7 0.8 1.0 0.0";
  185. sizes[0] = 2.0;
  186. sizes[1] = 4.0;
  187. sizes[2] = 8.0;
  188. times[0] = 0.0;
  189. times[1] = 0.5;
  190. times[2] = 1.0;
  191. };
  192. datablock ParticleEmitterData(RocketSplashRingEmitter)
  193. {
  194. lifetimeMS = "100";
  195. ejectionPeriodMS = 200;
  196. periodVarianceMS = 10;
  197. ejectionVelocity = 0;
  198. velocityVariance = 0;
  199. ejectionOffset = 0;
  200. thetaMin = 89;
  201. thetaMax = 90;
  202. phiReferenceVel = 0;
  203. phiVariance = 1;
  204. alignParticles = 1;
  205. alignDirection = "0 0 1";
  206. particles = "RocketSplashRingParticle";
  207. };
  208. datablock SplashData(RocketSplash)
  209. {
  210. // numSegments = 15;
  211. // ejectionFreq = 15;
  212. // ejectionAngle = 40;
  213. // ringLifetime = 0.5;
  214. // lifetimeMS = 300;
  215. // velocity = 4.0;
  216. // startRadius = 0.0;
  217. // acceleration = -3.0;
  218. // texWrap = 5.0;
  219. // texture = "art/images/particles/splash";
  220. emitter[0] = RocketSplashEmitter;
  221. emitter[1] = RocketSplashMistEmitter;
  222. emitter[2] = RocketSplashRingEmitter;
  223. // colors[0] = "0.7 0.8 1.0 0.0";
  224. // colors[1] = "0.7 0.8 1.0 0.3";
  225. // colors[2] = "0.7 0.8 1.0 0.7";
  226. // colors[3] = "0.7 0.8 1.0 0.0";
  227. //
  228. // times[0] = 0.0;
  229. // times[1] = 0.4;
  230. // times[2] = 0.8;
  231. // times[3] = 1.0;
  232. };
  233. // ----------------------------------------------------------------------------
  234. // Explosion Particle effects
  235. // ----------------------------------------------------------------------------
  236. datablock ParticleData(RocketExpFire)
  237. {
  238. gravityCoefficient = "-0.50061";
  239. lifetimeMS = "400";
  240. lifetimeVarianceMS = "299";
  241. spinSpeed = "1";
  242. spinRandomMin = "-200";
  243. spinRandomMax = "0";
  244. textureName = "art/particles/smoke";
  245. animTexName = "art/particles/smoke";
  246. colors[0] = "1 0.897638 0.795276 1";
  247. colors[1] = "0.795276 0.393701 0 0.6";
  248. colors[2] = "0 0 0 0";
  249. sizes[0] = "1.99902";
  250. sizes[1] = "7.99915";
  251. sizes[2] = "3.99805";
  252. times[1] = "0.392157";
  253. times[2] = "1";
  254. times[3] = "1";
  255. };
  256. datablock ParticleEmitterData(RocketExpFireEmitter)
  257. {
  258. ejectionPeriodMS = "10";
  259. periodVarianceMS = "5";
  260. ejectionVelocity = "3";
  261. velocityVariance = "2";
  262. particles = "RocketExpFire";
  263. blendStyle = "NORMAL";
  264. };
  265. datablock ParticleData(RocketExpFireball)
  266. {
  267. textureName = "art/particles/fireball.png";
  268. lifetimeMS = "300";
  269. lifetimeVarianceMS = "299";
  270. spinSpeed = "1";
  271. spinRandomMin = "-400";
  272. spinRandomMax = "0";
  273. animTexName = "art/particles/fireball.png";
  274. colors[0] = "1 0.897638 0.795276 0.2";
  275. colors[1] = "1 0.496063 0 0.6";
  276. colors[2] = "0.0944882 0.0944882 0.0944882 0";
  277. sizes[0] = "0.997986";
  278. sizes[1] = "1.99902";
  279. sizes[2] = "2.99701";
  280. times[1] = "0.498039";
  281. times[2] = "1";
  282. times[3] = "1";
  283. gravityCoefficient = "-1";
  284. };
  285. datablock ParticleEmitterData(RocketExpFireballEmitter)
  286. {
  287. particles = "RocketExpFireball";
  288. blendStyle = "ADDITIVE";
  289. ejectionPeriodMS = "10";
  290. periodVarianceMS = "5";
  291. ejectionVelocity = "4";
  292. velocityVariance = "2";
  293. ejectionOffset = "2";
  294. thetaMax = "120";
  295. };
  296. datablock ParticleData(RocketExpSmoke)
  297. {
  298. lifetimeMS = 1200;//"1250";
  299. lifetimeVarianceMS = 299;//200;//"250";
  300. textureName = "art/particles/smoke";
  301. animTexName = "art/particles/smoke";
  302. useInvAlpha = "1";
  303. gravityCoefficient = "-0.100122";
  304. spinSpeed = "1";
  305. spinRandomMin = "-100";
  306. spinRandomMax = "0";
  307. colors[0] = "0.897638 0.795276 0.692913 0.4";//"0.192157 0.192157 0.192157 0.0944882";
  308. colors[1] = "0.897638 0.897638 0.897638 0.8";//"0.454902 0.454902 0.454902 0.897638";
  309. colors[2] = "0.4 0.4 0.4 0";//"1 1 1 0";
  310. sizes[0] = "1.99597";
  311. sizes[1] = "3.99805";
  312. sizes[2] = "7.99915";
  313. times[1] = "0.494118";
  314. times[2] = "1";
  315. times[3] = "1";
  316. };
  317. datablock ParticleEmitterData(RocketExpSmokeEmitter)
  318. {
  319. ejectionPeriodMS = "15";
  320. periodVarianceMS = "5";
  321. //ejectionOffset = "1";
  322. thetaMax = "180";
  323. particles = "RocketExpSmoke";
  324. blendStyle = "NORMAL";
  325. };
  326. datablock ParticleData(RocketExpSparks)
  327. {
  328. textureName = "art/particles/droplet.png";
  329. lifetimeMS = "100";
  330. lifetimeVarianceMS = "50";
  331. animTexName = "art/particles/droplet.png";
  332. inheritedVelFactor = "0.391389";
  333. sizes[0] = "1.99902";
  334. sizes[1] = "2.49954";
  335. sizes[2] = "0.997986";
  336. colors[0] = "1.0 0.9 0.8 0.2";
  337. colors[1] = "1.0 0.9 0.8 0.8";
  338. colors[2] = "0.8 0.4 0.0 0.0";
  339. times[0] = "0";
  340. times[1] = "0.34902";
  341. times[2] = "1";
  342. times[3] = "1";
  343. };
  344. datablock ParticleEmitterData(RocketExpSparksEmitter)
  345. {
  346. particles = "RocketExpSparks";
  347. blendStyle = "NORMAL";
  348. ejectionPeriodMS = "10";
  349. periodVarianceMS = "5";
  350. ejectionVelocity = "60";
  351. velocityVariance = "10";
  352. thetaMax = "120";
  353. phiReferenceVel = 0;
  354. phiVariance = "360";
  355. ejectionOffset = "0";
  356. orientParticles = true;
  357. orientOnVelocity = true;
  358. };
  359. datablock ParticleData(RocketExpSubFireParticles)
  360. {
  361. textureName = "art/particles/fireball.png";
  362. gravityCoefficient = "-0.202686";
  363. lifetimeMS = "400";
  364. lifetimeVarianceMS = "299";
  365. spinSpeed = "1";
  366. spinRandomMin = "-200";
  367. spinRandomMax = "0";
  368. animTexName = "art/particles/fireball.png";
  369. colors[0] = "1 0.897638 0.795276 0.2";
  370. colors[1] = "1 0.496063 0 1";
  371. colors[2] = "0.0944882 0.0944882 0.0944882 0";
  372. sizes[0] = "0.997986";
  373. sizes[1] = "1.99902";
  374. sizes[2] = "2.99701";
  375. times[1] = "0.498039";
  376. times[2] = "1";
  377. times[3] = "1";
  378. };
  379. datablock ParticleEmitterData(RocketExpSubFireEmitter)
  380. {
  381. particles = "RocketExpSubFireParticles";
  382. blendStyle = "ADDITIVE";
  383. ejectionPeriodMS = "10";
  384. periodVarianceMS = "5";
  385. ejectionVelocity = "4";
  386. velocityVariance = "2";
  387. thetaMax = "120";
  388. };
  389. datablock ParticleData(RocketExpSubSmoke)
  390. {
  391. textureName = "art/particles/smoke";
  392. gravityCoefficient = "-0.40293";
  393. lifetimeMS = "800";
  394. lifetimeVarianceMS = "299";
  395. spinSpeed = "1";
  396. spinRandomMin = "-200";
  397. spinRandomMax = "0";
  398. animTexName = "art/particles/smoke";
  399. colors[0] = "0.4 0.35 0.3 0.393701";
  400. colors[1] = "0.45 0.45 0.45 0.795276";
  401. colors[2] = "0.4 0.4 0.4 0";
  402. sizes[0] = "1.99902";
  403. sizes[1] = "3.99805";
  404. sizes[2] = "7.99915";
  405. times[1] = "0.4";
  406. times[2] = "1";
  407. times[3] = "1";
  408. };
  409. datablock ParticleEmitterData(RocketExpSubSmokeEmitter)
  410. {
  411. particles = "RocketExpSubSmoke";
  412. ejectionPeriodMS = "30";
  413. periodVarianceMS = "10";
  414. ejectionVelocity = "2";
  415. velocityVariance = "1";
  416. ejectionOffset = 1;//"2";
  417. blendStyle = "NORMAL";
  418. };
  419. // ----------------------------------------------------------------------------
  420. // Dry/Air Explosion Objects
  421. // ----------------------------------------------------------------------------
  422. datablock ExplosionData(RocketSubExplosion)
  423. {
  424. lifeTimeMS = 100;
  425. offset = 0.4;
  426. emitter[0] = RocketExpSubFireEmitter;
  427. emitter[1] = RocketExpSubSmokeEmitter;
  428. };
  429. datablock ExplosionData(RocketLauncherExplosion)
  430. {
  431. soundProfile = RocketLauncherExplosionSound;
  432. lifeTimeMS = 200; // I want a quick bang and dissipation, not a slow burn-out
  433. // Volume particles
  434. particleEmitter = RocketExpSmokeEmitter;
  435. particleDensity = 10;//20;
  436. particleRadius = 1;//2;
  437. // Point emission
  438. emitter[0] = RocketExpFireEmitter;
  439. emitter[1] = RocketExpSparksEmitter;
  440. emitter[2] = RocketExpSparksEmitter;
  441. emitter[3] = RocketExpFireballEmitter;
  442. // Sub explosion objects
  443. subExplosion[0] = RocketSubExplosion;
  444. // Camera Shaking
  445. shakeCamera = true;
  446. camShakeFreq = "10.0 11.0 9.0";
  447. camShakeAmp = "15.0 15.0 15.0";
  448. camShakeDuration = 1.5;
  449. camShakeRadius = 20;
  450. // Exploding debris
  451. debris = RocketDebris;
  452. debrisThetaMin = 0;//10;
  453. debrisThetaMax = 90;//80;
  454. debrisNum = 5;
  455. debrisNumVariance = 2;
  456. debrisVelocity = 1;//2;
  457. debrisVelocityVariance = 0.2;//0.5;
  458. lightStartRadius = 6.0;
  459. lightEndRadius = 0.0;
  460. lightStartColor = "1.0 0.7 0.2";
  461. lightEndColor = "0.9 0.7 0.0";
  462. lightStartBrightness = 2.5;
  463. lightEndBrightness = 0.0;
  464. lightNormalOffset = 3.0;
  465. };