mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 17:05:10 +08:00
Peds form progress, new MetaNames, ped ymt metas parsing
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
|
||||
using TC = System.ComponentModel.TypeConverterAttribute;
|
||||
using EXP = System.ComponentModel.ExpandableObjectConverter;
|
||||
|
||||
namespace CodeWalker.GameFiles
|
||||
{
|
||||
[TC(typeof(EXP))] public class PedFile : GameFile, PackedFile
|
||||
{
|
||||
public Meta Meta { get; set; }
|
||||
public PsoFile Pso { get; set; }
|
||||
public RbfFile Rbf { get; set; }
|
||||
public string Xml { get; set; }
|
||||
|
||||
public MCPedVariationInfo VariationInfo { get; set; }
|
||||
|
||||
|
||||
|
||||
public string[] Strings { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
public PedFile() : base(null, GameFileType.Ped)
|
||||
{ }
|
||||
public PedFile(RpfFileEntry entry) : base(entry, GameFileType.Ped)
|
||||
{ }
|
||||
|
||||
public void Load(byte[] data, RpfFileEntry entry)
|
||||
{
|
||||
RpfFileEntry = entry;
|
||||
Name = entry.Name;
|
||||
FilePath = Name;
|
||||
|
||||
|
||||
RpfResourceFileEntry resentry = entry as RpfResourceFileEntry;
|
||||
if (resentry == null)
|
||||
{
|
||||
NonMetaLoad(data);
|
||||
Loaded = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ResourceDataReader rd = new ResourceDataReader(resentry, data);
|
||||
|
||||
Meta = rd.ReadBlock<Meta>();
|
||||
|
||||
|
||||
LoadMeta();
|
||||
|
||||
|
||||
|
||||
Loaded = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void LoadMeta()
|
||||
{
|
||||
var vVariationInfo = MetaTypes.GetTypedData<CPedVariationInfo>(Meta, MetaName.CPedVariationInfo);
|
||||
VariationInfo = new MCPedVariationInfo();
|
||||
VariationInfo.Load(Meta, vVariationInfo);
|
||||
|
||||
Strings = MetaTypes.GetStrings(Meta);
|
||||
if (Strings != null)
|
||||
{
|
||||
foreach (string str in Strings)
|
||||
{
|
||||
JenkIndex.Ensure(str); //just shove them in there
|
||||
}
|
||||
}
|
||||
}
|
||||
private void LoadPso()
|
||||
{
|
||||
|
||||
var vVariationInfo = PsoTypes.GetRootItem<CPedVariationInfo>(Pso);
|
||||
VariationInfo = new MCPedVariationInfo();
|
||||
VariationInfo.Load(Pso, vVariationInfo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void NonMetaLoad(byte[] data)
|
||||
{
|
||||
//non meta not supported yet! but see what's in there...
|
||||
MemoryStream ms = new MemoryStream(data);
|
||||
if (RbfFile.IsRBF(ms))
|
||||
{
|
||||
Rbf = new RbfFile();
|
||||
Rbf.Load(ms);
|
||||
}
|
||||
else if (PsoFile.IsPSO(ms))
|
||||
{
|
||||
Pso = new PsoFile();
|
||||
Pso.Load(ms);
|
||||
LoadPso();
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -23,8 +23,7 @@ namespace CodeWalker.GameFiles
|
||||
public PedsFile() : base(null, GameFileType.Peds)
|
||||
{ }
|
||||
public PedsFile(RpfFileEntry entry) : base(entry, GameFileType.Peds)
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
public void Load(byte[] data, RpfFileEntry entry)
|
||||
{
|
||||
|
||||
@@ -89,12 +89,13 @@ namespace CodeWalker.GameFiles
|
||||
if (resentry == null)
|
||||
{
|
||||
NonMetaLoad(data);
|
||||
Loaded = true;
|
||||
return;
|
||||
}
|
||||
|
||||
ResourceDataReader rd = new ResourceDataReader(resentry, data);
|
||||
|
||||
Meta = rd.ReadBlock<Meta>();
|
||||
Meta = rd.ReadBlock<Meta>();//maybe null this after load to reduce memory consumption?
|
||||
|
||||
|
||||
|
||||
@@ -232,12 +233,12 @@ namespace CodeWalker.GameFiles
|
||||
MemoryStream ms = new MemoryStream(data);
|
||||
if (RbfFile.IsRBF(ms))
|
||||
{
|
||||
var Rbf = new RbfFile();
|
||||
Rbf = new RbfFile();
|
||||
Rbf.Load(ms);
|
||||
}
|
||||
else if (PsoFile.IsPSO(ms))
|
||||
{
|
||||
var Pso = new PsoFile();
|
||||
Pso = new PsoFile();
|
||||
Pso.Load(ms);
|
||||
//PsoTypes.EnsurePsoTypes(Pso);
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ namespace CodeWalker.GameFiles
|
||||
CarVariations = 20,
|
||||
VehicleLayouts = 21,
|
||||
Peds = 22,
|
||||
Ped = 23,
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -80,6 +80,9 @@ namespace CodeWalker.GameFiles
|
||||
|
||||
public Dictionary<MetaHash, VehicleInitData> VehiclesInitDict { get; set; }
|
||||
public Dictionary<MetaHash, CPedModelInfo__InitData> PedsInitDict { get; set; }
|
||||
public Dictionary<MetaHash, PedFile> PedVariationsDict { get; set; }
|
||||
public Dictionary<MetaHash, Dictionary<MetaHash, RpfFileEntry>> PedDrawableDicts { get; set; }
|
||||
public Dictionary<MetaHash, Dictionary<MetaHash, RpfFileEntry>> PedTextureDicts { get; set; }
|
||||
|
||||
public List<RpfFile> BaseRpfs { get; private set; }
|
||||
public List<RpfFile> AllRpfs { get; private set; }
|
||||
@@ -1602,9 +1605,72 @@ namespace CodeWalker.GameFiles
|
||||
if (!LoadPeds) return;
|
||||
|
||||
IEnumerable<RpfFile> rpfs = PreloadedMode ? AllRpfs : (IEnumerable<RpfFile>)ActiveMapRpfFiles.Values;
|
||||
List<RpfFile> dlcrpfs = new List<RpfFile>();
|
||||
if (EnableDlc)
|
||||
{
|
||||
foreach (var rpf in DlcActiveRpfs)
|
||||
{
|
||||
dlcrpfs.Add(rpf);
|
||||
if (rpf.Children == null) continue;
|
||||
foreach (var crpf in rpf.Children)
|
||||
{
|
||||
dlcrpfs.Add(crpf);
|
||||
if (crpf.Children?.Count > 0)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var allPeds = new Dictionary<MetaHash, CPedModelInfo__InitData>();
|
||||
var allPedsFiles = new List<PedsFile>();
|
||||
var allPedYmts = new Dictionary<MetaHash, PedFile>();
|
||||
var allPedDrwDicts = new Dictionary<MetaHash, Dictionary<MetaHash, RpfFileEntry>>();
|
||||
var allPedTexDicts = new Dictionary<MetaHash, Dictionary<MetaHash, RpfFileEntry>>();
|
||||
|
||||
|
||||
var addPedDicts = new Action<string, MetaHash, RpfDirectoryEntry>((namel, hash, dir)=>
|
||||
{
|
||||
if (dir?.Directories != null)
|
||||
{
|
||||
foreach (var cdir in dir.Directories)
|
||||
{
|
||||
if (cdir.NameLower == namel)
|
||||
{
|
||||
dir = cdir;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var files = dir?.Files;
|
||||
if (files != null)
|
||||
{
|
||||
Dictionary<MetaHash, RpfFileEntry> dict = null;
|
||||
foreach (var file in files)
|
||||
{
|
||||
if (file?.NameLower == null) continue;
|
||||
if (file.NameLower.EndsWith(".ydd"))
|
||||
{
|
||||
if (!allPedDrwDicts.TryGetValue(hash, out dict))
|
||||
{
|
||||
dict = new Dictionary<MetaHash, RpfFileEntry>();
|
||||
allPedDrwDicts[hash] = dict;
|
||||
}
|
||||
dict[file.ShortNameHash] = file;
|
||||
}
|
||||
else if (file.NameLower.EndsWith(".ytd"))
|
||||
{
|
||||
if (!allPedTexDicts.TryGetValue(hash, out dict))
|
||||
{
|
||||
dict = new Dictionary<MetaHash, RpfFileEntry>();
|
||||
allPedTexDicts[hash] = dict;
|
||||
}
|
||||
dict[file.ShortNameHash] = file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var addPedsFiles = new Action<IEnumerable<RpfFile>>((from) =>
|
||||
{
|
||||
@@ -1643,19 +1709,66 @@ namespace CodeWalker.GameFiles
|
||||
#endif
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var addPedFiles = new Action<IEnumerable<RpfFile>>((from) =>
|
||||
{
|
||||
foreach (RpfFile file in from)
|
||||
{
|
||||
if (file.AllEntries == null) continue;
|
||||
foreach (RpfEntry entry in file.AllEntries)
|
||||
{
|
||||
#if !DEBUG
|
||||
try
|
||||
#endif
|
||||
{
|
||||
if (entry.NameLower.EndsWith(".ymt"))
|
||||
{
|
||||
var testname = entry.GetShortNameLower();
|
||||
var testhash = JenkHash.GenHash(testname);
|
||||
if (allPeds.ContainsKey(testhash))
|
||||
{
|
||||
var pf = RpfMan.GetFile<PedFile>(entry);
|
||||
if (pf != null)
|
||||
{
|
||||
allPedYmts[testhash] = pf;
|
||||
addPedDicts(testname, testhash, entry.Parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#if !DEBUG
|
||||
catch (Exception ex)
|
||||
{
|
||||
string errstr = entry.Path + "\n" + ex.ToString();
|
||||
ErrorLog(errstr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
addPedsFiles(rpfs);
|
||||
|
||||
if (EnableDlc)
|
||||
{
|
||||
addPedsFiles(DlcActiveRpfs);
|
||||
}
|
||||
addPedsFiles(rpfs);
|
||||
addPedsFiles(dlcrpfs);
|
||||
|
||||
addPedFiles(rpfs);
|
||||
addPedFiles(dlcrpfs);
|
||||
|
||||
|
||||
|
||||
PedsInitDict = allPeds;
|
||||
PedVariationsDict = allPedYmts;
|
||||
PedDrawableDicts = allPedDrwDicts;
|
||||
PedTextureDicts = allPedTexDicts;
|
||||
|
||||
|
||||
foreach (var kvp in PedsInitDict)
|
||||
{
|
||||
if (!PedVariationsDict.ContainsKey(kvp.Key))
|
||||
{ }//checking we found them all!
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1726,7 +1839,7 @@ namespace CodeWalker.GameFiles
|
||||
|
||||
|
||||
|
||||
private void TryLoadEnqueue(GameFile gf)
|
||||
public void TryLoadEnqueue(GameFile gf)
|
||||
{
|
||||
if (((!gf.Loaded)) && (requestQueue.Count < 10))// && (!gf.LoadQueued)
|
||||
{
|
||||
@@ -2099,6 +2212,13 @@ namespace CodeWalker.GameFiles
|
||||
}
|
||||
|
||||
|
||||
public T GetFileUncached<T>(RpfFileEntry e) where T : GameFile, new()
|
||||
{
|
||||
var f = new T();
|
||||
f.RpfFileEntry = e;
|
||||
TryLoadEnqueue(f);
|
||||
return f;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -653,13 +653,14 @@ namespace CodeWalker.GameFiles
|
||||
Unk1 = 0;
|
||||
}
|
||||
|
||||
public void SwapEnd()
|
||||
public Array_Structure SwapEnd()
|
||||
{
|
||||
Pointer = MetaTypes.SwapBytes(Pointer);
|
||||
Unk0 = MetaTypes.SwapBytes(Unk0);
|
||||
Count1 = MetaTypes.SwapBytes(Count1);
|
||||
Count2 = MetaTypes.SwapBytes(Count2);
|
||||
Unk1 = MetaTypes.SwapBytes(Unk1);
|
||||
return this;
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
@@ -963,6 +964,10 @@ namespace CodeWalker.GameFiles
|
||||
[TC(typeof(EXP))] public struct ArrayOfBytes3 //array of 3 bytes
|
||||
{
|
||||
public byte b0, b1, b2;
|
||||
public byte[] GetArray()
|
||||
{
|
||||
return new[] { b0, b1, b2 };
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return b0.ToString() + ", " + b1.ToString() + ", " + b2.ToString();
|
||||
@@ -971,6 +976,10 @@ namespace CodeWalker.GameFiles
|
||||
[TC(typeof(EXP))] public struct ArrayOfBytes4 //array of 4 bytes
|
||||
{
|
||||
public byte b0, b1, b2, b3;
|
||||
public byte[] GetArray()
|
||||
{
|
||||
return new[] { b0, b1, b2, b3 };
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return b0.ToString() + ", " + b1.ToString() + ", " + b2.ToString() + ", " + b3.ToString();
|
||||
@@ -979,14 +988,26 @@ namespace CodeWalker.GameFiles
|
||||
[TC(typeof(EXP))] public struct ArrayOfBytes5 //array of 5 bytes
|
||||
{
|
||||
public byte b0, b1, b2, b3, b4;
|
||||
public byte[] GetArray()
|
||||
{
|
||||
return new[] { b0, b1, b2, b3, b4 };
|
||||
}
|
||||
}
|
||||
[TC(typeof(EXP))] public struct ArrayOfBytes6 //array of 6 bytes
|
||||
{
|
||||
public byte b0, b1, b2, b3, b4, b5;
|
||||
public byte[] GetArray()
|
||||
{
|
||||
return new[] { b0, b1, b2, b3, b4, b5 };
|
||||
}
|
||||
}
|
||||
[TC(typeof(EXP))] public struct ArrayOfBytes12 //array of 12 bytes
|
||||
{
|
||||
public byte b00, b01, b02, b03, b04, b05, b06, b07, b08, b09, b10, b11;
|
||||
public byte[] GetArray()
|
||||
{
|
||||
return new[] { b00, b01, b02, b03, b04, b05, b06, b07, b08, b09, b10, b11 };
|
||||
}
|
||||
}
|
||||
[TC(typeof(EXP))] public struct ArrayOfChars64 //array of 64 chars (bytes)
|
||||
{
|
||||
|
||||
@@ -3489,16 +3489,23 @@ namespace CodeWalker.GameFiles
|
||||
ePedRadioGenre = 2942646938,
|
||||
eSexinessFlags = 374769227,
|
||||
eExternallyDrivenDOFs = 637184392,
|
||||
eAnchorPoints = 2834549053,
|
||||
SpecialAbilityType = 2011786168,
|
||||
DefaultSpawnPreference = 888587604,
|
||||
numAlternatives = 2806194106,
|
||||
|
||||
CScenarioChainingEdge__eAction = 3609807418,
|
||||
CScenarioChainingEdge__eNavMode = 3971773454,
|
||||
CScenarioChainingEdge__eNavSpeed = 941086046,
|
||||
CStreamingRequestCommonSet = 1358189812,
|
||||
|
||||
animal = 974042365, //in peds.ymt
|
||||
standard_ped = 2703423328, //in peds.ymt
|
||||
standard_male = 1860494962, //in peds.ymt PedCapsuleName
|
||||
standard_male = 1860494962, //in peds.ymt PedCapsuleName - from pedbounds.xml
|
||||
standard_female = 3778684510, //in peds.ymt PedCapsuleName
|
||||
standard_player_male = 190297546, //in peds.ymt PedCapsuleName
|
||||
standard_player_female = 3813733509, //in peds.ymt PedCapsuleName
|
||||
large_male = 2182606047, //in peds.ymt PedCapsuleName
|
||||
facial_clipset_group_gen_male = 2968316036, //in peds.ymt FacialClipsetGroupName
|
||||
facial_clipset_group_gen_female = 984918963, //in peds.ymt FacialClipsetGroupName
|
||||
facial_clipset_group_p_m_zero = 3839850645, //in peds.ymt FacialClipsetGroupName
|
||||
@@ -3542,6 +3549,17 @@ namespace CodeWalker.GameFiles
|
||||
|
||||
|
||||
|
||||
//ped ymt's hashes from Siprus
|
||||
numAvailProps = 2598445407,
|
||||
numAvailTex = 3371516811,
|
||||
ownsCloth = 2828247905,
|
||||
aComponentData3 = 3796409423, //is this a collision? it's good enough for now!
|
||||
bHasTexVariations = 1235281004,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//GranularSound dat54.rel FileName hashes from NotGigo
|
||||
engine_accel = 3748922026,
|
||||
exhaust_accel = 598446449,
|
||||
|
||||
@@ -436,7 +436,7 @@ namespace CodeWalker.GameFiles
|
||||
return new MetaStructureInfo(MetaName.CStreamingRequestRecord, 3825587854, 768, 40,
|
||||
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Structure, 0, 0, MetaName.CStreamingRequestFrame),
|
||||
new MetaStructureEntryInfo_s(MetaName.Frames, 0, MetaStructureEntryDataType.Array, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Structure, 0, 0, (MetaName)1358189812),
|
||||
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Structure, 0, 0, MetaName.CStreamingRequestCommonSet),
|
||||
new MetaStructureEntryInfo_s(MetaName.CommonSets, 16, MetaStructureEntryDataType.Array, 0, 2, 0),
|
||||
new MetaStructureEntryInfo_s(MetaName.NewStyle, 32, MetaStructureEntryDataType.Boolean, 0, 0, 0)
|
||||
);
|
||||
@@ -466,8 +466,8 @@ namespace CodeWalker.GameFiles
|
||||
// new MetaStructureEntryInfo_s((MetaName)1762439591, 64, MetaStructureEntryDataType.Array, 0, 6, 0),
|
||||
// new MetaStructureEntryInfo_s(MetaName.Flags, 80, MetaStructureEntryDataType.UnsignedInt, 0, 0, 0)
|
||||
// );
|
||||
case (MetaName)1358189812:
|
||||
return new MetaStructureInfo((MetaName)1358189812, 3710200606, 768, 16,
|
||||
case MetaName.CStreamingRequestCommonSet:
|
||||
return new MetaStructureInfo(MetaName.CStreamingRequestCommonSet, 3710200606, 768, 16,
|
||||
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Hash, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s(MetaName.Requests, 0, MetaStructureEntryDataType.Array, 0, 0, 0)
|
||||
);
|
||||
@@ -1009,7 +1009,7 @@ namespace CodeWalker.GameFiles
|
||||
);
|
||||
case MetaName.CPedPropInfo:
|
||||
return new MetaStructureInfo(MetaName.CPedPropInfo, 1792487819, 768, 40,
|
||||
new MetaStructureEntryInfo_s((MetaName)2598445407, 0, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s(MetaName.numAvailProps, 0, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Structure, 0, 0, MetaName.CPedPropMetaData),
|
||||
new MetaStructureEntryInfo_s(MetaName.aPropMetaData, 8, MetaStructureEntryDataType.Array, 0, 1, 0),
|
||||
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Structure, 0, 0, MetaName.CAnchorProps),
|
||||
@@ -1017,14 +1017,14 @@ namespace CodeWalker.GameFiles
|
||||
);
|
||||
case MetaName.CPedVariationInfo:
|
||||
return new MetaStructureInfo(MetaName.CPedVariationInfo, 4030871161, 768, 112,
|
||||
new MetaStructureEntryInfo_s((MetaName)1235281004, 0, MetaStructureEntryDataType.Boolean, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s(MetaName.bHasTexVariations, 0, MetaStructureEntryDataType.Boolean, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s((MetaName)4086467184, 1, MetaStructureEntryDataType.Boolean, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s((MetaName)911147899, 2, MetaStructureEntryDataType.Boolean, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s((MetaName)315291935, 3, MetaStructureEntryDataType.Boolean, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s((MetaName)2996560424, 4, MetaStructureEntryDataType.ArrayOfBytes, 0, 4, (MetaName)MetaTypeName.PsoPOINTER),
|
||||
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Structure, 0, 0, (MetaName)3538495220),
|
||||
new MetaStructureEntryInfo_s((MetaName)3796409423, 16, MetaStructureEntryDataType.Array, 0, 6, 0),
|
||||
new MetaStructureEntryInfo_s(MetaName.aComponentData3, 16, MetaStructureEntryDataType.Array, 0, 6, 0),
|
||||
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Structure, 0, 0, MetaName.CPedSelectionSet),
|
||||
new MetaStructureEntryInfo_s(MetaName.aSelectionSets, 32, MetaStructureEntryDataType.Array, 0, 8, 0),
|
||||
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Structure, 0, 0, MetaName.CComponentInfo),
|
||||
@@ -1034,18 +1034,18 @@ namespace CodeWalker.GameFiles
|
||||
);
|
||||
case (MetaName)3538495220:
|
||||
return new MetaStructureInfo((MetaName)3538495220, 2024084511, 768, 24,
|
||||
new MetaStructureEntryInfo_s((MetaName)3371516811, 0, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s(MetaName.numAvailTex, 0, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Structure, 0, 0, (MetaName)1535046754),
|
||||
new MetaStructureEntryInfo_s((MetaName)1756136273, 8, MetaStructureEntryDataType.Array, 0, 1, 0)
|
||||
);
|
||||
case (MetaName)2236980467:
|
||||
return new MetaStructureInfo((MetaName)2236980467, 508935687, 0, 24,
|
||||
new MetaStructureEntryInfo_s((MetaName)2828247905, 0, MetaStructureEntryDataType.Boolean, 0, 0, 0)
|
||||
new MetaStructureEntryInfo_s(MetaName.ownsCloth, 0, MetaStructureEntryDataType.Boolean, 0, 0, 0)
|
||||
);
|
||||
case (MetaName)1535046754:
|
||||
return new MetaStructureInfo((MetaName)1535046754, 124073662, 768, 48,
|
||||
new MetaStructureEntryInfo_s(MetaName.propMask, 0, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s((MetaName)2806194106, 1, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s(MetaName.numAlternatives, 1, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.Structure, 0, 0, (MetaName)1036962405),
|
||||
new MetaStructureEntryInfo_s(MetaName.aTexData, 8, MetaStructureEntryDataType.Array, 0, 2, 0),
|
||||
new MetaStructureEntryInfo_s(MetaName.clothData, 24, MetaStructureEntryDataType.Structure, 0, 0, (MetaName)2236980467)
|
||||
@@ -1096,7 +1096,7 @@ namespace CodeWalker.GameFiles
|
||||
return new MetaStructureInfo(MetaName.CAnchorProps, 403574180, 768, 24,
|
||||
new MetaStructureEntryInfo_s((MetaName)MetaTypeName.ARRAYINFO, 0, MetaStructureEntryDataType.UnsignedByte, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s(MetaName.props, 0, MetaStructureEntryDataType.Array, 0, 0, 0),
|
||||
new MetaStructureEntryInfo_s(MetaName.anchor, 16, MetaStructureEntryDataType.IntEnum, 0, 0, (MetaName)2834549053)
|
||||
new MetaStructureEntryInfo_s(MetaName.anchor, 16, MetaStructureEntryDataType.IntEnum, 0, 0, MetaName.eAnchorPoints)
|
||||
);
|
||||
case MetaName.CPedSelectionSet:
|
||||
return new MetaStructureInfo(MetaName.CPedSelectionSet, 3120284999, 512, 48,
|
||||
@@ -1386,8 +1386,8 @@ namespace CodeWalker.GameFiles
|
||||
new MetaEnumEntryInfo_s((MetaName)3735238938, 1),
|
||||
new MetaEnumEntryInfo_s((MetaName)3395845123, 2)
|
||||
);
|
||||
case (MetaName)2834549053:
|
||||
return new MetaEnumInfo((MetaName)2834549053, 1309372691,
|
||||
case MetaName.eAnchorPoints:
|
||||
return new MetaEnumInfo(MetaName.eAnchorPoints, 1309372691,
|
||||
new MetaEnumEntryInfo_s(MetaName.ANCHOR_HEAD, 0),
|
||||
new MetaEnumEntryInfo_s(MetaName.ANCHOR_EYES, 1),
|
||||
new MetaEnumEntryInfo_s(MetaName.ANCHOR_EARS, 2),
|
||||
@@ -2264,7 +2264,7 @@ namespace CodeWalker.GameFiles
|
||||
Unk_3395845123 = 2,
|
||||
}
|
||||
|
||||
public enum Unk_2834549053 //component peds CAnchorProps anchor
|
||||
public enum eAnchorPoints //component peds CAnchorProps eAnchorPoints
|
||||
: int //Key:1309372691
|
||||
{
|
||||
ANCHOR_HEAD = 0,
|
||||
@@ -5880,9 +5880,9 @@ namespace CodeWalker.GameFiles
|
||||
|
||||
public struct CStreamingRequestRecord //40 bytes, Key:3825587854 //SRL YMT ROOT - in /streaming/ folder
|
||||
{
|
||||
public Array_Structure Frames { get; set; } //0 0: Array: 0: Frames//419044527 {0: Structure: CStreamingRequestFrame//999226379: 256}
|
||||
public Array_Structure CommonSets { get; set; } //16 16: Array: 0: CommonSets//4248405899 {0: Structure: 1358189812: 256}
|
||||
public byte NewStyle { get; set; } //32 32: Boolean: 0: 2333392588
|
||||
public Array_Structure Frames { get; set; } //0 0: Array: 0: Frames {0: Structure: CStreamingRequestFrame: 256}
|
||||
public Array_Structure CommonSets { get; set; } //16 16: Array: 0: CommonSets {0: Structure: CStreamingRequestCommonSet: 256}
|
||||
public byte NewStyle { get; set; } //32 32: Boolean: 0: NewStyle
|
||||
public byte Unused0 { get; set; }//33
|
||||
public ushort Unused1 { get; set; }//34
|
||||
public uint Unused2 { get; set; }//36
|
||||
@@ -5919,9 +5919,9 @@ namespace CodeWalker.GameFiles
|
||||
public uint Unused4 { get; set; }//92
|
||||
}
|
||||
|
||||
public struct Unk_1358189812 //16 bytes, Key:3710200606 //SRL hashes list?
|
||||
public struct CStreamingRequestCommonSet //16 bytes, Key:3710200606 //SRL common set
|
||||
{
|
||||
public Array_uint Requests { get; set; } //0 0: Array: 0: Requests//2743119154 {0: Hash: 0: 256}
|
||||
public Array_uint Requests { get; set; } //0 0: Array: 0: Requests {0: Hash: 0: 256}
|
||||
}
|
||||
|
||||
|
||||
@@ -5990,41 +5990,290 @@ namespace CodeWalker.GameFiles
|
||||
|
||||
|
||||
|
||||
public struct CPedVariationInfo //112 bytes, Key:4030871161 //COMPONENT PEDS YMT ROOT - in componentpeds .rpf's
|
||||
public struct CPedVariationInfo : IPsoSwapEnd //112 bytes, Key:4030871161 //COMPONENT PEDS YMT ROOT - in componentpeds .rpf's
|
||||
{
|
||||
public byte Unk_1235281004 { get; set; } //0 0: Boolean: 0: 1235281004
|
||||
public byte bHasTexVariations { get; set; } //0 0: Boolean: 0: bHasTexVariations
|
||||
public byte Unk_4086467184 { get; set; } //1 1: Boolean: 0: 4086467184
|
||||
public byte Unk_911147899 { get; set; } //2 2: Boolean: 0: 911147899
|
||||
public byte Unk_315291935 { get; set; } //3 3: Boolean: 0: 315291935
|
||||
public ArrayOfBytes12 Unk_2996560424 { get; set; } //4 4: ArrayOfBytes: 12: 2996560424
|
||||
public Array_Structure Unk_3796409423 { get; set; } //16 16: Array: 0: 3796409423 {0: Structure: 3538495220: 256}
|
||||
public Array_Structure aSelectionSets { get; set; } //32 32: Array: 0: aSelectionSets {0: Structure: 253191135: 256}
|
||||
public Array_Structure compInfos { get; set; } //48 48: Array: 0: compInfos//592652859 {0: Structure: CComponentInfo//1866571721: 256}
|
||||
public CPedPropInfo propInfo { get; set; } //64 64: Structure: 2858946626: propInfo//2240851416
|
||||
public Array_Structure aComponentData3 { get; set; } //16 16: Array: 0: aComponentData3 {0: Structure: 3538495220: 256}
|
||||
public Array_Structure aSelectionSets { get; set; } //32 32: Array: 0: aSelectionSets {0: Structure: CPedSelectionSet: 256}
|
||||
public Array_Structure compInfos { get; set; } //48 48: Array: 0: compInfos {0: Structure: CComponentInfo: 256}
|
||||
public CPedPropInfo propInfo { get; set; } //64 64: Structure: CPedPropInfo: propInfo
|
||||
public MetaHash dlcName { get; set; } //104 104: Hash: 0: dlcName
|
||||
public uint Unused0 { get; set; }//108
|
||||
|
||||
public void SwapEnd()
|
||||
{
|
||||
aComponentData3 = aComponentData3.SwapEnd();
|
||||
aSelectionSets = aSelectionSets.SwapEnd();
|
||||
compInfos = compInfos.SwapEnd();
|
||||
propInfo = propInfo.SwapEnd();
|
||||
dlcName = MetaTypes.SwapBytes(dlcName);
|
||||
}
|
||||
}
|
||||
public class MCPedVariationInfo : MetaWrapper
|
||||
{
|
||||
public CPedVariationInfo _Data;
|
||||
public CPedVariationInfo Data { get { return _Data; } }
|
||||
|
||||
public byte[] ComponentIndices { get; set; }
|
||||
public MUnk_3538495220[] ComponentVariations { get; set; }
|
||||
public MCPedSelectionSet[] SelectionSets { get; set; }
|
||||
public MCComponentInfo[] CompInfos { get; set; }
|
||||
public MCPedPropInfo PropInfo { get; set; }
|
||||
|
||||
|
||||
public override void Load(Meta meta, MetaPOINTER ptr)
|
||||
{
|
||||
var data = MetaTypes.GetData<CPedVariationInfo>(meta, ptr);
|
||||
Load(meta, data);
|
||||
}
|
||||
public void Load(Meta meta, CPedVariationInfo data)
|
||||
{
|
||||
//maybe see https://github.com/emcifuntik/altv-cloth-tool/blob/master/AltTool/ResourceBuilder.cs
|
||||
|
||||
|
||||
_Data = data;
|
||||
|
||||
ComponentIndices = data.Unk_2996560424.GetArray();
|
||||
|
||||
|
||||
var vComponentVariations = MetaTypes.ConvertDataArray<Unk_3538495220>(meta, (MetaName)3538495220, _Data.aComponentData3);
|
||||
if (vComponentVariations != null)
|
||||
{
|
||||
ComponentVariations = new MUnk_3538495220[vComponentVariations.Length];
|
||||
for (int i = 0; i < vComponentVariations.Length; i++)
|
||||
{
|
||||
ComponentVariations[i] = new MUnk_3538495220(meta, vComponentVariations[i], this);
|
||||
}
|
||||
}
|
||||
|
||||
var vSelectionSets = MetaTypes.ConvertDataArray<CPedSelectionSet>(meta, MetaName.CPedSelectionSet, _Data.aSelectionSets);
|
||||
if (vSelectionSets != null)
|
||||
{
|
||||
SelectionSets = new MCPedSelectionSet[vSelectionSets.Length];
|
||||
for (int i = 0; i < vSelectionSets.Length; i++)
|
||||
{
|
||||
SelectionSets[i] = new MCPedSelectionSet(meta, vSelectionSets[i], this);
|
||||
}
|
||||
}
|
||||
|
||||
var vCompInfos = MetaTypes.ConvertDataArray<CComponentInfo>(meta, MetaName.CComponentInfo, _Data.compInfos);
|
||||
if (vCompInfos != null)
|
||||
{
|
||||
CompInfos = new MCComponentInfo[vCompInfos.Length];
|
||||
for (int i = 0; i < vCompInfos.Length; i++)
|
||||
{
|
||||
CompInfos[i] = new MCComponentInfo(meta, vCompInfos[i], this);
|
||||
}
|
||||
}
|
||||
|
||||
PropInfo = new MCPedPropInfo(meta, data.propInfo, this);
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < 12; i++) //set the component type indices on all the component variants, for them to use
|
||||
{
|
||||
var compInd = ComponentIndices[i];
|
||||
if ((compInd > 0) && (compInd < ComponentVariations?.Length))
|
||||
{
|
||||
var compvar = ComponentVariations[compInd];
|
||||
compvar.ComponentType = i;
|
||||
|
||||
if (compvar.Variations != null)
|
||||
{
|
||||
foreach (var cvp in compvar.Variations)
|
||||
{
|
||||
cvp.ComponentType = i;
|
||||
//cvp.GetDrawableName();//testing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
public void Load(PsoFile pso, CPedVariationInfo data)
|
||||
{
|
||||
//TODO!
|
||||
}
|
||||
|
||||
public override MetaPOINTER Save(MetaBuilder mb)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
public MUnk_3538495220 GetVariations(int componentType)
|
||||
{
|
||||
if ((componentType < 0) || (componentType > 11)) return null;
|
||||
if (ComponentIndices == null) return null;
|
||||
var index = ComponentIndices[componentType];
|
||||
if (index > ComponentVariations?.Length) return null;
|
||||
return ComponentVariations[index];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public struct Unk_3538495220 //24 bytes, Key:2024084511 //COMPONENT PEDS unknown
|
||||
public struct Unk_3538495220 //24 bytes, Key:2024084511 //COMPONENT PEDS component variations item
|
||||
{
|
||||
public byte Unk_3371516811 { get; set; } //0 0: UnsignedByte: 0: 3371516811
|
||||
public byte numAvailTex { get; set; } //0 0: UnsignedByte: 0: numAvailTex
|
||||
public byte Unused0 { get; set; }//1
|
||||
public ushort Unused1 { get; set; }//2
|
||||
public uint Unused2 { get; set; }//4
|
||||
public Array_Structure Unk_1756136273 { get; set; } //8 8: Array: 0: 1756136273 {0: Structure: 1535046754: 256}
|
||||
}
|
||||
|
||||
public struct Unk_1535046754 //48 bytes, Key:124073662 //COMPONENT PEDS unknown /cloth?
|
||||
public class MUnk_3538495220 : MetaWrapper
|
||||
{
|
||||
public byte propMask { get; set; } //0 0: UnsignedByte: 0: propMask//2932859459
|
||||
public byte Unk_2806194106 { get; set; } //1 1: UnsignedByte: 0: 2806194106
|
||||
public ushort Unused0 { get; set; }//2
|
||||
public uint Unused1 { get; set; }//4
|
||||
public Array_Structure aTexData { get; set; } //8 8: Array: 0: aTexData//1251090986 {0: Structure: 1036962405: 256}
|
||||
public Unk_2236980467 clothData { get; set; } //24 24: Structure: 2236980467: clothData//2464583091
|
||||
public MCPedVariationInfo Owner { get; set; }
|
||||
|
||||
public Unk_3538495220 _Data;
|
||||
public Unk_3538495220 Data { get { return _Data; } }
|
||||
|
||||
|
||||
public MUnk_1535046754[] Variations { get; set; }
|
||||
|
||||
public int ComponentType { get; set; } = 0;
|
||||
public static string[] ComponentTypeNames { get; } =
|
||||
{
|
||||
"head",//0
|
||||
"berd",//1
|
||||
"hair",//2
|
||||
"uppr",//3
|
||||
"lowr",//4
|
||||
"hand",//5
|
||||
"feet",//6
|
||||
"teef",//7
|
||||
"accs",//8
|
||||
"task",//9
|
||||
"decl",//10
|
||||
"jbib",//11
|
||||
};
|
||||
|
||||
|
||||
public MUnk_3538495220() { }
|
||||
public MUnk_3538495220(Meta meta, Unk_3538495220 data, MCPedVariationInfo owner)
|
||||
{
|
||||
_Data = data;
|
||||
Owner = owner;
|
||||
Init(meta);
|
||||
}
|
||||
|
||||
|
||||
private void Init(Meta meta)
|
||||
{
|
||||
var vVariations = MetaTypes.ConvertDataArray<Unk_1535046754>(meta, (MetaName)1535046754, _Data.Unk_1756136273);
|
||||
if (vVariations != null)
|
||||
{
|
||||
Variations = new MUnk_1535046754[vVariations.Length];
|
||||
for (int i = 0; i < vVariations.Length; i++)
|
||||
{
|
||||
Variations[i] = new MUnk_1535046754(meta, vVariations[i], this, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void Load(Meta meta, MetaPOINTER ptr)
|
||||
{
|
||||
_Data = MetaTypes.GetData<Unk_3538495220>(meta, ptr);
|
||||
Init(meta);
|
||||
}
|
||||
|
||||
public override MetaPOINTER Save(MetaBuilder mb)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string r = (ComponentType < 12) ? ComponentTypeNames[ComponentType] : "error";
|
||||
return r + " : " + Variations?.Length.ToString() ?? base.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public struct Unk_1036962405 //3 bytes, Key:4272717794 //COMPONENT PEDS (cloth?) TexData
|
||||
public struct Unk_1535046754 //48 bytes, Key:124073662 //COMPONENT PEDS drawable info
|
||||
{
|
||||
public byte propMask { get; set; } //0 0: UnsignedByte: 0: propMask
|
||||
public byte numAlternatives { get; set; } //1 1: UnsignedByte: 0: 2806194106
|
||||
public ushort Unused0 { get; set; }//2
|
||||
public uint Unused1 { get; set; }//4
|
||||
public Array_Structure aTexData { get; set; } //8 8: Array: 0: aTexData {0: Structure: 1036962405: 256}
|
||||
public Unk_2236980467 clothData { get; set; } //24 24: Structure: 2236980467: clothData
|
||||
}
|
||||
public class MUnk_1535046754 : MetaWrapper
|
||||
{
|
||||
public MUnk_3538495220 Owner { get; set; }
|
||||
|
||||
public Unk_1535046754 _Data;
|
||||
public Unk_1535046754 Data { get { return _Data; } }
|
||||
|
||||
public Unk_1036962405[] TexData { get; set; }
|
||||
|
||||
public int ComponentType { get; set; } = 0;
|
||||
public int DrawableIndex { get; set; } = 0;
|
||||
public int PropMask { get { return _Data.propMask; } }
|
||||
public int NumAlternatives { get { return _Data.numAlternatives; } }
|
||||
|
||||
public int PropType { get { return (PropMask >> 4) & 3; } }
|
||||
|
||||
public string GetDrawableName(int altnum = 0)
|
||||
{
|
||||
string r = (ComponentType < 12) ? MUnk_3538495220.ComponentTypeNames[ComponentType] : "error";
|
||||
r += "_";
|
||||
r += DrawableIndex.ToString("000");
|
||||
r += "_";
|
||||
switch (PropType)
|
||||
{
|
||||
case 0: r += "u"; break;//what do these mean?
|
||||
case 1: r += "r"; break;
|
||||
case 2: r += "m"; break;
|
||||
case 3: r += "m"; break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (altnum > 0)
|
||||
{
|
||||
r += "_";
|
||||
r += altnum.ToString();
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public MUnk_1535046754() { }
|
||||
public MUnk_1535046754(Meta meta, Unk_1535046754 data, MUnk_3538495220 owner, int index)
|
||||
{
|
||||
_Data = data;
|
||||
Owner = owner;
|
||||
DrawableIndex = index;
|
||||
|
||||
TexData = MetaTypes.ConvertDataArray<Unk_1036962405>(meta, (MetaName)1036962405, _Data.aTexData);
|
||||
}
|
||||
|
||||
|
||||
public override void Load(Meta meta, MetaPOINTER ptr)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override MetaPOINTER Save(MetaBuilder mb)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return GetDrawableName();
|
||||
}
|
||||
}
|
||||
|
||||
public struct Unk_1036962405 //3 bytes, Key:4272717794 //COMPONENT PEDS (cloth?) aTexData
|
||||
{
|
||||
public byte texId { get; set; } //0 0: UnsignedByte: 0: texId
|
||||
public byte distribution { get; set; } //1 1: UnsignedByte: 0: distribution//914976023
|
||||
@@ -6033,7 +6282,7 @@ namespace CodeWalker.GameFiles
|
||||
|
||||
public struct Unk_2236980467 //24 bytes, Key:508935687 //COMPONENT PEDS clothData
|
||||
{
|
||||
public byte Unk_2828247905 { get; set; } //0 0: Boolean: 0: 2828247905
|
||||
public byte ownsCloth { get; set; } //0 0: Boolean: 0: ownsCloth
|
||||
public byte Unused0 { get; set; }//1
|
||||
public ushort Unused1 { get; set; }//2
|
||||
public uint Unused2 { get; set; }//4
|
||||
@@ -6043,7 +6292,7 @@ namespace CodeWalker.GameFiles
|
||||
public uint Unused6 { get; set; }//20
|
||||
}
|
||||
|
||||
public struct CPedSelectionSet //48 bytes, Key:3120284999 //COMPONENT PEDS unknown
|
||||
public struct CPedSelectionSet //48 bytes, Key:3120284999 //COMPONENT PEDS
|
||||
{
|
||||
public MetaHash name { get; set; } //0 0: Hash: 0: name
|
||||
public ArrayOfBytes12 Unk_173599222 { get; set; } //4 4: ArrayOfBytes: 12: 173599222
|
||||
@@ -6053,8 +6302,32 @@ namespace CodeWalker.GameFiles
|
||||
public ArrayOfBytes6 Unk_672172037 { get; set; } //40 40: ArrayOfBytes: 6: 672172037
|
||||
public ushort Unused0 { get; set; }//46
|
||||
}
|
||||
public class MCPedSelectionSet : MetaWrapper
|
||||
{
|
||||
public MCPedVariationInfo Owner { get; set; }
|
||||
|
||||
public struct CComponentInfo //48 bytes, Key:3693847250 //COMPONENT PEDS CComponentInfo
|
||||
public CPedSelectionSet _Data;
|
||||
public CPedSelectionSet Data { get { return _Data; } }
|
||||
|
||||
public MCPedSelectionSet() { }
|
||||
public MCPedSelectionSet(Meta meta, CPedSelectionSet data, MCPedVariationInfo owner)
|
||||
{
|
||||
_Data = data;
|
||||
Owner = owner;
|
||||
}
|
||||
|
||||
public override void Load(Meta meta, MetaPOINTER ptr)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override MetaPOINTER Save(MetaBuilder mb)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public struct CComponentInfo //48 bytes, Key:3693847250 //COMPONENT PEDS
|
||||
{
|
||||
public MetaHash Unk_802196719 { get; set; } //0 0: Hash: 0: 802196719
|
||||
public MetaHash Unk_4233133352 { get; set; } //4 4: Hash: 0: 4233133352
|
||||
@@ -6073,18 +6346,108 @@ namespace CodeWalker.GameFiles
|
||||
public byte Unk_4196345791 { get; set; } //45 45: UnsignedByte: 0: 4196345791
|
||||
public ushort Unused5 { get; set; }//46
|
||||
}
|
||||
|
||||
public struct CPedPropInfo //40 bytes, Key:1792487819 //COMPONENT PEDS unknown
|
||||
public class MCComponentInfo : MetaWrapper
|
||||
{
|
||||
public byte Unk_2598445407 { get; set; } //0 0: UnsignedByte: 0: 2598445407
|
||||
public MCPedVariationInfo Owner { get; set; }
|
||||
|
||||
public CComponentInfo _Data;
|
||||
public CComponentInfo Data { get { return _Data; } }
|
||||
|
||||
|
||||
public int ComponentType { get { return _Data.Unk_3509540765; } }
|
||||
public int ComponentIndex { get { return _Data.Unk_4196345791; } }
|
||||
|
||||
public MCComponentInfo() { }
|
||||
public MCComponentInfo(Meta meta, CComponentInfo data, MCPedVariationInfo owner)
|
||||
{
|
||||
_Data = data;
|
||||
Owner = owner;
|
||||
}
|
||||
|
||||
|
||||
public override void Load(Meta meta, MetaPOINTER ptr)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override MetaPOINTER Save(MetaBuilder mb)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return (ComponentType < 12) ? MUnk_3538495220.ComponentTypeNames[ComponentType] + "_" + ComponentIndex.ToString("000") : base.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public struct CPedPropInfo //40 bytes, Key:1792487819 //COMPONENT PEDS
|
||||
{
|
||||
public byte numAvailProps { get; set; } //0 0: UnsignedByte: 0: numAvailProps
|
||||
public byte Unused0 { get; set; }//1
|
||||
public ushort Unused1 { get; set; }//2
|
||||
public uint Unused2 { get; set; }//4
|
||||
public Array_Structure aPropMetaData { get; set; } //8 8: Array: 0: aPropMetaData {0: Structure: CPedPropMetaData: 256}
|
||||
public Array_Structure aAnchors { get; set; } //24 24: Array: 0: aAnchors {0: Structure: CAnchorProps: 256}
|
||||
public CPedPropInfo SwapEnd()
|
||||
{
|
||||
aPropMetaData = aPropMetaData.SwapEnd();
|
||||
aAnchors = aAnchors.SwapEnd();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
public class MCPedPropInfo : MetaWrapper
|
||||
{
|
||||
public MCPedVariationInfo Owner { get; set; }
|
||||
|
||||
public CPedPropInfo _Data;
|
||||
public CPedPropInfo Data { get { return _Data; } }
|
||||
|
||||
public MCPedPropMetaData[] PropMetaData { get; set; }
|
||||
public MCAnchorProps[] Anchors { get; set; }
|
||||
|
||||
public MCPedPropInfo() { }
|
||||
public MCPedPropInfo(Meta meta, CPedPropInfo data, MCPedVariationInfo owner)
|
||||
{
|
||||
_Data = data;
|
||||
Owner = owner;
|
||||
|
||||
var vPropMetaData = MetaTypes.ConvertDataArray<CPedPropMetaData>(meta, MetaName.CPedPropMetaData, _Data.aPropMetaData);
|
||||
if (vPropMetaData != null)
|
||||
{
|
||||
PropMetaData = new MCPedPropMetaData[vPropMetaData.Length];
|
||||
for (int i = 0; i < vPropMetaData.Length; i++)
|
||||
{
|
||||
PropMetaData[i] = new MCPedPropMetaData(meta, vPropMetaData[i], this);
|
||||
}
|
||||
}
|
||||
|
||||
var vAnchors = MetaTypes.ConvertDataArray<CAnchorProps>(meta, MetaName.CAnchorProps, _Data.aAnchors);
|
||||
if (vAnchors != null)
|
||||
{
|
||||
Anchors = new MCAnchorProps[vAnchors.Length];
|
||||
for (int i = 0; i < vAnchors.Length; i++)
|
||||
{
|
||||
Anchors[i] = new MCAnchorProps(meta, vAnchors[i], this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override void Load(Meta meta, MetaPOINTER ptr)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override MetaPOINTER Save(MetaBuilder mb)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public struct CPedPropMetaData //56 bytes, Key:2029738350 //COMPONENT PEDS prop metadata
|
||||
public struct CPedPropMetaData //56 bytes, Key:2029738350 //COMPONENT PEDS
|
||||
{
|
||||
public MetaHash audioId { get; set; } //0 0: Hash: 0: audioId
|
||||
public ArrayOfBytes5 expressionMods { get; set; } //4 4: ArrayOfBytes: 5: expressionMods//942761829
|
||||
@@ -6103,8 +6466,35 @@ namespace CodeWalker.GameFiles
|
||||
public byte Unused5 { get; set; }//53
|
||||
public ushort Unused6 { get; set; }//54
|
||||
}
|
||||
public class MCPedPropMetaData : MetaWrapper
|
||||
{
|
||||
public MCPedPropInfo Owner { get; set; }
|
||||
|
||||
public struct CPedPropTexData //12 bytes, Key:2767296137 //COMPONENT PEDS prop texData
|
||||
public CPedPropMetaData _Data;
|
||||
public CPedPropMetaData Data { get { return _Data; } }
|
||||
|
||||
public CPedPropTexData[] TexData { get; set; }
|
||||
|
||||
public MCPedPropMetaData(Meta meta, CPedPropMetaData data, MCPedPropInfo owner)
|
||||
{
|
||||
_Data = data;
|
||||
Owner = owner;
|
||||
|
||||
TexData = MetaTypes.ConvertDataArray<CPedPropTexData>(meta, MetaName.CPedPropTexData, _Data.texData);
|
||||
}
|
||||
|
||||
public override void Load(Meta meta, MetaPOINTER ptr)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override MetaPOINTER Save(MetaBuilder mb)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public struct CPedPropTexData //12 bytes, Key:2767296137 //COMPONENT PEDS
|
||||
{
|
||||
public int inclusions { get; set; } //0 0: IntFlags2: 0: inclusions
|
||||
public int exclusions { get; set; } //4 4: IntFlags2: 0: exclusions
|
||||
@@ -6117,9 +6507,37 @@ namespace CodeWalker.GameFiles
|
||||
public struct CAnchorProps //24 bytes, Key:403574180 //COMPONENT PEDS CAnchorProps
|
||||
{
|
||||
public Array_byte props { get; set; } //0 0: Array: 0: props {0: UnsignedByte: 0: 256}
|
||||
public Unk_2834549053 anchor { get; set; } //16 16: IntEnum: 2834549053: anchor
|
||||
public eAnchorPoints anchor { get; set; } //16 16: IntEnum: eAnchorPoints: anchor
|
||||
public uint Unused0 { get; set; }//20
|
||||
}
|
||||
public class MCAnchorProps : MetaWrapper
|
||||
{
|
||||
public MCPedPropInfo Owner { get; set; }
|
||||
|
||||
public CAnchorProps _Data;
|
||||
public CAnchorProps Data { get { return _Data; } }
|
||||
|
||||
public byte[] Props { get; set; }
|
||||
|
||||
public MCAnchorProps(Meta meta, CAnchorProps data, MCPedPropInfo owner)
|
||||
{
|
||||
_Data = data;
|
||||
Owner = owner;
|
||||
|
||||
Props = MetaTypes.GetByteArray(meta, _Data.props);
|
||||
}
|
||||
|
||||
|
||||
public override void Load(Meta meta, MetaPOINTER ptr)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override MetaPOINTER Save(MetaBuilder mb)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6129,5 +6547,4 @@ namespace CodeWalker.GameFiles
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13212,14 +13212,14 @@ namespace CodeWalker.GameFiles
|
||||
);
|
||||
case MetaName.CPedVariationInfo:
|
||||
return new PsoStructureInfo(MetaName.CPedVariationInfo, 0, 0, 112,
|
||||
new PsoStructureEntryInfo((MetaName)1235281004, PsoDataType.Bool, 0, 0, 0),
|
||||
new PsoStructureEntryInfo(MetaName.bHasTexVariations, PsoDataType.Bool, 0, 0, 0),
|
||||
new PsoStructureEntryInfo((MetaName)4086467184, PsoDataType.Bool, 1, 0, 0),
|
||||
new PsoStructureEntryInfo((MetaName)911147899, PsoDataType.Bool, 2, 0, 0),
|
||||
new PsoStructureEntryInfo((MetaName)315291935, PsoDataType.Bool, 3, 0, 0),
|
||||
new PsoStructureEntryInfo((MetaName)MetaTypeName.ARRAYINFO, PsoDataType.UByte, 0, 0, 0),
|
||||
new PsoStructureEntryInfo((MetaName)2996560424, PsoDataType.Array, 4, 4, (MetaName)786436),
|
||||
new PsoStructureEntryInfo((MetaName)MetaTypeName.ARRAYINFO, PsoDataType.Structure, 0, 0, (MetaName)3538495220),
|
||||
new PsoStructureEntryInfo((MetaName)3796409423, PsoDataType.Array, 16, 0, (MetaName)6),
|
||||
new PsoStructureEntryInfo(MetaName.aComponentData3, PsoDataType.Array, 16, 0, (MetaName)6),
|
||||
new PsoStructureEntryInfo((MetaName)MetaTypeName.ARRAYINFO, PsoDataType.Structure, 0, 0, MetaName.CPedSelectionSet),
|
||||
new PsoStructureEntryInfo(MetaName.aSelectionSets, PsoDataType.Array, 32, 0, (MetaName)8),
|
||||
new PsoStructureEntryInfo((MetaName)MetaTypeName.ARRAYINFO, PsoDataType.Structure, 0, 0, MetaName.CComponentInfo),
|
||||
@@ -13229,7 +13229,7 @@ namespace CodeWalker.GameFiles
|
||||
);
|
||||
case MetaName.CPedPropInfo:
|
||||
return new PsoStructureInfo(MetaName.CPedPropInfo, 0, 0, 40,
|
||||
new PsoStructureEntryInfo((MetaName)2598445407, PsoDataType.UByte, 0, 0, 0),
|
||||
new PsoStructureEntryInfo(MetaName.numAvailProps, PsoDataType.UByte, 0, 0, 0),
|
||||
new PsoStructureEntryInfo((MetaName)MetaTypeName.ARRAYINFO, PsoDataType.Structure, 0, 0, MetaName.CPedPropMetaData),
|
||||
new PsoStructureEntryInfo(MetaName.aPropMetaData, PsoDataType.Array, 8, 0, (MetaName)1),
|
||||
new PsoStructureEntryInfo((MetaName)MetaTypeName.ARRAYINFO, PsoDataType.Structure, 0, 0, MetaName.CAnchorProps),
|
||||
@@ -13237,21 +13237,21 @@ namespace CodeWalker.GameFiles
|
||||
);
|
||||
case (MetaName)3538495220:
|
||||
return new PsoStructureInfo((MetaName)3538495220, 0, 0, 24,
|
||||
new PsoStructureEntryInfo((MetaName)3371516811, PsoDataType.UByte, 0, 0, 0),
|
||||
new PsoStructureEntryInfo(MetaName.numAvailTex, PsoDataType.UByte, 0, 0, 0),
|
||||
new PsoStructureEntryInfo((MetaName)MetaTypeName.ARRAYINFO, PsoDataType.Structure, 0, 0, (MetaName)1535046754),
|
||||
new PsoStructureEntryInfo((MetaName)1756136273, PsoDataType.Array, 8, 0, (MetaName)1)
|
||||
);
|
||||
case (MetaName)1535046754:
|
||||
return new PsoStructureInfo((MetaName)1535046754, 0, 0, 48,
|
||||
new PsoStructureEntryInfo(MetaName.propMask, PsoDataType.UByte, 0, 0, 0),
|
||||
new PsoStructureEntryInfo((MetaName)2806194106, PsoDataType.UByte, 1, 0, 0),
|
||||
new PsoStructureEntryInfo(MetaName.numAlternatives, PsoDataType.UByte, 1, 0, 0),
|
||||
new PsoStructureEntryInfo((MetaName)MetaTypeName.ARRAYINFO, PsoDataType.Structure, 0, 0, (MetaName)1036962405),
|
||||
new PsoStructureEntryInfo(MetaName.aTexData, PsoDataType.Array, 8, 0, (MetaName)2),
|
||||
new PsoStructureEntryInfo(MetaName.clothData, PsoDataType.Structure, 24, 0, (MetaName)2236980467)
|
||||
);
|
||||
case (MetaName)2236980467:
|
||||
return new PsoStructureInfo((MetaName)2236980467, 0, 0, 24,
|
||||
new PsoStructureEntryInfo((MetaName)2828247905, PsoDataType.Bool, 0, 0, 0)
|
||||
new PsoStructureEntryInfo(MetaName.ownsCloth, PsoDataType.Bool, 0, 0, 0)
|
||||
);
|
||||
case (MetaName)1036962405:
|
||||
return new PsoStructureInfo((MetaName)1036962405, 0, 0, 3,
|
||||
|
||||
Reference in New Issue
Block a user