Advertisement
Guest User

Tavi 2.0 - Animal Fix agent

a guest
Sep 18th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.30 KB | None | 0 0
  1. /*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Animal Agent">*/
  2. /*%FSM<HEAD>*/
  3. /*
  4. item0[] = {"init",0,250,-150.000000,75.000000,-50.000000,125.000000,0.000000,"init"};
  5. item1[] = {"wait",2,250,-25.000000,300.000000,75.000000,350.000000,0.000000,"wait"};
  6. item2[] = {"End",1,250,100.000000,225.000000,200.000000,275.000000,0.000000,"End"};
  7. item3[] = {"Not_Alive",4,218,-150.000000,300.000000,-50.000000,350.000000,4.000000,"Not" \n "Alive"};
  8. item4[] = {"Loiter",2,250,-150.000000,225.000000,-50.000000,275.000000,0.000000,"Loiter"};
  9. item5[] = {"In_Position",4,4314,-250.000000,275.000000,-150.000000,325.000000,2.000000,"In Position"};
  10. item6[] = {"preloaded",4,218,-150.000000,150.000000,-50.000000,200.000000,0.000000,"preloaded"};
  11. item7[] = {"time_up",4,218,-25.000000,225.000000,75.000000,275.000000,0.000000,"time" \n "up"};
  12. item8[] = {"player_check",4,218,-250.000000,175.000000,-150.000000,225.000000,1.000000,"player" \n "check"};
  13. item9[] = {"player_check",4,218,100.000000,300.000000,200.000000,350.000000,1.000000,"player" \n "check"};
  14. item10[] = {"tamed",4,218,-25.000000,150.000000,75.000000,200.000000,3.000000,"tamed"};
  15. link0[] = {0,6};
  16. link1[] = {1,7};
  17. link2[] = {1,9};
  18. link3[] = {3,1};
  19. link4[] = {4,3};
  20. link5[] = {4,5};
  21. link6[] = {4,7};
  22. link7[] = {4,8};
  23. link8[] = {4,10};
  24. link9[] = {5,4};
  25. link10[] = {6,4};
  26. link11[] = {7,2};
  27. link12[] = {8,4};
  28. link13[] = {9,1};
  29. link14[] = {10,2};
  30. globals[] = {25.000000,1,0,0,0,640,480,1,89,6316128,1,-299.424194,296.746490,405.380127,-436.653168,303,856,1};
  31. window[] = {0,-1,-1,-1,-1,1076,75,1283,75,1,321};
  32. *//*%FSM</HEAD>*/
  33. class FSM
  34. {
  35. fsmName = "DayZ Animal Agent";
  36. class States
  37. {
  38. /*%FSM<STATE "init">*/
  39. class init
  40. {
  41. name = "init";
  42. init = /*%FSM<STATEINIT""">*/"_pos = _this select 0;" \n
  43. "_agent = _this select 1;" \n
  44. "" \n
  45. "_isSomeone = true;" \n
  46. "_timeA = time;" \n
  47. "_isTamed = false;"/*%FSM</STATEINIT""">*/;
  48. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  49. class Links
  50. {
  51. /*%FSM<LINK "preloaded">*/
  52. class preloaded
  53. {
  54. priority = 0.000000;
  55. to="Loiter";
  56. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  57. condition=/*%FSM<CONDITION""">*/"dayz_clientPreload"/*%FSM</CONDITION""">*/;
  58. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  59. };
  60. /*%FSM</LINK>*/
  61. };
  62. };
  63. /*%FSM</STATE>*/
  64. /*%FSM<STATE "wait">*/
  65. class wait
  66. {
  67. name = "wait";
  68. init = /*%FSM<STATEINIT""">*/"_entityTime = time;"/*%FSM</STATEINIT""">*/;
  69. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  70. class Links
  71. {
  72. /*%FSM<LINK "player_check">*/
  73. class player_check
  74. {
  75. priority = 1.000000;
  76. to="wait";
  77. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  78. condition=/*%FSM<CONDITION""">*/"(time - _entityTime) > 30"/*%FSM</CONDITION""">*/;
  79. action=/*%FSM<ACTION""">*/"_entityTime = time;" \n
  80. "" \n
  81. "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n
  82. "_isSomeone = ({isPlayer _x} count _list) > 0;" \n
  83. "" \n
  84. "if (_isSomeone) then {" \n
  85. " _timeA = time;" \n
  86. "};"/*%FSM</ACTION""">*/;
  87. };
  88. /*%FSM</LINK>*/
  89. /*%FSM<LINK "time_up">*/
  90. class time_up
  91. {
  92. priority = 0.000000;
  93. to="End";
  94. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  95. condition=/*%FSM<CONDITION""">*/"(time - _timeA) > 120 and !_isSomeone"/*%FSM</CONDITION""">*/;
  96. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  97. };
  98. /*%FSM</LINK>*/
  99. };
  100. };
  101. /*%FSM</STATE>*/
  102. /*%FSM<STATE "End">*/
  103. class End
  104. {
  105. name = "End";
  106. init = /*%FSM<STATEINIT""">*/"if (!_isTamed) then {" \n
  107. " if (!_isSomeone) then {" \n
  108. " deleteVehicle _agent;" \n
  109. " } else {" \n
  110. " dayz_bodyMonitor set [count dayz_bodyMonitor,_agent];" \n
  111. " };" \n
  112. "};"/*%FSM</STATEINIT""">*/;
  113. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  114. class Links
  115. {
  116. };
  117. };
  118. /*%FSM</STATE>*/
  119. /*%FSM<STATE "Loiter">*/
  120. class Loiter
  121. {
  122. name = "Loiter";
  123. init = /*%FSM<STATEINIT""">*/"_isAlive = alive _agent;" \n
  124. "" \n
  125. "//_agent forceSpeed 2;" \n
  126. "_entityTime = time;"/*%FSM</STATEINIT""">*/;
  127. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  128. class Links
  129. {
  130. /*%FSM<LINK "Not_Alive">*/
  131. class Not_Alive
  132. {
  133. priority = 4.000000;
  134. to="wait";
  135. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  136. condition=/*%FSM<CONDITION""">*/"!_isAlive"/*%FSM</CONDITION""">*/;
  137. action=/*%FSM<ACTION""">*/"_timeA = time;"/*%FSM</ACTION""">*/;
  138. };
  139. /*%FSM</LINK>*/
  140. /*%FSM<LINK "tamed">*/
  141. class tamed
  142. {
  143. priority = 3.000000;
  144. to="End";
  145. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  146. condition=/*%FSM<CONDITION""">*/"_isTamed"/*%FSM</CONDITION""">*/;
  147. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  148. };
  149. /*%FSM</LINK>*/
  150. /*%FSM<LINK "In_Position">*/
  151. class In_Position
  152. {
  153. priority = 2.000000;
  154. to="Loiter";
  155. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  156. condition=/*%FSM<CONDITION""">*/"_agent distance _pos < 3"/*%FSM</CONDITION""">*/;
  157. action=/*%FSM<ACTION""">*/"_pos = [_pos,10,90,4,0,5,0] call BIS_fnc_findSafePos;" \n
  158. "_agent moveTo _pos;"/*%FSM</ACTION""">*/;
  159. };
  160. /*%FSM</LINK>*/
  161. /*%FSM<LINK "player_check">*/
  162. class player_check
  163. {
  164. priority = 1.000000;
  165. to="Loiter";
  166. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  167. condition=/*%FSM<CONDITION""">*/"(time - _entityTime) > 30"/*%FSM</CONDITION""">*/;
  168. action=/*%FSM<ACTION""">*/"_entityTime = time;" \n
  169. "" \n
  170. "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n
  171. "_isSomeone = ({isPlayer _x} count _list) > 0;" \n
  172. "" \n
  173. "if (_isSomeone) then {" \n
  174. " _timeA = time;" \n
  175. "};"/*%FSM</ACTION""">*/;
  176. };
  177. /*%FSM</LINK>*/
  178. /*%FSM<LINK "time_up">*/
  179. class time_up
  180. {
  181. priority = 0.000000;
  182. to="End";
  183. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  184. condition=/*%FSM<CONDITION""">*/"(time - _timeA) > 120 and !_isSomeone"/*%FSM</CONDITION""">*/;
  185. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  186. };
  187. /*%FSM</LINK>*/
  188. };
  189. };
  190. /*%FSM</STATE>*/
  191. };
  192. initState="init";
  193. finalStates[] =
  194. {
  195. "End",
  196. };
  197. };
  198. /*%FSM</COMPILE>*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement