Uint32 (Count)
{
Byte
Uint32
Uint32 (Count)
{
Byte x 17
Uint32 (Count)
{
Byte
Uint32
}
}
}
Oh, I forgot to mention, I found a problem with CASP files, and the problem still persists in your new wrapper: When trying to add an LODInfoEntry:
Front-end Distribution: 14-0920-48
Library Distribution: 14-118-146
== START ==
Source: mscorlib
Assembly: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Constructor on type 'CASPartResource.CASPartResourceTS4+LODInfoEntry' not found.
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at s4pi.Interfaces.DependentList`1.Add(Type elementType) in c:\Users\Adam\Desktop\Sims4Tools-master\Sims4Tools-master\s4pi\Interfaces\DependentList.cs:line 247
at s4pi.Interfaces.DependentList`1.Add() in c:\Users\Adam\Desktop\Sims4Tools-master\Sims4Tools-master\s4pi\Interfaces\DependentList.cs:line 133
== END ==
public enum blahblah :ulong
IPackage result = Package.NewPackage(1);
CatalogResource.TS4.ObjectCatalogResource obj = (CatalogResource.TS4.ObjectCatalogResource)game.Find(targetTGI).Data;
TGIBlock[] oldTGIList = obj.NestedTGIBlockList;
var clone = obj.CloneWrapper(GetTimestamp(DateTime.Now), !isReplace, isStandalone);
Random r = new Random();
string hashSalt = GetTimestamp(DateTime.Now) + r.Next().ToString();
if (oldTGIList != null)
{
for (int i = 0; i < oldTGIList.Length; i++)
{
var oldTGI = oldTGIList[i];
var newTGI = clone.NestedTGIBlockList[i];
if (oldTGI.ResourceType == ResourceTypes.MATD)
{
RCOLResource.RCOL rcol = new RCOLResource.RCOL(1, game.Find(oldTGI).RawData.Stream);
var chunk = rcol.rcolChunkList.First(c => c.RCOLTag == "MATD") as RCOLResource.MATD;
var imageData = chunk.MTRL.sdList.Find(s => s.field == RCOLResource.FieldType.DiffuseMap);
var imageTGI = imageData.Data as TGIBlock;
var imageStream = game.Find(imageTGI).RawData.Stream;
imageTGI.Instance = FNV64.GetHash("texture" + imageTGI.Instance.ToString() + hashSalt);
result.AddResource(imageTGI, imageStream, true);
var headerInstance = rcol.rcolHeader.internalTGIList.Find(f => f.Instance == oldTGI.Instance);
headerInstance.Instance = newTGI.Instance;
result.AddResource(newTGI, rcol.Stream, true);
}
else
{
result.AddResource(clone.NestedTGIBlockList[i], game.Find(oldTGI).RawData.Stream, true);
}
}
}
test
C#test
C# test
c# test
test
def foo():
pass
public CatalogResourceHandler()
{
if (s4pi.Settings.Settings.IsTS4)
{
this.Add(typeof(WallCatalogResource), new List<string>(new string[] { "0xD5F0F921", }));
this.Add(typeof(FloorCatalogResource), new List<string>(new string[] { "0xB4F762C9", }));
this.Add(typeof(TerrainPaintCatalogResource), new List<string>(new string[] { "0xEBCBB16C", }));
this.Add(typeof(ObjectInstanceResource), new List<string>(new string[] { "0x319E4F1D", }));
this.Add(typeof(RailingResource), new List<string>() { "0x1C1CF1F7", });
this.Add(typeof(StairCatalogResource), new List<string>(new string[] { "0x9A20CD1C", }));
this.Add(typeof(FountainTrimsResource), new List<string>(new string[] { "0xE7ADA79D", }));
this.Add(typeof(RoofTrimResource), new List<string>(new string[] { "0xB0311D0F", }));
}
}
here's a more comprehensive list of age/genders than is used in your enum:
Baby = 01,
Toddler = 02,
Child = 04,
Teen = 08,
YA = 10,
Adult = 20,
AdultYA = 30,
Elder = 40,
AdultElder = 60,
YAandUp = 70,
TeenAndUp = 78,
AllAges = 7F
public string Value { get { { return "0x" + this.color.ToArgb().ToString("X8"); } } }