Guest User

Script to attach parts does not work properly

a guest
Jun 1st, 2016
195
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ////////////////////////////////////////////////////////////////////
  2. //DeRap: Produced from mikero's Dos Tools Dll version 5.24
  3. //Produced on Thu Oct 08 11:11:28 2015 : Created on Thu Oct 08 11:11:28 2015
  4. //http://dev-heaven.net/projects/list_files/mikero-pbodll
  5. ////////////////////////////////////////////////////////////////////
  6.  
  7. #include "basicdefines_A3.hpp"
  8.  
  9. class CfgPatches
  10. {
  11. class MEA_Ship_NAE
  12. {
  13. units[]= {"MEA_NAE_A12"}; //MEA_Ship_NAEA12
  14. weapons[]= {};
  15. requiredVersion=0.1;
  16. requiredAddons[]= {"A3_Boat_F","A3_Boat_F_Civilian_Boat"};
  17. };
  18. };
  19. class cfgFactionClasses
  20. {
  21. class MEA_Military
  22. {
  23. displayName = "BRA";
  24. priority = 2;
  25. side = 1;
  26. icon = "\MEA_Military\Data\icon_side\mea_icon.paa";
  27. };
  28. };
  29. class cfgVehicleClasses
  30. {
  31. class MEA_Forces_Ship
  32. {
  33. displayName = "Ships";
  34. };
  35. };
  36. class CfgMods
  37. {
  38. class Brazilian_Armed_Forces
  39. {
  40. dir = "Brazilian_Armed_Forces";
  41. name = "Brazilian Armed Forces";
  42. picture = "mea_military\data\mod_mea_ca_small.paa"; ///logo_ca.paa
  43. logo = "mea_military\data\mod_mea_ca_small.paa"; ///icon_ca.paa
  44. logoOver = "mea_military\data\mod_mea_ca_small.paa"; ///iconOver_ca.paa
  45. tooltip = "BAF";
  46. //action = "";
  47. //overview = "";
  48. };
  49. };
  50. class CfgVehicles
  51. {
  52. class Ship;
  53. class StaticShip: Ship ///Ship_F or StaticShip
  54. {
  55. class ViewPilot;
  56. class AnimationSources;
  57. class Eventhandlers;
  58. };
  59. class MEA_Ship_NAEA12_base: StaticShip ///Ship_F or StaticShip
  60. {
  61. displayName = "NAe Sao Paulo" /// displayed in Editor
  62. model = "\mea_nae\mea_nae_a12";/// simple path to model
  63. picture = "\A3\boat_f\Boat_Armed_01\data\ui\Boat_Armed_01_minigun.paa";
  64. Icon = "\A3\boat_f\Boat_Armed_01\data\ui\map_boat_armed_01_minigun.paa";
  65. cost = 20000; /// how likely is the enemy going to target this vehicle
  66. accuracy = 0.50; /// knowledge required to recognize this type of target
  67.  
  68. class HitPoints /// define the sturdiness of the ship
  69. {
  70. class HitEngine {armor = 1.2; material = 60; name = "engine"; visual = ""; passThrough = 1; radius = 0.1;}; /// radius causes bigger damage but on a more precise hit
  71. class HitEngine1: HitEngine {armor=0.2; material=-1; visual=""; passThrough=1; explosionSHielding=2; name="engine1"; convexComponent="engine1";};
  72. class HitEngine2: HitEngine1 {armor=0.2; material=-1; visual=""; passThrough=1; explosionSHielding=2; name="engine2"; convexComponent="engine2";};
  73. class HitHull {armor = 1; material = 50; name = "karoserie"; visual = "zbytek"; passThrough = 1; explosionShielding = 1;};
  74. };
  75.  
  76. leftEngineEffect = "LEngEffectsSmall"; /// Particle effect class for engine particles
  77. rightEngineEffect = "REngEffectsSmall";
  78.  
  79. simulation = "shipx"; /// all ships should have this simulation
  80. maxSpeed = 80; /// top speed of the vehicle
  81. overSpeedBrakeCoef = 0.8; /// how much does the vehicle itself brake in case it goes faster than maxSpeed
  82. enginePower = 235; /// power of engine in kW
  83. engineShiftY = 0.1; /// relative virtual position of engine for PhysX, affects lateral ship slope during turns
  84. waterLeakiness = 1.0; /// amount of litres per second that leaks into ship if under water, destroyed or turned upside down
  85. turnCoef = 0.25; /// how well is the ship able to turn
  86. thrustDelay = 2; /// initial delay to cause lesser slip when on 1st gear - thrust goes from zero to full in this time
  87. waterLinearDampingCoefY = 2; /// affect how fast does the ship go through waves down - higher values make it drift more on top of waves
  88. waterLinearDampingCoefX = 2.0; /// affects sliding of the ship in turns
  89. waterAngularDampingCoef = 1.2; /// increase this for smoother movement, but beware too high values
  90. waterResistanceCoef = 0.015; /// how much does water slow the ship down
  91. rudderForceCoef = 0.100000; /// increase this to gain more turning on lower speeds
  92. rudderForceCoefAtMaxSpeed = 0.003000; /// increase this to gain more turning on higher speeds
  93. idleRpm = 200; /// revolutions per minute at which the engine idles
  94. redRpm = 1200; /// maximum revolutions per minute of the engine
  95.  
  96. class complexGearbox
  97. {
  98. GearboxRatios[] = {
  99. "R1",-0.782,
  100. "N",0,
  101. "D1",2.0,
  102. "D2",1.85,
  103. "D3",1.75
  104. };
  105. TransmissionRatios[] = {"High",1.0}; // Optional: defines transmission ratios (for example, High and Low range as commonly found in offroad vehicles)
  106. gearBoxMode = "auto"; //gearbox can be of type: full-auto (only requires 'W' or 'S'), auto (requires shift between drive and reverse), semi-auto, manual
  107. moveOffGear = 1; // defines what gear an automatic or semi-automatic gearbox will move off from stationary in. 1 by default.
  108. driveString = "D"; // string to display in the HUD for forward gears.
  109. neutralString = "N"; // string to display in the HUD for neutral gear.
  110. reverseString = "R"; // string to display in the HUD for reverse gears.
  111. };
  112.  
  113. brakeDistance = 3; /// how many internal waypoints should the AI plan braking in advance
  114.  
  115. driverAction = driver_mid01; /// what action is going the driver take inside the vehicle. Non-existent action makes the vehicle inaccessible
  116. driverLeftHandAnimName = "drivingWheel"; /// according to what bone in model of car does hand move
  117. driverRightHandAnimName = "drivingWheel"; /// according to what bone in model of car does hand move
  118. cargoAction[] = {passenger_low01};/// the same of all the crew
  119. cargoIsCoDriver[] = {false}; /// there is no special co-driver entry point on the boat
  120. ejectDeadDriver = false; /// use this if you don't have proper dead pose for the driver, it will eject him from boat if he dies
  121. transportSoldier = 2; /// number of cargo except driver
  122. class TransportItems /// some first aid kits in trunk according to safety regulations
  123. {
  124. item_xx(FirstAidKit,30);
  125. };
  126.  
  127. armor = 10; /// just some protection against missiles, collisions and explosions
  128. damageResistance = 0.00882; /// for AI if it is worth to be shoot at
  129.  
  130. class Turrets {}; /// this vehicle doesn't have any turret, we need to make the class empty
  131.  
  132. #include "sounds.hpp" /// sounds are included from separate file to not clutter the rest of file
  133.  
  134. class Reflectors {}; /// there are no reflectors on this boat, check Test_Car_01 for some examples
  135. class Damage /// damage changes material in specific places (visual in hitPoint)
  136. {
  137. tex[] = {};
  138. mat[] = {
  139. "A3\boat_f_gamma\Boat_Civil_01\data\Boat_Civil_01_ext.rvmat", /// material mapped in model
  140. "A3\boat_f_gamma\Boat_Civil_01\data\Boat_Civil_01_ext_damage.rvmat", /// changes to this one once damage of the part reaches 0.5
  141. "A3\boat_f_gamma\Boat_Civil_01\data\Boat_Civil_01_ext_destruct.rvmat" /// changes to this one once damage of the part reaches 1
  142. };
  143. };
  144.  
  145. extCameraPosition[] = {0,1.0,-8.0}; /// provides offset of external camera in {side, height, to front} format
  146. leftFastWaterEffect = "LFastWaterEffects"; /// defines what class of water effect is going to be used while sailing fast
  147. rightFastWaterEffect = "RFastWaterEffects"; /// defines what class of water effect is going to be used while sailing fast
  148. waterEffectSpeed = 5; /// limit of displaying the standard water effect
  149. engineEffectSpeed = 5; /// limit of displaying the engine effect
  150. waterFastEffectSpeed = 28; /// limit where the standard water effect changes to the fast sailing one
  151. class Eventhandlers: Eventhandlers /// specific event handlers to handle variants - by default are all shown, event handlers hide them
  152. {
  153. init="if (local (_this select 0)) then {[(_this select 0), """", [], nil] call bis_fnc_initVehicle;};"; // Run the VhC function to be sure to set the animation sources and textures accordingly to the properties animationList and textureList
  154. killed = "if (local (_this select 0)) then {[(_this select 0), nil, [], false] call bis_fnc_initVehicle;};"; // Run the VhC to set the animation sources but not the texture source "nil"
  155. };
  156. /*
  157. hiddenSelections[] = {"camo1", "camo2"}; /// we want to allow changing of colours, this defines on what selection are the textures used
  158. hiddenSelectionsTextures[] =
  159. { /// and here are the textures, in the same order as the hidden selections
  160. "\a3\boat_f_gamma\Boat_Civil_01\data\boat_civil_01_ext_co.paa",
  161. "\a3\boat_f_gamma\Boat_Civil_01\data\boat_civil_01_int_co.paa"
  162. };
  163. */
  164. class AnimationSources: AnimationSources /// hides all the proxies and beacons, to be sure
  165. {
  166. class Proxy /// name of animation source in model.cfg
  167. {
  168. source = "user"; /// what is the animation source based on, this time it is user input
  169. animPeriod = 1; /// how long does it take to switch from 0 to 1 (or vice versa) if used by script
  170. initPhase = 0; /// what is the value of animation source to start with
  171. };
  172.  
  173. class Beacons
  174. {
  175. source = "user";
  176. animPeriod = 1;
  177. initPhase = 0;
  178. };
  179.  
  180. class hidePolice
  181. {
  182. displayName = "Hide police light bar";
  183. source = "user";
  184. initPhase = 1;
  185. author = $STR_A3_Bohemia_Interactive;
  186. };
  187. class HideRescueSigns
  188. {
  189. displayName = "Hide rescue signs"; // name of the animation / element (displayed in the Virtual Garage)
  190. author = $STR_A3_Bohemia_Interactive; // Author of the animation source or proxy
  191. source = "user";
  192. initPhase = 1;
  193. forceAnimatePhase = 0; // if forceAnimatePhase is equal to the phase of this animation sources, every sources from forceAnimate will be changed with their given phase
  194. forceAnimate[] = {"HidePoliceSigns", 1}; // animationSource1, phase, animationSource2, phase... No probabilities here, only true or false
  195. onPhaseChanged = "if ((_this select 1) == 1) then {/* run if the phase is 1 */} else {/* run if the phase is 0 */};";// The following code is called by BIS_fnc_initVehicle each time the phase is changed
  196. // Note animation sources cannot impact the mass with sea vehicles, this is just as example
  197. mass = 0; // If the phase is 1, the given mass will be added, otherwise, it will be subtracted
  198.  
  199. };
  200. class HidePoliceSigns
  201. {
  202. displayName = "Hide police signs";
  203. source = "user";
  204. initPhase = 1;
  205. author = $STR_A3_Bohemia_Interactive;
  206. forceAnimatePhase = 0;
  207. forceAnimate[] = {"HideRescueSigns", 1};
  208. };
  209. };
  210.  
  211. // Please, have a look at the car sample for details about the textureSources
  212. /*class textureSources
  213. {
  214. class civilian
  215. {
  216. Displayname="Civil";
  217. author=$STR_A3_Bohemia_Interactive;
  218. textures[]=
  219. {
  220. "\a3\boat_f_gamma\Boat_Civil_01\data\boat_civil_01_ext_co.paa",
  221. "\a3\boat_f_gamma\Boat_Civil_01\data\boat_civil_01_int_co.paa"
  222. };
  223. factions[]=
  224. {
  225. "CIV_F"
  226. };
  227. };
  228. class rescue: civilian
  229. {
  230. Displayname="Rescue";
  231. textures[]=
  232. {
  233. "\a3\boat_f_gamma\Boat_Civil_01\data\boat_civil_01_ext_rescue_co.paa",
  234. "\a3\boat_f_gamma\Boat_Civil_01\data\boat_civil_01_int_rescue_co.paa"
  235. };
  236. };
  237. class police: civilian
  238. {
  239. Displayname="Police";
  240. textures[]=
  241. {
  242. "\a3\boat_f_gamma\Boat_Civil_01\data\boat_civil_01_ext_police_co.paa",
  243. "\a3\boat_f_gamma\Boat_Civil_01\data\boat_civil_01_int_police_co.paa"
  244. };
  245. };
  246. };*/
  247. };
  248.  
  249. class MEA_Ship_NAEA12: MEA_Ship_NAEA12_base
  250. {
  251. author = "Squad Brazil";
  252. dlc = "Brazilian_Armed_Forces";
  253. _generalMacro = "MEA_NAE_A12";
  254. model = "\mea_nae\mea_nae_a12";/// simple path to model
  255. scope = 2; /// scope 2 means it is available in editor, this is one of the macros in basicdefines_a3.hpp
  256. scopeCurator = 2; /// scope 2 means it's available in Zeus mode (0 means hidden)
  257. displayName = "NAe Sao Paulo"; /// how does the vehicle show itself in editor
  258. side = 1; /// 3 stands for civilians, 0 is OPFOR, 1 is BLUFOR, 2 means guerrillas
  259. faction = "MEA_Military"; /// defines the faction inside of the side
  260. vehicleClass = "MEA_Forces_Ship";
  261. crew = "MEA_01_M" /// lets use the sample soldier we have as default captain of the boat
  262. typicalCargo[] = {"MEA_01_M","MEA_01_M"};
  263.  
  264. /** It is technically possible to have side, faction and crew defined in base class, but it may cause some issues with identification of targets. */
  265.  
  266. class Eventhandlers
  267. {
  268. init = "_scr = _this execVM ""\mea_nae\script\init.sqf"";";
  269. };
  270.  
  271. class AnimationSources: AnimationSources /// hides all the beacons, shows the proxies
  272. {
  273. class Proxy: Proxy /// needs to be inherited from the base to keep the values
  274. {
  275. initPhase = 1; /// overrides just the value, rest stays as it is
  276. };
  277. };
  278.  
  279. class UserActions /// Adding possibility for user to switch the beacons on/off
  280. {
  281. class beacons_start
  282. {
  283. userActionID = 50; /// just some unique number
  284. displayName = $STR_A3_CfgVehicles_beacons_on; /// what is displayed in the action menu
  285. displayNameDefault = $STR_A3_CfgVehicles_beacons_on; /// what is displayed in middle of screen
  286. position = "mph_axis"; /// at what memory point of the ship is the used as center of the radius
  287. priority = 1.5; /// sorting of action menu
  288. radius = 1.8; /// radius around position where the action is avaliable
  289. animPeriod = 2; /// how long does the animation source take to go from 0 to 1
  290. onlyForPlayer = false; /// it is usable even by AI
  291. condition = "this animationPhase ""BeaconsStart"" < 0.5 AND Alive(this) AND driver this = = player"; /// at what condition is the action displayed
  292. statement = "this animate [""BeaconsStart"",1];"; /// and what happens when the action is used
  293. };
  294.  
  295. class beacons_stop: beacons_start
  296. {
  297. userActionID = 51;
  298. displayName = $STR_A3_CfgVehicles_beacons_off;
  299. displayNameDefault = $STR_A3_CfgVehicles_beacons_off;
  300. condition = "this animationPhase ""BeaconsStart"" > 0.5 AND Alive(this) AND driver this == player";
  301. statement = "this animate [""BeaconsStart"",0];";
  302. };
  303. };
  304. textureList[]= {"police",1};
  305. animationList[]=
  306. {
  307. "HidePoliceSigns", 0,
  308. "HideRescueSigns", 1,
  309. "HidePolice", 0
  310. };
  311. /// and the changes of textures to police ones
  312. //hiddenSelectionsTextures[] = {"\a3\boat_f_gamma\Boat_Civil_01\data\boat_civil_01_ext_police_co.paa", "\a3\boat_f_gamma\Boat_Civil_01\data\boat_civil_01_int_police_co.paa"};
  313. };
  314. class MEA_NAE_Hull_1: MEA_Ship_NAEA12
  315. {
  316. model = "\mea_nae\mea_nae_hull_1";
  317. //hiddenSelections[] = {"mea_nae\data\01_hull_co.paa"}; /// we want to allow changing of colours, this defines on what selection are the textures used
  318. //hiddenSelectionsTextures[] = {"mea_nae\data\01_hull_co.paa"}; /// and here are the textures
  319. };
  320. class MEA_NAE_Hull_2: MEA_Ship_NAEA12
  321. {
  322. model = "\mea_nae\mea_nae_hull_2";
  323. //hiddenSelections[] = {"mea_nae\data\01_hull_co.paa"}; /// we want to allow changing of colours, this defines on what selection are the textures used
  324. //hiddenSelectionsTextures[] = {"mea_nae\data\01_hull_co.paa"}; /// and here are the textures
  325. };
  326. class MEA_NAE_Hull_3: MEA_Ship_NAEA12
  327. {
  328. model = "\mea_nae\mea_nae_hull_3";
  329. //hiddenSelections[] = {"mea_nae\data\01_hull_co.paa"}; /// we want to allow changing of colours, this defines on what selection are the textures used
  330. //hiddenSelectionsTextures[] = {"mea_nae\data\01_hull_co.paa"}; /// and here are the textures
  331. };
  332. class MEA_NAE_Hull_4: MEA_Ship_NAEA12
  333. {
  334. model = "\mea_nae\mea_nae_hull_4";
  335. //hiddenSelections[] = {"mea_nae\data\01_hull_co.paa"}; /// we want to allow changing of colours, this defines on what selection are the textures used
  336. //hiddenSelectionsTextures[] = {"mea_nae\data\01_hull_co.paa"}; /// and here are the textures
  337. };
  338. class MEA_NAE_Hull_5: MEA_Ship_NAEA12
  339. {
  340. model = "\mea_nae\mea_nae_hull_5";
  341. //hiddenSelections[] = {"mea_nae\data\01_hull_co.paa"}; /// we want to allow changing of colours, this defines on what selection are the textures used
  342. //hiddenSelectionsTextures[] = {"mea_nae\data\01_hull_co.paa"}; /// and here are the textures
  343. };
  344. class MEA_NAE_Hull_6: MEA_Ship_NAEA12
  345. {
  346. model = "\mea_nae\mea_nae_hull_6";
  347. //hiddenSelections[] = {"mea_nae\data\01_hull_co.paa"}; /// we want to allow changing of colours, this defines on what selection are the textures used
  348. //hiddenSelectionsTextures[] = {"mea_nae\data\01_hull_co.paa"}; /// and here are the textures
  349. };
  350. };
RAW Paste Data