emoose wrote:Not yet, had a look over but couldn't really understand it much, if you could break it down that could be helpful
Mission codes (from TppDefine.lua MISSION_LIST, SYS_MISSION_ID)
Code: Select all
_.MISSION_LIST={"10010","10020","10030","10036","10043","10033","10040","10041","10044","10052","10054","10050","10070","10080","10086","10082","10090",
"10195","10091","10100","10110","10121","10115","10120","10085","10200","10211","10081","10130","10140","10150","10151","10045","10156",
"10093","10171","10240","10260","10280","10230","11043","11041","11054","11085","11082","11090","11036","11033","11050","11091","11195",
"11211","11140","11200","11080","11171","11121","11115","11130","11044","11052","11151",nil}
_.SYS_MISSION_ID={INIT=1,TITLE=5,AFGH_FREE=30010,MAFR_FREE=30020,MTBS_FREE=30050,MTBS_ZOO=30150,MTBS_WARD=30250,
AFGH_HELI=40010,MAFR_HELI=40020,MTBS_HELI=40050,HELI_SPACE=40060,FOB=50050,SELECT=60000}
I'd imagine the tables above would be complete, it wouldn't make much sense otherwise, but..
I'm assuming you can at least brute force check potential names against remaining keys?
I guess just crush the above into smaller ranges 10000-10100 etc.
The 11k range is hard versions of the existing missions, I'm not sure if they actually have their own fpks as I see most references just shift the code back to the original 10k range.
But try them as well I guess.
missioncodes fall into 10k ranges per mission type (listed below), ie story=10k range, extra=20k (sideops i think), 30k free, 40k heli, 50 fob.
While there's a lot of missions/packs in the story/10k/11k range, above that I think there's nothing between those defined in sys_mission_id.
Maybe check existing fpks to see if there's anything out of the listed ranges.
ok thats missionCode.
The rest
Code: Select all
local missionTypePackCodes={"s","e","f","h","o"}
local missionTypePackCodeNames={"story","extra","free","heli","online"}
function this.GetMissionTypeAndMissionName(missionCode)
local missionCodeTypeRange=math.floor(missionCode/1e4)--tex NMC: missioncodes fall into 10k ranges per mission type
local missionTypePackCodeName=missionTypePackCodeNames[missionCodeTypeRange]
local missionName
if missionTypePackCodes[missionCodeTypeRange]then
missionName=missionTypePackCodes[missionCodeTypeRange] .. missionCode --tex NMC: .. operator in lua concats strings
end
return missionTypePackCodeName,missionName --tex NMC: lua multiple return
end
for fpks along the lines of
s10090_area.fpkd
Code: Select all
function this.MakeDefaultMissionAreaPackPath(_missionCode)
local missionCode=_missionCode
if TppMission.IsHardMission(missionCode)then
missionCode=TppMission.GetNormalMissionCodeFromHardMission(missionCode)--tex NMC: just shifts from 11k range to 10k so it matches it's normal story mission
-- and falls into story mission type range, so no seperate packs for hard missions I guess
end
local missionTypePackCodeName,missionName=this.GetMissionTypeAndMissionName(missionCode)--tex: NMC: lua functions can return multiple values
if missionTypePackCodeName and missionName then
local path="/Assets/tpp/pack/mission2/"..(missionTypePackCodeName..("/"..(missionName..("/"..(missionName.."_area.fpk")))))--tex NMC: .. operator in lua concats strings
return path
end
end
for fpks along the lines of
o50050_area_ly080_cl03_fpkd
mbLayoutCode = 0-103,980?, from TppLocation.lua, ?mbstage_parameter.lua
Check existing files for ranges too I guess.
mbClusterId = 0-6 - from TppDefine.CLUSTER_DEFINE, again just a rough stab at range.
Code: Select all
function this.AddFOBLayoutPack(missionCode,mbClusterId,mbLayoutCode)
local missionTypePackCodeName,missionName=this.GetMissionTypeAndMissionName(missionCode)
if missionCode==50050 then--tex: NMC: WTF: uhhh, what. so means it doesnt pull the pack, yet next If it's checking again?
end
if(missionCode==50050)or(missionCode==10115)then
local areaPath="/Assets/tpp/pack/mission2/"..(missionTypePackCodeName..("/"..(missionName..("/"..(missionName..string.format("_area_ly%03d",mbLayoutCode))))))
local areaPathF=areaPath..".fpk"
local clusterPath=areaPath..(string.format("_cl%02d",mbClusterId)..".fpk")
elseif missionCode==30050 then
local layoutPath="/Assets/tpp/pack/mission2/"..(missionTypePackCodeName..("/"..(missionName..("/"..(missionName..string.format("_ly%03d",mbLayoutCode))))))
local layoutPath=layoutPath..".fpk"
end
end
Edit: Also thanks again for the lua decryption, already made some features in my mod better.