Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archive

The Original Forum. Game archives, full of resources. How to open them? Get help here.
unknown123
advanced
Posts: 75
Joined: Sat Apr 09, 2016 5:36 pm
Has thanked: 4 times
Been thanked: 13 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by unknown123 »

Just a litte more info about cosmetics - https://unknown321.github.io/mgsv_resea ... etics.html, that should make things clearer. New stuff is at the end of the article (see diff)

Also game is being updated on steam - https://steamdb.info/sub/132506/history/, looks like definitive edition.
Tex
veteran
Posts: 89
Joined: Sat Aug 20, 2011 4:51 am
Has thanked: 21 times
Been thanked: 11 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by Tex »

unknown123 wrote:Made a huge post about cosmetics and models - https://unknown321.github.io/mgsv_resea ... etics.html. No, there is no clear solution for simple porting hats from mgo to tpp (yet), but I think I've found stuff that leads to it.
Nice writeup.

Beyond my prior post which you've possibly seen, I only have a couple of comments.

I think the actor object referenced in the mgo scripts is the MgoActor class. Referenced functions are in a section of the exe that has names matching those from your dump for MgoActor.
Same conclusion though since TPP uses TppPlayer2 / MgoActor isn't in MGSV_TPP exe

No telling how long ago the TPP/MGO project split happened.

Likewise seems like there was a big refactoring of the Fox codebase from comparing with GZ, I think it's likely that the TppDemoPuppet class doesn't exist any more.
unknown123
advanced
Posts: 75
Joined: Sat Apr 09, 2016 5:36 pm
Has thanked: 4 times
Been thanked: 13 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by unknown123 »

Tex wrote:I think the actor object referenced in the mgo scripts is the MgoActor class. Referenced functions are in a section of the exe that has names matching those from your dump for MgoActor. Same conclusion though since TPP uses TppPlayer2 / MgoActor isn't in MGSV_TPP exe
That's what I thought. There was some code for searching actors (chunk0_dat/ruleset_teamsneak_fpkd/Assets/mgo/script/ruleset/teamsneak/TeamSneak_Exfil.lua):

Code: Select all

	local controlQuery =
		{      id = "Search",
			criteria = 
			{
				type = TppPoi.POI_GENERIC,
				tags = {"CONTROL_POINT",},
			}
		}
	local pointsSearch = GameObject.SendCommand( this.owner.POI_SYSTEM_ID, controlQuery )
	if pointsSearch.resultCount < 1 then
		Utils.DisplayError( "TeamSneak_Exfil:SetupPointsAndFlags. Could not find any control points. POI Search Tags=" .. Utils.StringArrayToCSV( controlQuery.criteria.tags ) )    
	else
		for i = 1, #pointsSearch.results do
			local controlPointId = pointsSearch.results[i].gameObjectId
			local controlPointTags = pointsSearch.results[i].tags
			if( controlPointId == nil ) then
				Utils.DisplayError( "TeamSneak_Exfil:SetupPointsAndFlags couldn't get control point gameObjectId for " .. controlPointTags )
			else
				local actor = MgoGameObject.GetActor( controlPointId )
				table.insert( PointsTable, actor )
			end
		end
	end
However MgoGameObject.GetActor returns something different, these objects don't have methods such as AttachParts. It's metatable is much smaller, like 8 methods overall; trying to call methods that supposed to be there gives errors. You can inspect it yourself by creating territory control passworded match then running code above.

Now about fovas.
First mission has Ocelot and Miller with their eyewear. Miller has a nice entry in his .parts file under the name "Sunglasses". He doesn't have any fv2 files - his form is stable.
Ocelot, however, doesn't have any mentions about his glasses in his .parts - he has 3 fv2 files instead. He gets his eyewear by changing fovas and of course there is only garbage in them.
This is getting really complicated, the only mention of Ocelot's glasses is in demo file - path to the model, same with Snake's goggles. I don't understand how 48 bytes of fv2 tell game engine to load that exact model, I don't understand how Miller is getting his sunglasses back. Copypasting Miller's sunglasses entry into Snake's regular parts does nothing, applying Ocelot's fv2 to Snake leads to the crash. Game just does some magic I guess.

Edit: it's even worse, Ocelot with broken fv2 doesn't have glasses - http://imgur.com/2IEvbv2.jpg, but he gets them back no matter what in a cutscene - http://imgur.com/9mWUmKd.jpg. It means that there are 2 ways of slapping things together - using demo and using fv2.
Tex
veteran
Posts: 89
Joined: Sat Aug 20, 2011 4:51 am
Has thanked: 21 times
Been thanked: 11 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by Tex »

CantStoptheBipBop wrote:Another lng dictionary update.
Nice work.

Another possible approach:
grab Fox.StrCode32
viewtopic.php?f=10&t=12407&p=111415#p111415

This takes in a list of keys and spits out the strcode for it.

So the new process would be:

run langtool without a dictionary and all lngs
grab all the str32 hashes from the lng xmls indicated by Key=" (should realy be called Hash=) and put them into a table with the hash as the key
ie
hashToKey[hash]=-1 --initialize to key not yet found for hash


then for each attack key in your attack dictionary
write the attack key to a text file
run Fox.StrCode32 with that
read the output txt - <input filename>_result.txt
read the generated hash
then
if hashToKey[gennedHash] --have a match
hashToKey[gennedHash]=attackKey

Probably group the step above so StrCode32 is churning through a bunch of keys to minimize the overhead of file-write os.execute file-read

Then to speed up further you can save the hashToKey table (using the persistence script) and load it at the start instead of initializing it from scratch, you can just run through the keys and write them when you want to output your lang_dictionary

unknown123 wrote:...
fv2s basically just trigger mesh or texture references in a fmdl.

YourePrettyGood did a relatively complete breakdown of the fv2 format:
viewtopic.php?f=10&t=12407&p=121318#p121318

There's two ways of handling a model in relation to an existing one, have it directly as a sub mesh in the main fmdl, or have it as a separate fmdl and have a model description in the parts file.
nasanhak
advanced
Posts: 71
Joined: Sat Nov 28, 2015 6:01 am
Has thanked: 10 times
Been thanked: 4 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by nasanhak »

Who figured out the PlayerStatus names? And how?? Same for PlayerPad. Was it you Tex? Numeric values are easy enough to find out since they are 2^x bit flags anyway.

http://wiki.tesnexus.com/index.php/PlayerStatus
http://wiki.tesnexus.com/index.php/Input_handling

@Tex thanks for the info on coroutines - had figured that one out. They seem useful if called in game, that is if I can manage to write something up. Update funcs are pretty fast anyway and there should be no need for an
unknown123
advanced
Posts: 75
Joined: Sat Apr 09, 2016 5:36 pm
Has thanked: 4 times
Been thanked: 13 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by unknown123 »

nasanhak wrote:And how?? Same for PlayerPad.
They are listed in the exe, use strings.exe to get a dump. You can also try to parse them from lua files, but it is not that reliable.
nasanhak
advanced
Posts: 71
Joined: Sat Nov 28, 2015 6:01 am
Has thanked: 10 times
Been thanked: 4 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by nasanhak »

unknown123 wrote:
nasanhak wrote:And how?? Same for PlayerPad.
They are listed in the exe, use strings.exe to get a dump. You can also try to parse them from lua files, but it is not that reliable.
Aahh of course. Thanks!
CantStoptheBipBop
advanced
Posts: 53
Joined: Sat Aug 27, 2016 9:43 am
Has thanked: 7 times
Been thanked: 7 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by CantStoptheBipBop »

Tex wrote:Another possible approach:
grab Fox.StrCode32
viewtopic.php?f=10&t=12407&p=111415#p111415
You the MVP Tex. I had a feeling there had to be a way to get them from just the entry keys. I've yet to try it but the process you suggest looks it should be pretty easy to implement in a copy of my current script. Just pattern matching Entry Key instead of LangId, keeping only duplicate keys in a table compare with the current dictionary output instead of the opposite, etc.
nasanhak
advanced
Posts: 71
Joined: Sat Nov 28, 2015 6:01 am
Has thanked: 10 times
Been thanked: 4 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by nasanhak »

@Tex May want to add these conditions to drop weapon

Code: Select all

if TppMission.IsFOBMission(vars.missionCode) then return end
if vars.playerVehicleGameObjectId~=GameObject.NULL_ID then return end --takes care of vehicles, D-Horse, D-Walker and heli

--NORMAL_ACTION --takes care of every unique action like using AA Guns, ladders, hanging, fultoning, getting in and out of supply boxes etc - pretty much everything. Seems to take care of buddies and vehicles too but did not test
--BEHIND --is true when in cover, is false when aiming out of cover
--LFET_STOCK (sic) --true when camera is over to the left of the player else false
if not PlayerInfo.OrCheckStatus{PlayerStatus.NORMAL_ACTION,PlayerStatus.BEHIND} then return end

if slotType==6 then return end --Don't want to drop bionic arm varieties lol XD
CantStoptheBipBop
advanced
Posts: 53
Joined: Sat Aug 27, 2016 9:43 am
Has thanked: 7 times
Been thanked: 7 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by CantStoptheBipBop »

@Tex
I'm still in the process of writing the file (need to rewrite tableHashMatch(t1,t2) because it's returning an empty table for whatever bizarre reason). The fact that the .xml files don't need reset with a blank dictionary at the start and that LangTool doesn't need to run on anything is big time-saver, and that may let me raise dictionaryAttack() word generation time and bruteForce() entry length if Fox.StrCode32.exe doesn't have a similar memory cap to LangTool. I was eyeballing performance and it's something like five seconds for the current tableMatch(t1,t2) functions to run. The current implementation of your suggested method is calling two identical table comparison functions, which puts it at roughly 50% faster than running LangTool on every file but 50% slower than running LangTool on a handful or less files. I'm more concerned with getting the script working so optimization to make it run faster than the current method can always come later.

I decided to stop being lazy and finally created the MGSV Lang Dictionary Project on GitHub. Though I'm still far too lazy to do an updated LangId/Entry Key count for each file so I didn't edit it into the readme. I'll be pushing updates on there instead of here. The best part for me is that I can update it as often as I want without it coming across as spammy. I'll add langForce.lua to the project after I finish the Fox.StrCode32.exe version and merge it with the previous file version.

I never got around to finishing my vehicle notes but the meat of it was there. I can't find it anywhere on my computer >.>. It's formatted as .xml pseudo-code because auto-tabbing and code block collapsing is too convenient of a feature in programmer text editors to pass up. For "but why .xml", afaik it's the cleanest language for general note-taking in psuedo-code. I could just write a custom format preset for notepad++ and/or Sublime to write under, but like I said, I'm lazy.

With another "because I was bored" reason, I've started reformatting TppRevenge.lua so that the file is far easier to read. Metatables are being formatted as

Code: Select all

metatable={
    table1={}
    table2={
        table2a={}
        table2b={}
    }
}
Ashtails
beginner
Posts: 36
Joined: Sun Sep 20, 2015 8:57 pm

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by Ashtails »

Anyone know how to unlock the bandana and Ishmael hat in mgo by messing with the files like in this video?

https://m.youtube.com/watch?v=l18y3WR7ryg
nasanhak
advanced
Posts: 71
Joined: Sat Nov 28, 2015 6:01 am
Has thanked: 10 times
Been thanked: 4 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by nasanhak »

Ashtails wrote:Anyone know how to unlock the bandana and Ishmael hat in mgo by messing with the files like in this video?

https://m.youtube.com/watch?v=l18y3WR7ryg
Video was posted over six months ago lol. Love how Konami isn't interested in providing updates and unlocks to game at all.
Ashtails
beginner
Posts: 36
Joined: Sun Sep 20, 2015 8:57 pm

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by Ashtails »

nasanhak wrote:
Ashtails wrote:Anyone know how to unlock the bandana and Ishmael hat in mgo by messing with the files like in this video?

https://m.youtube.com/watch?v=l18y3WR7ryg
Video was posted over six months ago lol. Love how Konami isn't interested in providing updates and unlocks to game at all.
I'm guessing they are probably gonna release it either as a competition perk for a Japanese mgo match or a survival perk, either of which I don't like since I don't live in Japan and no one plays survival anymore and if they did play mgo for the bandana specifically I most likely wouldn't get a 5 win streak with d/c and everyone wanting one. I just want to see how it looks on my infiltrator because I don't use any hats on her
CantStoptheBipBop
advanced
Posts: 53
Joined: Sat Aug 27, 2016 9:43 am
Has thanked: 7 times
Been thanked: 7 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by CantStoptheBipBop »

nasanhak wrote:Video was posted over six months ago lol. Love how Konami isn't interested in providing updates and unlocks to game at all.
They're allergic to money. I'd throw my wallet at them for console DLC and a playable battlegear, but apparently console DLC ports are a buy-the-game-again exclusive, and making a usable vehicle as DLC from assets that are already there is a poor investment :lol: Maybe they should try adding more single-player content instead of banking all of their investment on MGO3. Or I guess they're banking everything on Survive right now. Though it honestly does look like it might be fun.

It took some searching and experimenting but I think I've got the fastest method of duplicate removals in my script now. It's damn fast when dealing with 1m+ entries at a time. Obviously only loading a table with undefined entry keys would be a major speed improvement, but that's too much of a pain to keep on top of to bother. The new version of the script is basically done aside from clutter variables laying around from trying multiple ways of writing the functions. Well it has one major bug right now that I can't pinpoint, so if someone could skim through it and point out the obvious for me I'd appreciate it. The problem is the tableHashMatch function returns a table value of zero after the script finishes its first loop. Everything works fine the first time, so I'm not sure what's up with that. Current code:

Code: Select all

local t,tHash,tD,math_random,os_time,cmd,io_open,dL,file,__,w1,w2,w3,w4,createBackup={},{},{},math.random,os.time,os.execute,io.open;file=io_open("newDict.txt");math.randomseed(os_time());math_random()
__,w1,w2,w3,w4="_","mb_staff_health_","","",""-- adjust 2nd to 5th variable to desired string for w1-w4. 1st is for inserting underscores between words or letters for bruteForce function.
createBackup=0-- 0/1 backup newDict.txt after each overwrite. False by default.
stringRepeatNum=5-- length of bruteForce function character generation.
local debugStart,runTime=os_time()

--cmd[["@echo off& tasklist /fi "imagename eq lua.exe" |find ":" > nul|| taskkill /f /im "lua.exe"|| @echo on&& prompt $B$T$B$S&& echo cmd found an existing lua.exe process but could not terminate it.&& echo Manually terminate the process with Task Manager to continue."]]
for line in file:lines() do
	t[#t+1]=line
end
file=io_open("hashList.txt")
for line in file:lines() do
	tHash[#tHash+1]=line+0
end
file=io_open("dictList.txt")
for line in file:lines() do
	tD[#tD+1]=line
end
dL=#tD


local function backup()
	cmd[["@echo off& if exist newDict.txt then xcopy /q /h /y newDict.txt "newDict - Backup.txt"|| prompt $B$T$B$S& echo Error cmd could not create a backup&& echo The file does not exist or xcopy failed to overwrite newDict - Backup.txt for some reason."]]
end


local function tableDictMatch(t1,t2)
	local t3,tHash,ipairs,n={},{},ipairs,#t1
	for i=1,#t2 do
		n=n+1
		t1[n]=t2[i]
	end
	n=0
	for _,v in ipairs(t1) do
		if (not tHash[v]) then
			n=n+1
			t3[n]=v
			tHash[v]=true
		end
	end
	cmd("echo dictMatch returned table length "..#t3)
	return t3
end

--returns table with only matching hashes
local function tableHashMatch(t1,t2)
	local t3,tHash,ipairs,n={},{},ipairs,0
	--removes duplicates from generated hashes
	for _,v in ipairs(t1) do
		if (not tHash[v]) then
			n=n+1
			t3[n]=v
			tHash[v]=true
		end
	end
	--sets up tHash for matching entries
	t1,tHash,n=t3,{},0;t3={}
	for _,v in ipairs(t2) do
		tHash[v]=true
	end
	--purges generated hashes that don't match hashlist
	for _,v in ipairs(t1) do
		if (tHash[v]) then
			n=n+1
			t3[n]=v
		end
	end
	return t3
end


local function runFoxString()
	local tTemp,m,tResult,n,indice2,file,varTemp={},{},{},0,0,"lang_dictionary_result.txt",{}
	cmd[["Fox.StrCode32.exe lang_dictionary.txt"]]
	file=io_open(file)
	for line in file:lines() do
		n=n+1
		tResult[n]=line
	end
	for i=1,#tResult do
		m[i]=((tResult[i]:match("%s([%d+]+)"))+0)
	end
	n,m=0,tableHashMatch(m,tHash)
	cmd("echo tableHashMatch finished")
	cmd("echo "..#m)
	t1,tHash,n=t3,{},0;t3={}
	--create table from raw generated hashes and LangIds
	for i=1,#tResult do
		n=n+1
		tTemp[n]=((tResult[i]:match("%s([%d+]+)"))+0)
		varTemp[n]=tResult[i]:match("([%a+,%d+,_]+)%s")
	end
	--convert returned tableHashMatch table (m) to LangId
	for i=1,#m do
		for I=1,#tTemp do
			if m[i]==tTemp[I] then
				m[i]=varTemp[I]
			end
		end
	end
	cmd("echo finished langId pull")
	m=tableDictMatch(m,t)
	cmd("echo "..#m)
	return m
end


local function dictionaryAttack()
	local startOfScript,file=os_time(),io_open("lang_dictionary.txt","w")
	while true do
		if os_time()>=startOfScript+1 then file:flush(); file:close(); break end
		local a,b,c
		a=tD[math_random(dL)]
		b=tD[math_random(dL)]
		--c=tD[math_random(dL)]
		file:write(w1..a,"\n")
	end
end


while true do
	dictionaryAttack()
	--bruteForce()
	local m,file=runFoxString(),io_open("newDict.txt","w")
	for i=1,#m do
		file:write(m[i],"\n")
	end
	file:flush(); file:close()
	if createBackup==1 then backup() end
	t,file={},io_open("newDict.txt")
	for line in file:lines() do
		t[#t+1]=line
	end
end
Tex
veteran
Posts: 89
Joined: Sat Aug 20, 2011 4:51 am
Has thanked: 21 times
Been thanked: 11 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by Tex »

What's you're reasoning behind your variable declaration stye?

Code: Select all

local t,tHash,tD,math_random,os_time,cmd,io_open,dL,file,__,w1,w2,w3,w4,createBackup={},{},{},math.random,os.time,os.execute,io.open;file=io_open("newDict.txt");math.randomseed(os_time());math_random()
__,w1,w2,w3,w4="_","mb_staff_health_","","",""-- adjust 2nd to 5th variable to desired string for w1-w4. 1st is for inserting underscores between words or letters for bruteForce function.
Instead of:

Code: Select all

local t={}--lang dictionary keys
local tHash={}--lang dictionary hashes

local math_random=math.random
local os_time=os.time
local cmd=os.execute
local io_open=io.open

--for generating attack key in dictionaryAttack function
local tD={}--dictionaryAttack words (dictList)
local dL=0--dictList length
local __="_"--for inserting underscores between words or letters for bruteForce function.
local w1="mb_staff_health_"
local w2=""
local w3=""
local w4=""

math.randomseed(os_time())
math_random()

local file=io_open("newDict.txt")
It hurts legibility/maintainability/makes me scared, lol
lua is first compiled to bytecode on loading lua file then run, rather than full interpreted from text if that's your worry.


I'm thinking you could write out matching keys and hashes two matching files (so line number = match across files)
and a 3rd for as yet unmatched

So it would be:
Only as input:
attack_dictionary.txt (lang_dictionary.txt in your posted script) - a list of potential keys, ex scrape of lua strings, or output from your dictionary attack function
As both input/output
unknown_hashes.txt - initially pulled from scraping lng.xml Key="" entries/hashes, but using culled/updated version after script has been run.
lang_dictionary.txt (newDict.txt in your posted script) - the ultimate goal, for use by langtool, initially empty but built up by script
lang_hashes.txt (hashList.txt in your posted script) - hashes matching keys/lines in lang_dictionary, initially empty but built up by script

Also do you have your initial hash grab from lng files > hashList.txt function?
Post Reply