Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.84 KB | None | 0 0
  1. #include "basicdefines_A3.hpp"
  2. class DefaultEventhandlers;
  3.  
  4. #include "CfgPatches.hpp"
  5.  
  6. class WeaponFireGun;
  7. class WeaponCloudsGun;
  8. class WeaponFireMGun;
  9. class WeaponCloudsMGun;
  10.  
  11. class CfgVehicles
  12. {
  13. class Car;
  14. class Car_F: Car
  15. {
  16. class HitPoints /// we want to use hitpoints predefined for all cars
  17. {
  18. class HitLFWheel;
  19. class HitLF2Wheel;
  20. class HitRFWheel;
  21. class HitRF2Wheel;
  22. class HitBody;
  23. class HitGlass1;
  24. class HitGlass2;
  25. class HitGlass3;
  26. class HitGlass4;
  27. };
  28. class EventHandlers;
  29. };
  30.  
  31. class Test_Car_01_base_F: Car_F
  32. {
  33. model = "\TestCar\Test_Car_01"; /// simple path to model
  34. picture = "\A3\Weapons_F\Data\placeholder_co.paa"; /// just some icon in command bar
  35. Icon = "\A3\Weapons_F\Data\placeholder_co.paa"; /// icon in map
  36.  
  37. displayName = "Test Car"; /// displayed in Editor
  38.  
  39. terrainCoef = 6.5; /// different surface affects this car more, stick to tarmac
  40. turnCoef = 2.5; /// should match the wheel turn radius
  41. precision = 10; /// how much freedom has the AI for its internal waypoints - lower number means more precise but slower approach to way
  42. brakeDistance = 3.0; /// how many internal waypoints should the AI plan braking in advance
  43. acceleration = 15; /// how fast acceleration does the AI think the car has
  44.  
  45. fireResistance = 5; /// lesser protection against fire than tanks
  46. armor = 32; /// just some protection against missiles, collisions and explosions
  47. cost = 50000; /// how likely is the enemy going to target this vehicle
  48.  
  49. transportMaxBackpacks = 3; /// just some backpacks fit the trunk by default
  50. transportSoldier = 3; /// number of cargo except driver
  51.  
  52. /// some values from parent class to show how to set them up
  53. wheelDamageRadiusCoef = 0.9; /// for precision tweaking of damaged wheel size
  54. wheelDestroyRadiusCoef = 0.4; /// for tweaking of rims size to fit ground
  55. maxFordingDepth = 0.5; /// how high water would damage the engine of the car
  56. waterResistance = 1; /// if the depth of water is bigger than maxFordingDepth it starts to damage the engine after this time
  57. crewCrashProtection = 0.25; /// multiplier of damage to crew of the vehicle => low number means better protection
  58. driverLeftHandAnimName = "drivewheel"; /// according to what bone in model of car does hand move
  59. driverRightHandAnimName = "drivewheel"; /// beware, non-existent bones may cause game crashes (even if the bones are hidden during play)
  60.  
  61. class TransportItems /// some first aid kits in trunk according to safety regulations
  62. {
  63. item_xx(FirstAidKit,4);
  64. };
  65.  
  66. class Turrets{}; /// doesn't have any gunner nor commander
  67. class HitPoints: HitPoints
  68. {
  69. class HitLFWheel: HitLFWheel {armor=0.125; passThrough=0;}; /// it is easier to destroy wheels than hull of the vehicle
  70. class HitLF2Wheel: HitLF2Wheel {armor=0.125; passThrough=0;};
  71.  
  72. class HitRFWheel: HitRFWheel {armor=0.125; passThrough=0;};
  73. class HitRF2Wheel: HitRF2Wheel {armor=0.125; passThrough=0;};
  74.  
  75. class HitFuel {armor=0.50; material=-1; name="fueltank"; visual=""; passThrough=0.2;}; /// correct points for fuel tank, some of the damage is aFRLied to the whole
  76. class HitEngine {armor=0.50; material=-1; name="engine"; visual=""; passThrough=0.2;};
  77. class HitBody: HitBody {name = "body"; visual="camo1"; passThrough=1;}; /// all damage to the hull is aFRLied to total damage
  78.  
  79. class HitGlass1: HitGlass1 {armor=0.25;}; /// it is pretty easy to puncture the glass but not so easy to remove it
  80. class HitGlass2: HitGlass2 {armor=0.25;};
  81. class HitGlass3: HitGlass3 {armor=0.25;};
  82. class HitGlass4: HitGlass4 {armor=0.25;};
  83. };
  84.  
  85. driverAction = driver_offroad01; /// what action is going the driver take inside the vehicle. Non-existent action makes the vehicle inaccessible
  86. cargoAction[] = {passenger_low01, passenger_generic01_leanleft, passenger_generic01_foldhands}; /// the same of all the crew
  87. getInAction = GetInLow; /// how does driver look while getting in
  88. getOutAction = GetOutLow; /// and out
  89. cargoGetInAction[] = {"GetInLow"}; /// and the same for the rest, if the array has fewer members than the count of crew, the last one is used for the rest
  90. cargoGetOutAction[] = {"GetOutLow"}; /// that means all use the same in this case
  91.  
  92. hiddenSelections[] = {"gyro_1", "gyro_2"};
  93.  
  94. #include "sounds.hpp" /// sounds are in a separate file to make this one simple
  95. #include "pip.hpp" /// PiPs are in a separate file to make this one simple
  96. #include "physx.hpp" /// PhysX settings are in a separate file to make this one simple
  97.  
  98. class PlayerSteeringCoefficients /// steering sensitivity configuration
  99. {
  100. turnIncreaseConst = 0.3; // basic sensitivity value, higher value = faster steering
  101. turnIncreaseLinear = 1.0; // higher value means less sensitive steering in higher speed, more sensitive in lower speeds
  102. turnIncreaseTime = 1.0; // higher value means smoother steering around the center and more sensitive when the actual steering angle gets closer to the max. steering angle
  103.  
  104. turnDecreaseConst = 5.0; // basic caster effect value, higher value = the faster the wheels align in the direction of travel
  105. turnDecreaseLinear = 3.0; // higher value means faster wheel re-centering in higher speed, slower in lower speeds
  106. turnDecreaseTime = 0.0; // higher value means stronger caster effect at the max. steering angle and weaker once the wheels are closer to centered position
  107.  
  108. maxTurnHundred = 0.7; // coefficient of the maximum turning angle @ 100km/h; limit goes linearly to the default max. turn. angle @ 0km/h
  109. };
  110.  
  111. /// memory points where do tracks of the wheel appear
  112. // front left track, left offset
  113. memoryPointTrackFLL = "TrackFLL";
  114. // front left track, right offset
  115. memoryPointTrackFLR = "TrackFLR";
  116. // back left track, left offset
  117. memoryPointTrackBLL = "TrackBLL";
  118. // back left track, right offset
  119. memoryPointTrackBLR = "TrackBLR";
  120. // front right track, left offset
  121. memoryPointTrackFRL = "TrackFRL";
  122. // front right track, right offset
  123. memoryPointTrackFRR = "TrackFRR";
  124. // back right track, left offset
  125. memoryPointTrackBRL = "TrackBRL";
  126. // back right track, right offset
  127. memoryPointTrackBRR = "TrackBRR";
  128.  
  129. class Damage /// damage changes material in specific places (visual in hitPoint)
  130. {
  131. tex[]={};
  132. mat[]=
  133. {
  134. "A3\data_f\glass_veh_int.rvmat", /// material mapped in model
  135. "A3\data_f\Glass_veh_damage.rvmat", /// changes to this one once damage of the part reaches 0.5
  136. "A3\data_f\Glass_veh_damage.rvmat", /// changes to this one once damage of the part reaches 1
  137.  
  138. "A3\data_f\glass_veh.rvmat", /// another material
  139. "A3\data_f\Glass_veh_damage.rvmat", /// changes into different ones
  140. "A3\data_f\Glass_veh_damage.rvmat"
  141. };
  142. };
  143.  
  144. class Exhausts /// specific exhaust effects for the car
  145. {
  146. class Exhaust1 /// the car has two exhausts - each on one side
  147. {
  148. position = "exhaust"; /// name of initial memory point
  149. direction = "exhaust_dir"; /// name of memory point for exhaust direction
  150. effect = "ExhaustsEffect"; /// what particle effect is it going to use
  151. };
  152.  
  153. class Exhaust2
  154. {
  155. position = "exhaust2_pos";
  156. direction = "exhaust2_dir";
  157. effect = "ExhaustsEffect";
  158. };
  159. };
  160.  
  161. class Reflectors /// only front lights are considered to be reflectors to save CPU
  162. {
  163. class LightCarHeadL01 /// lights on each side consist of two bulbs with different flares
  164. {
  165. color[] = {1900, 1800, 1700}; /// approximate colour of standard lights
  166. ambient[] = {5, 5, 5}; /// nearly a white one
  167. position = "LightCarHeadL01"; /// memory point for start of the light and flare
  168. direction = "LightCarHeadL01_end"; /// memory point for the light direction
  169. hitpoint = "Light_L"; /// point(s) in hitpoint lod for the light (hitPoints are created by engine)
  170. selection = "Light_L"; /// selection for artificial glow around the bulb, not much used any more
  171. size = 1; /// size of the light point seen from distance
  172. innerAngle = 100; /// angle of full light
  173. outerAngle = 179; /// angle of some light
  174. coneFadeCoef = 10; /// attenuation of light between the above angles
  175. intensity = 1; /// strength of the light
  176. useFlare = true; /// does the light use flare?
  177. dayLight = false; /// switching light off during day saves CPU a lot
  178. flareSize = 1.0; /// how big is the flare
  179.  
  180. class Attenuation
  181. {
  182. start = 1.0;
  183. constant = 0;
  184. linear = 0;
  185. quadratic = 0.25;
  186. hardLimitStart = 30; /// it is good to have some limit otherwise the light would shine to infinite distance
  187. hardLimitEnd = 60; /// this allows adding more lights into scene
  188. };
  189. };
  190.  
  191. class LightCarHeadL02: LightCarHeadL01
  192. {
  193. position = "LightCarHeadL02";
  194. direction = "LightCarHeadL02_end";
  195. FlareSize = 0.5; /// side bulbs aren't that strong
  196. };
  197.  
  198. class LightCarHeadR01: LightCarHeadL01
  199. {
  200. position = "LightCarHeadR01";
  201. direction = "LightCarHeadR01_end";
  202. hitpoint = "Light_R";
  203. selection = "Light_R";
  204. };
  205.  
  206. class LightCarHeadR02: LightCarHeadR01
  207. {
  208. position = "LightCarHeadR02";
  209. direction = "LightCarHeadR02_end";
  210. FlareSize = 0.5;
  211. };
  212. };
  213.  
  214. aggregateReflectors[] = {{"LightCarHeadL01", "LightCarHeadL02"}, {"LightCarHeadR01", "LightCarHeadR02"}}; /// aggregating reflectors helps the engine a lot
  215. /// it might be even good to aggregate all lights into one source as it is done for most of the cars
  216.  
  217. class EventHandlers: EventHandlers
  218. {
  219. // (_this select 0): the vehicle
  220. // """" Random texture source (pick one from the property textureList[])
  221. // []: randomize the animation sources (accordingly to the property animationList[])
  222. // false: Don't change the mass even if an animation source has a defined mass
  223. init="if (local (_this select 0)) then {[(_this select 0), """", [], false] call bis_fnc_initVehicle;};";
  224. };
  225.  
  226. // Must be kept as fail-safe in case of issue with the function
  227. hiddenSelectionsTextures[]={"\A3\Weapons_F\Data\placeholder_co.paa"}; /// we could use any texture to cover the car
  228.  
  229. // Definition of texture sources (skins), used for the VhC (Vehicle customization)
  230. // Also, because the Garage uses the VhC, it will make them available from the garage
  231. class textureSources
  232. {
  233. class red // Source class
  234. {
  235. displayName="Red"; // name displayed, among other, from the garage
  236. author=$STR_A3_Bohemia_Interactive; // Author of the skin
  237. textures[]=// List of textures, in the same order as the hiddenSelections definition
  238. {
  239. "#(rgb,8,8,3)color(1,0,0,1)" // This is procedural texture, can be useful to set placeholder
  240. };
  241. factions[]=// This source should be available only for these factions
  242. {
  243. "OPF_F", "OPF_G_F" // Side Opfor
  244. };
  245. };
  246. class blue
  247. {
  248. displayName="BBBBLue";
  249. author=$STR_A3_Bohemia_Interactive;
  250. textures[]=
  251. {
  252. "#(rgb,8,8,3)color(0,0,1,1)"
  253. };
  254. factions[]=
  255. {
  256. "BLU_F", "BLU_G_F" // Side Blufor
  257. };
  258. };
  259. class green
  260. {
  261. displayName="Green";
  262. author=$STR_A3_Bohemia_Interactive;
  263. textures[]=
  264. {
  265. "#(rgb,8,8,3)color(0,1,0,1)"
  266. };
  267. factions[]=
  268. {
  269. "IND_F", "IND_G_F" // Side independent
  270. };
  271. };
  272. class yellow
  273. {
  274. displayName="Yellow power";
  275. author=$STR_A3_Bohemia_Interactive;
  276. textures[]=
  277. {
  278. "#(rgb,8,8,3)color(0,1,0,1)"
  279. };
  280. factions[]=
  281. {
  282. // Guerilla only
  283. "BLU_G_F",
  284. "OPF_G_F",
  285. "IND_G_F"
  286. };
  287. };
  288. class white
  289. {
  290. displayName="White is white";
  291. author="Another name";
  292. textures[]=
  293. {
  294. "#(rgb,8,8,3)color(1,1,1,1)"
  295. };
  296. factions[]=
  297. {
  298. "CIV_F" // side civilian
  299. };
  300. };
  301. class black
  302. {
  303. displayName="Dark side";
  304. author="Tom_48_97";
  305. textures[]=
  306. {
  307. "#(rgb,8,8,3)color(0,0,0,1)"
  308. };
  309. factions[]= {}; // Should be available for every factions
  310. };
  311. };
  312. // [_textureSourceClass1, _probability1, _textureSourceClass2, _probability2, ...]
  313. // Default behavior of the VhC is to select one of these sources, with a weighted random
  314. textureList[]=
  315. {
  316. "red", 1,
  317. "green", __EVAL(1/3), // You can also use EVAL to evaluate an expression
  318. "blue", 1,
  319. "black", 1
  320. // You can noticed that the white source is missing, therefore, it won't be part of the random
  321. };
  322.  
  323. class MFD /// Clocks on the car board
  324. {
  325. class ClockHUD
  326. {
  327. #include "cfgHUD.hpp"
  328. };
  329. };
  330. };
  331. class Test_Car_Alt_base_F: Test_Car_01_base_F
  332. {
  333. hiddenSelections[] = {"camo1","camo2","camo3"}; ///we want to allow changing the color of this selection
  334. hiddenSelectionsTextures[]=
  335. {
  336. "#(rgb,8,8,3)color(1,0,0,1)",
  337. "#(rgb,8,8,3)color(0,1,0,1)",
  338. "#(rgb,8,8,3)color(0,0,1,1)"
  339. };
  340. class textureSources
  341. {
  342. class RedGreenBlue
  343. {
  344. displayname="Red Green Blue";
  345. author="You don't want to know";
  346. textures[]=
  347. {
  348. "#(rgb,8,8,3)color(1,0,0,1)",
  349. "#(rgb,8,8,3)color(0,1,0,1)",
  350. "#(rgb,8,8,3)color(0,0,1,1)"
  351. };
  352. factions[]={};
  353. };
  354. class BlueGreenRed
  355. {
  356. displayname="Blue Green Red";
  357. author="You don't want to know";
  358. textures[]=
  359. {
  360. "#(rgb,8,8,3)color(0,0,1,1)",
  361. "#(rgb,8,8,3)color(0,1,0,1)",
  362. "#(rgb,8,8,3)color(1,0,0,1)"
  363. };
  364. factions[]={};
  365. };
  366. };
  367. };
  368. // Derivate from the base class
  369. class C_Test_Car_01_F: Test_Car_01_base_F /// some class that is going to be visible in editor
  370. {
  371. scope = 2; /// makes the car visible in editor
  372. scopeCurator=2; // scope 2 means it's available in Zeus mode (0 means hidden)
  373. crew = "C_man_1"; /// we need someone to fit into the car
  374. side = 3; /// civilian car should be on civilian side
  375. faction = CIV_F; /// and with civilian faction
  376. };
  377. // Derivate from the base class
  378. class C_Test_Car_01_Black_F: Test_Car_01_base_F /// some class that is going to be visible in editor
  379. {
  380. forceInGarage=1; // This will force the garage to display this vehicle, otherwise it won't because it shares the same p3d as the previous
  381. displayName="Test Car (Black)";
  382. scope=2; /// makes the car visible in editor
  383. scopeCurator=2; // scope 2 means it's available in Zeus mode (0 means hidden)
  384. crew="C_man_1"; /// we need someone to fit into the car
  385. side=3; /// civilian car should be on civilian side
  386. faction = CIV_F; /// and with civilian faction
  387. // the texture source used will be the green one, whatever it probability because it's the only one defined here
  388. textureList[]=
  389. {
  390. "black", 1
  391. };
  392. };
  393. // Derivate from the base class
  394. class C_test_Car_01_anotherVariant_F: Test_Car_01_base_F
  395. {
  396. forceInGarage=0; // 0 has no effect at all
  397. displayName="Test Car (black or white)";
  398. scope=2;
  399. scopeCurator=0; // It isn't shown in curator UI
  400. crew="C_man_1";
  401. side=3;
  402. faction = CIV_F;
  403. // this can be black or white
  404. textureList[]=
  405. {
  406. "black", 0.75,
  407. "white", 0.5
  408. };
  409. };
  410. // This car won't be available from the editor but its class name can be used with the VhC function
  411. // E.g. [MyTestCar, "C_test_Car_01_white_F"] call bis_fnc_initVehicle;
  412. class C_test_Car_01_white_F: Test_Car_01_base_F
  413. {
  414. forceInGarage=0; // 0 has no effect at all
  415. displayName="Test Car (white)";
  416. scope=1;
  417. scopeCurator=0; // It isn't shown in curator UI
  418. crew="C_man_1";
  419. side=3;
  420. faction = CIV_F;
  421. // this can be black or white
  422. textureList[]=
  423. {
  424. "white", 0.5
  425. };
  426. };
  427. // Other delivery of the car with differents hidden selections
  428. class C_Test_Car_01_alt_F: Test_Car_Alt_base_F
  429. {
  430. forceInGarage=1;
  431. displayName="Test Car (RGB)";
  432. scope = 2;
  433. scopeCurator=2;
  434. crew = "C_man_1";
  435. side = 3;
  436. faction = CIV_F;
  437. textureList[]= {"RedGreenBlue",1};
  438. };
  439. class C_Test_Car_01_alt_V2_F: C_Test_Car_01_alt_F
  440. {
  441. displayName="Test Car (BGR)";
  442. textureList[]= {"BlueGreenRed",1};
  443. };
  444.  
  445. class UserActions {
  446. class gyro_activation {
  447. displayName = "Activer le gyrophare";
  448. displayNameDefault = "Activer le gyrophare";
  449. position = "drivewheel_axis";
  450. radius = 1;
  451. onlyForPlayer = 1;
  452. condition = "this animationPhase ""gyro_1"" < 0.5 AND Alive(this) AND driver this == player";
  453. statement = "this animate [""gyro_1"",1];";
  454. shortcut = "LeanLeft";
  455. showWindow = 0;
  456. };
  457.  
  458. class gyro_arret : gyro_activation {
  459. displayName = "Desactiver le gyrophare";
  460. displayNameDefault = "Desactiver le gyrophare";
  461. position = "drivewheel_axis";
  462. radius = 1;
  463. onlyForPlayer = 1;
  464. condition = "this animationPhase ""gyro_1" > 0.5 AND Alive(this) AND driver this == player";
  465. statement = "this animate [""gyro_1"",0];";
  466. shortcut = "LeanLeft";
  467. showWindow = 0;
  468. };
  469. };
  470. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement