forwardKappa.sqf 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. params ["_vic"];
  2. comment "Variable Decs";
  3. _vic allowDamage false;
  4. _vic setvariable ["Speed",200,true];
  5. _vic setvariable ["turnon",true,true];
  6. comment "Increment Speed";
  7. _vic addAction ["<t color='#A668C2'>Increment Speed by 10 -------- U16</t>",
  8. {
  9. (_this select 0) setvariable ["Speed",(((_this select 0) getVariable "Speed")+10),true];
  10. hint parseText format["<t color='#A668C2'> Speed set to:%1 Kmph</t>",((_this select 0) getVariable "Speed")];
  11. },[1],0,false,true,"User16"," driver _target == _this"];
  12. comment "Decrement Speed";
  13. _vic addAction ["<t color='#FF69B4'>Decrement Speed by 10 -------- U17</t>",
  14. {
  15. (_this select 0) setvariable ["Speed",(((_this select 0) getVariable "Speed")-10),true];
  16. hint parseText format["<t color='#FF69B4'>Speed set to:%1 Kmph</t>",((_this select 0) getVariable "Speed")];
  17. },[1],0,false,true,"User17"," driver _target == _this"];
  18. comment "Engage";
  19. _vic addAction ["<t color='#00FF00'>Engage C.R.U.I.S.I.E Control System -------- U18</t>",
  20. {
  21. (_this select 0) setvariable ["turnon",true,true];
  22. hint parseText "<t color='#00FF00'>ENGAGING C.R.U.I.S.I.E Control System</t>";
  23. while { (alive (_this select 0)) AND (((_this select 0) getvariable "turnon"))} do
  24. {
  25. _Multiplier = 0.4;
  26. _Acceleration = 0.6;
  27. _sleep_time_acceleration_loop = 0.1;
  28. _Max_Multiplier = .1;
  29. _Coef_mul=((_Acceleration*_Multiplier/2)*(15*_sleep_time_acceleration_loop));
  30. if ((speed (_this select 0)) < ((_this select 0) getVariable "Speed")) then {
  31. ((_this select 0)) setVelocity
  32. [
  33. (velocity ((_this select 0)) select 0)+((vectordir ((_this select 0))) select 0)*_Coef_mul,
  34. (velocity ((_this select 0)) select 1)+((vectordir ((_this select 0))) select 1)*_Coef_mul,
  35. (velocity ((_this select 0)) select 2)+((vectordir ((_this select 0))) select 2)*_Coef_mul
  36. ]
  37. };
  38. if (_Multiplier < _Max_Multiplier) then {_Multiplier = _Multiplier + 0.1*(15*_sleep_time_acceleration_loop)};
  39. };
  40. turnon=false;
  41. },[1],0,false,true,"User18"," driver _target == _this"];
  42. comment "Disenage";
  43. _vic addAction ["<t color='#FFA500'>Disengage C.R.U.I.S.I.E Control System -------- U19</t>",
  44. {
  45. (_this select 0) setvariable ["turnon",false,true];
  46. hint parseText "<t color='#FFA500'>DISENGAGING C.R.U.I.S.I.E Control System</t>";
  47. hint parseText "<t color='#FFA500'>DRIVE DOWN</t>";
  48. },[1],0,false,true,"User19"," driver _target == _this"];
  49. comment "Halt";
  50. _vic addAction ["<t color='#FF0000'>Stop Driver -------- U20</t>",
  51. {
  52. (_this select 0) setvariable ["turnon",false,true];
  53. hint parseText "<t color='#FF0000'>HALTING</t>";
  54. while {(speed (_this select 0) > 10)} do
  55. {
  56. hint "DRIVING DOWN NOW";
  57. _vel = velocity (_this select 0) ;
  58. _dir = direction (_this select 0) ;
  59. _speed = -3;
  60. (_this select 0) setVelocity [
  61. (_vel select 0) + (sin _dir * _speed),
  62. (_vel select 1) + (cos _dir * _speed),
  63. (_vel select 2)
  64. ];
  65. };
  66. hint parseText "<t color='#FF0000'>HALTING</t>";
  67. },[1],0,false,true,"User20"," driver _target == _this"];