Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Route files
- Used by ai/vehicles to follow as a path through the world with support for custom messages to be acted on.
- This information is mostly guess-work from the script interactions with the script system:
- data files:
- .frt - (in fpks)-- fox route? the file header id is ROUT rt is used as an abreviation for route through the data/scripts
- .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.
- .frld - (in fpkds)-- file rail data? the file header is RAIL
- 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.
- Route name/id: A string or a StrCode32 referenced in the files.
- A route consists of route nodes and route events,
- route nodes are possibly vector3 positions,
- route events are either routeNodeEvents for when the ai traveling is at the node, or routeEdgeEvents for when traversing between nodes.
- They have a name/id which is possibly a strCode32, and possibly a param value which is likewise.
- Here's a set of route files from a sideop/quest with acompanying info:
- https://mega.nz/#!LJ1XWAbL!a8AFm4T7cr0VnL_2igoQ2NAkmgq1kvQkiyZHKz4JJpk
- quest_q52015.frt
- quest_q52015.frl
- quest_q52015.frld
- quest_q52015 is sideop 116 - Eliminate the tank unit 03
- This quest has heli, tank(doesnt use any route), soldiers
- Gathered from quest_q52015.lua :
- route names for soldiers:
- "rt_quest_d_0000" -- used by the tank soldier, which just sits their, probably only one node
- -- following routes
- "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
- "rt_quest_d_0002" -- same basic behaviour, just with different points.
- No node event messages fired for these routes.
- route names for helicopter:
- "rt_heli_quest_spawn" -- fires "msg_questHeli_routeChange" at end
- "rt_heli_quest_0000"
- RoutePoint messageIds:
- "msg_questHeli_routeChange"
- Examining the .frt file shows fragments of strings that seem to match RouteNodeEvents and/or RouteEdgeEvents (see below for more information)
- Script snippets as to back up reasoning.
- Route events described in paths noted in \Data1\Tpp\start.lua
- EdRouteDataNodeEvent.SetEventDefinitionPath("Soldier2","Tpp/Scripts/RouteEvents/AiRtEvSoldier2.lua")
- EdRouteDataEdgeEvent.SetEventDefinitionPath("Soldier2","Tpp/Scripts/RouteEvents/AiRtEvSoldier2.lua")
- AiRtEvSoldier2.lua is the only file found, given that the code block is wrapped in 'if Editor' that's not too surprising.
- AiRtEvSoldier={
- RouteNodeEvents=function()
- return{
- "RelaxedStandIdleAct",
- TppRouteNodeEventRelaxedIdle{time=8},
- "RelaxedStandIdle",
- EdRouteDataNodeEvent{},
- "StandUseFlashlight",
- EdRouteDataNodeEvent{},
- "StandUseSearchlight",
- EdRouteDataNodeEvent{},
- "CautionStandIdleAim",
- EdRouteDataNodeEvent{},
- "CautionStandIdleReady",
- EdRouteDataNodeEvent{},
- "CautionSearchStandIdleReady",
- EdRouteDataNodeEvent{},
- "CautionSquatIdleReady",
- EdRouteDataNodeEvent{},
- "CautionSquatIdleAim",
- EdRouteDataNodeEvent{},
- "RideVehicle",
- TppRouteNodeEventGroupRideVehicle{},
- "EmergencyRideVehicle",
- TppRouteNodeEventGroupRideVehicle{},
- "Conversation",
- TppRouteNodeEventConversation{},
- "AttackFireAAG",
- EdRouteDataNodeEvent{},
- "AttackStandFire",
- EdRouteDataNodeEvent{},
- "AttackBurstFire",
- TppRouteNodeEventBurstFire{},
- "CommonActing",
- TppRouteNodeEventCommonActing{}}
- end,
- RouteEdgeEvents=function()
- return{
- "RelaxedStandWalkAct",
- TppRouteEdgeEventRelaxedWalk{},
- "RelaxedStandWalk",
- EdRouteDataEdgeEvent{},
- "CautionStandWalkReady",
- EdRouteDataEdgeEvent{},
- "CautionSearchStandWalkReady",
- EdRouteDataEdgeEvent{},
- "NormalStandRun",
- EdRouteDataEdgeEvent{},
- "StandDash",
- EdRouteDataEdgeEvent{},
- "CautionStandWalkAim",
- EdRouteDataEdgeEvent{},
- "StandAimWalkFacingFront",
- EdRouteDataEdgeEvent{},
- "CautionStandRunAim",
- EdRouteDataEdgeEvent{},
- "CautionStandRunReady",
- EdRouteDataEdgeEvent{}
- }
- end
- }
- Related messages from engine>>lua
- from quest_q52015
- {
- msg = "RoutePoint2",
- func = function (gameObjectId, routeId ,routeNode, messageId )
- if messageId == StrCode32("msg_questHeli_routeChange") then
- Fox.Log("*** " .. tostring(gameObjectId) .. " ::RouteChangeGameObjectId ***")
- this.SetHeliRoute( "rt_heli_quest_0000", true )
- end
- end
- },
- Output on quest shortly after heli appears from side and visibly changes direction to the circular quest route
- routeId: 2615639494 - which does match StrCode32("rt_heli_quest_spawn")
- routeNodeIndex: 0
- messageId: 889322046 - which does match StrCode32("msg_questHeli_routeChange")
- Not too surprising, most params in in the game message(msg) system are strcode32ed
- --
- GameObject = {
- {
- msg = "RoutePoint2",
- func = function(gameObjectId, routeId, routeNode, message)
- Fox.Log("route:" ..routeId)
- if message == StrCode32("DisableOcelot") then
- ...
- elseif message == StrCode32("DisableDemoEndRoute") then
- local command = { id = "SwitchRoute", route = "" }
- SendCommand( gameObjectId, command )
- end
- end,
- option = { isExecDemoPlaying = true },
- },
- }
- RoutePoint2 is fired by ai when it reaches a node
- (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)
- 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")
- Another example:
- mission 50050
- {
- msg = "RoutePoint2", sender = "SupportHeli",
- func = function (sender,routeId,param,messageId)
- if messageId == StrCode32("UpdateStartPoint") then
- this.UpdateStartPosition( param )
- ...
- end
- if messageId == StrCode32("SetStartPoint") then
- this.UpdateStartPosition( param )
- end
- end
- },
- ...
- function UpdateStartPosition( param )
- if param == StrCode32(10) then
- ...
- elseif param == StrCode32(20) then
- ...
- elseif param == StrCode32(30) then
- ...
- end
- This along with the RelaxedStandIdleAct suggest routeevents can have parameters with the message id.
- --
- Setting routes
- local command={id="SwitchRoute",route=""}
- local command={id="SetSneakRoute",route=routeId,point=routeNodeIndex}
- local command={id="SetCautionRoute",route=routeId,point=routeNodeIndex}
- local command={id="SetAlertRoute",route=routeId,point=routeNodeIndex}
- Seting route to "" clears it
- --
- TppSoldier2s save vars:
- scriptSneakRoute
- scriptCautionRoute
- scriptAlertRoute
- routeNodeIndex
- routeEventIndex
Add Comment
Please, Sign In to add comment