Guest User

Untitled

a guest
Apr 5th, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.22 KB | None | 0 0
  1. Route files
  2. Used by ai/vehicles to follow as a path through the world with support for custom messages to be acted on.
  3.  
  4. This information is mostly guess-work from the script interactions with the script system:
  5.  
  6. data files:
  7. .frt - (in fpks)-- fox route? the file header id is ROUT rt is used as an abreviation for route through the data/scripts
  8. .frl - (in fpks)-- fox rail? the file header id RAIL, the game uses rail data for the prolog after the bed, before you gain full movment, and also for the horse chase. Possibly other uses as it's found in some quest mission fpks.
  9. .frld - (in fpkds)-- file rail data? the file header is RAIL
  10.  
  11. Route files may contain multiple routes - assumed from quest fpks having a single route file (or just one of each route file type), but defining different routes for the soldiers in the quest.
  12.  
  13. Route name/id: A string or a StrCode32 referenced in the files.
  14.  
  15. A route consists of route nodes and route events,
  16. route nodes are possibly vector3 positions,
  17. route events are either routeNodeEvents for when the ai traveling is at the node, or routeEdgeEvents for when traversing between nodes.
  18. They have a name/id which is possibly a strCode32, and possibly a param value which is likewise.
  19.  
  20. Here's a set of route files from a sideop/quest with acompanying info:
  21. https://mega.nz/#!LJ1XWAbL!a8AFm4T7cr0VnL_2igoQ2NAkmgq1kvQkiyZHKz4JJpk
  22.  
  23.  
  24. quest_q52015.frt
  25. quest_q52015.frl
  26. quest_q52015.frld
  27.  
  28. quest_q52015 is sideop 116 - Eliminate the tank unit 03
  29. This quest has heli, tank(doesnt use any route), soldiers
  30.  
  31. Gathered from quest_q52015.lua :
  32. route names for soldiers:
  33. "rt_quest_d_0000" -- used by the tank soldier, which just sits their, probably only one node
  34. -- following routes
  35. "rt_quest_d_0001" -- used by 2 different soldiers, simply travelling between 2 points, waiting at each one, is there a facing angle/direction with a node? its not just their direction they were in when approaching node, they turn to face a specific direction when they stop
  36. "rt_quest_d_0002" -- same basic behaviour, just with different points.
  37. No node event messages fired for these routes.
  38.  
  39. route names for helicopter:
  40. "rt_heli_quest_spawn" -- fires "msg_questHeli_routeChange" at end
  41. "rt_heli_quest_0000"
  42.  
  43. RoutePoint messageIds:
  44. "msg_questHeli_routeChange"
  45.  
  46. Examining the .frt file shows fragments of strings that seem to match RouteNodeEvents and/or RouteEdgeEvents (see below for more information)
  47.  
  48.  
  49. Script snippets as to back up reasoning.
  50.  
  51.  
  52. Route events described in paths noted in \Data1\Tpp\start.lua
  53.  
  54. EdRouteDataNodeEvent.SetEventDefinitionPath("Soldier2","Tpp/Scripts/RouteEvents/AiRtEvSoldier2.lua")
  55. EdRouteDataEdgeEvent.SetEventDefinitionPath("Soldier2","Tpp/Scripts/RouteEvents/AiRtEvSoldier2.lua")
  56.  
  57. AiRtEvSoldier2.lua is the only file found, given that the code block is wrapped in 'if Editor' that's not too surprising.
  58.  
  59.  
  60. AiRtEvSoldier={
  61. RouteNodeEvents=function()
  62. return{
  63. "RelaxedStandIdleAct",
  64. TppRouteNodeEventRelaxedIdle{time=8},
  65. "RelaxedStandIdle",
  66. EdRouteDataNodeEvent{},
  67. "StandUseFlashlight",
  68. EdRouteDataNodeEvent{},
  69. "StandUseSearchlight",
  70. EdRouteDataNodeEvent{},
  71. "CautionStandIdleAim",
  72. EdRouteDataNodeEvent{},
  73. "CautionStandIdleReady",
  74. EdRouteDataNodeEvent{},
  75. "CautionSearchStandIdleReady",
  76. EdRouteDataNodeEvent{},
  77. "CautionSquatIdleReady",
  78. EdRouteDataNodeEvent{},
  79. "CautionSquatIdleAim",
  80. EdRouteDataNodeEvent{},
  81. "RideVehicle",
  82. TppRouteNodeEventGroupRideVehicle{},
  83. "EmergencyRideVehicle",
  84. TppRouteNodeEventGroupRideVehicle{},
  85. "Conversation",
  86. TppRouteNodeEventConversation{},
  87. "AttackFireAAG",
  88. EdRouteDataNodeEvent{},
  89. "AttackStandFire",
  90. EdRouteDataNodeEvent{},
  91. "AttackBurstFire",
  92. TppRouteNodeEventBurstFire{},
  93. "CommonActing",
  94. TppRouteNodeEventCommonActing{}}
  95. end,
  96. RouteEdgeEvents=function()
  97. return{
  98. "RelaxedStandWalkAct",
  99. TppRouteEdgeEventRelaxedWalk{},
  100. "RelaxedStandWalk",
  101. EdRouteDataEdgeEvent{},
  102. "CautionStandWalkReady",
  103. EdRouteDataEdgeEvent{},
  104. "CautionSearchStandWalkReady",
  105. EdRouteDataEdgeEvent{},
  106. "NormalStandRun",
  107. EdRouteDataEdgeEvent{},
  108. "StandDash",
  109. EdRouteDataEdgeEvent{},
  110. "CautionStandWalkAim",
  111. EdRouteDataEdgeEvent{},
  112. "StandAimWalkFacingFront",
  113. EdRouteDataEdgeEvent{},
  114. "CautionStandRunAim",
  115. EdRouteDataEdgeEvent{},
  116. "CautionStandRunReady",
  117. EdRouteDataEdgeEvent{}
  118. }
  119. end
  120. }
  121.  
  122.  
  123.  
  124. Related messages from engine>>lua
  125. from quest_q52015
  126. {
  127. msg = "RoutePoint2",
  128. func = function (gameObjectId, routeId ,routeNode, messageId )
  129. if messageId == StrCode32("msg_questHeli_routeChange") then
  130. Fox.Log("*** " .. tostring(gameObjectId) .. " ::RouteChangeGameObjectId ***")
  131. this.SetHeliRoute( "rt_heli_quest_0000", true )
  132. end
  133. end
  134. },
  135.  
  136. Output on quest shortly after heli appears from side and visibly changes direction to the circular quest route
  137. routeId: 2615639494 - which does match StrCode32("rt_heli_quest_spawn")
  138. routeNodeIndex: 0
  139. messageId: 889322046 - which does match StrCode32("msg_questHeli_routeChange")
  140.  
  141. Not too surprising, most params in in the game message(msg) system are strcode32ed
  142.  
  143.  
  144. --
  145. GameObject = {
  146. {
  147. msg = "RoutePoint2",
  148. func = function(gameObjectId, routeId, routeNode, message)
  149. Fox.Log("route:" ..routeId)
  150. if message == StrCode32("DisableOcelot") then
  151. ...
  152. elseif message == StrCode32("DisableDemoEndRoute") then
  153. local command = { id = "SwitchRoute", route = "" }
  154. SendCommand( gameObjectId, command )
  155. end
  156. end,
  157. option = { isExecDemoPlaying = true },
  158. },
  159. }
  160.  
  161.  
  162. RoutePoint2 is fired by ai when it reaches a node
  163. (sidenote: the 2 is likely just because it's the second iteration of the system, there's evidence of many systems and game objects having gone through a refactor between GZ and TPP, there are no use cases of RoutePoint in TPP, only RoutePoint2)
  164. Here message/messageId is a StrCode32 of an id custom to a specfic route (assumed from such names as "mid_of_rts_fake_target1_interrogation3_0000", "CancelMeetingVIP")
  165.  
  166. Another example:
  167. mission 50050
  168.  
  169. {
  170. msg = "RoutePoint2", sender = "SupportHeli",
  171. func = function (sender,routeId,param,messageId)
  172. if messageId == StrCode32("UpdateStartPoint") then
  173. this.UpdateStartPosition( param )
  174. ...
  175. end
  176. if messageId == StrCode32("SetStartPoint") then
  177. this.UpdateStartPosition( param )
  178. end
  179. end
  180. },
  181.  
  182. ...
  183. function UpdateStartPosition( param )
  184. if param == StrCode32(10) then
  185. ...
  186. elseif param == StrCode32(20) then
  187. ...
  188. elseif param == StrCode32(30) then
  189. ...
  190. end
  191.  
  192. This along with the RelaxedStandIdleAct suggest routeevents can have parameters with the message id.
  193.  
  194.  
  195. --
  196.  
  197. Setting routes
  198. local command={id="SwitchRoute",route=""}
  199.  
  200. local command={id="SetSneakRoute",route=routeId,point=routeNodeIndex}
  201. local command={id="SetCautionRoute",route=routeId,point=routeNodeIndex}
  202. local command={id="SetAlertRoute",route=routeId,point=routeNodeIndex}
  203.  
  204.  
  205. Seting route to "" clears it
  206.  
  207. --
  208.  
  209. TppSoldier2s save vars:
  210.  
  211. scriptSneakRoute
  212. scriptCautionRoute
  213. scriptAlertRoute
  214. routeNodeIndex
  215. routeEventIndex
Add Comment
Please, Sign In to add comment