Exemplo n.º 1
0
        void ConvertTextureParameters(PropertyReader reader)
        {
            ArrayProperty p = reader.GetProperty <ArrayProperty>("TextureParameterValues");

            textureParameters = new List <TextureParameterValue>();
            foreach (var e in p.props)
            {
                StructProperty sp = (StructProperty)e;
                PropListStruct lp = (PropListStruct)sp.data;
                PropertyReader lr = new PropertyReader(lp.propsList);
                textureParameters.Add(new TextureParameterValue
                {
                    name = lr.GetPropertyStringOrName("ParameterName"),
                    prop = lr.GetProperty <ObjectProperty>("ParameterValue")
                });
            }
        }
Exemplo n.º 2
0
        private static List <ArkDinoFood> ConvertMultiplier(UAssetFileBlueprint f, UAssetCacheBlock cache, ArrayProperty p)
        {
            //Convert each entry
            List <ArkDinoFood> output = new List <ArkDinoFood>();

            foreach (var s in p.props)
            {
                StructProperty      data      = (StructProperty)s;
                PropListStruct      sdata     = (PropListStruct)data.data;
                PropertyReader      reader    = new PropertyReader(sdata.propsList);
                UAssetFileBlueprint foodClass = reader.GetProperty <ObjectProperty>("FoodItemParent").GetReferencedFileBlueprint();
                ArkDinoFood         food      = new ArkDinoFood
                {
                    classname = foodClass.classname,
                    foodEffectivenessMultiplier     = reader.GetPropertyFloat("FoodEffectivenessMultiplier", null),
                    affinityOverride                = reader.GetPropertyFloat("AffinityOverride", null),
                    affinityEffectivenessMultiplier = reader.GetPropertyFloat("AffinityEffectivenessMultiplier", null),
                    foodCategory = reader.GetPropertyInt("FoodItemCategory", null),
                    priority     = reader.GetPropertyFloat("UntamedFoodConsumptionPriority", null)
                };
                output.Add(food);
            }
            return(output);
        }
Exemplo n.º 3
0
        public override void Read(IOMemoryStream ms, UAssetFile f)
        {
            //Is we're in an array, this will **ALWAYS** be a prop list struct.
            UStruct st;

            if (isArray)
            {
                structType = "(array)";
                unknown    = 0;
                st         = new PropListStruct();
                f.Debug("Read Array", $"====READ STRUCT BEGIN @ {ms.position} ({structType}, {unknown})====", ConsoleColor.Yellow);
            }
            else
            {
                structType = ms.ReadNameTableEntry(f);
                unknown    = ms.ReadInt();
                f.Debug("Read Array", $"====READ STRUCT BEGIN @ {ms.position} ({structType}, {unknown})====", ConsoleColor.Yellow);

                //Find the struct type. Unknown if real: ItemStatInfo
                if (structType == "ItemStatInfo" || structType == "ItemNetID" || structType == "ItemNetInfo" || structType == "Transform" || structType == "PrimalPlayerDataStruct" || structType == "PrimalPlayerCharacterConfigStruct" || structType == "PrimalPersistentCharacterStatsStruct" || structType == "TribeData" || structType == "TribeGovernment" || structType == "TerrainInfo" || structType == "ArkInventoryData" || structType == "DinoOrderGroup" || structType == "ARKDinoData")
                {
                    //Open this as a struct property list.
                    st = new PropListStruct();
                }
                else if (structType == "Vector" || structType == "Rotator")
                {
                    //3d vector or rotor
                    st = new Vector3Struct();
                }
                else if (structType == "Vector2D")
                {
                    //2d vector
                    st = new Vector2Struct();
                }
                else if (structType == "Quat")
                {
                    //Quat
                    st = new QuatStruct();
                }
                else if (structType == "Color")
                {
                    //Color
                    st = new ColorStruct();
                }
                else if (structType == "LinearColor")
                {
                    //Linear color
                    st = new LinearColorStruct();
                }
                else if (structType == "UniqueNetIdRepl")
                {
                    //Some net stuff
                    st = new UniqueNetIdStruct();
                }
                else if (structType == "Guid")
                {
                    //Some net stuff
                    st = new GuidStruct();
                }
                else if (structType == "IntPoint")
                {
                    //Some net stuff
                    st = new IntPointStruct();
                }
                else if (structType == "StringAssetReference")
                {
                    st = new StringAssetReferenceStruct();
                }
                else
                {
                    //Interpet this as a struct property list. Maybe raise a warning later?
                    f.Warn("Struct Warning", $"Unknown type '{structType}'. Interpeting as a struct property list...");
                    st = new PropListStruct();
                }
            }

            //Read
            st.ReadStruct(ms, f, this);
            data = st;

            f.Debug("Read Struct", $"====READ STRUCT END @ {ms.position}====", ConsoleColor.Yellow);
        }