Ejemplo n.º 1
0
 public static void RM_EnableUnusedEnemies(TwinsFile RM_Archive)
 {
     for (uint section_id = (uint)RM_Sections.Instances1; section_id <= (uint)RM_Sections.Instances8; section_id++)
     {
         if (!RM_Archive.ContainsItem(section_id))
         {
             continue;
         }
         TwinsSection section = RM_Archive.GetItem <TwinsSection>(section_id);
         if (section.Records.Count > 0)
         {
             if (!section.ContainsItem((uint)RM_Instance_Sections.ObjectInstance))
             {
                 continue;
             }
             TwinsSection instances = section.GetItem <TwinsSection>((uint)RM_Instance_Sections.ObjectInstance);
             for (int i = 0; i < instances.Records.Count; ++i)
             {
                 Instance instance = (Instance)instances.Records[i];
                 if (instance.ObjectID == (uint)ObjectID.GLOBAL_BAT_DARKPURPLE)
                 {
                     if (instance.Flags > (uint)PropertyFlags.DisableObject)
                     {
                         instance.Flags -= (uint)PropertyFlags.DisableObject;
                     }
                 }
                 else if (instance.ObjectID == (uint)ObjectID.SCHOOL_FROGENSTEIN)
                 {
                     instance.Flags = 0x188B2E;
                 }
                 instances.Records[i] = instance;
             }
         }
     }
 }
Ejemplo n.º 2
0
        public static void RM_Mod_SyncScripts(TwinsFile RM_Archive, ChunkType chunk)
        {
            if (RM_Archive.ContainsItem((uint)RM_Sections.Code))
            {
                TwinsSection code_section = RM_Archive.GetItem <TwinsSection>((uint)RM_Sections.Code);

                if (code_section.ContainsItem((uint)RM_Code_Sections.Script))
                {
                    TwinsSection script_section = code_section.GetItem <TwinsSection>((uint)RM_Code_Sections.Script);
                    if (script_section.Records.Count > 0)
                    {
                        List <uint> scripts = new List <uint>();
                        for (int i = 0; i < script_section.Records.Count; i++)
                        {
                            scripts.Add(script_section.Records[i].ID);
                            script_section.RemoveItem(script_section.Records[i].ID);
                        }
                        for (int i = 0; i < scripts.Count; i++)
                        {
                            script_section.Records.Add(Twins_Data.allScripts[scripts[i]]);
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public static void RM_Mod_UnlockedCamera(TwinsFile RM_Archive, ChunkType chunk)
 {
     for (uint section_id = (uint)RM_Sections.Instances1; section_id <= (uint)RM_Sections.Instances8; section_id++)
     {
         if (!RM_Archive.ContainsItem(section_id))
         {
             continue;
         }
         TwinsSection section = RM_Archive.GetItem <TwinsSection>(section_id);
         if (section.Records.Count > 0)
         {
             if (!section.ContainsItem((uint)RM_Instance_Sections.Camera))
             {
                 continue;
             }
             TwinsSection cameras = section.GetItem <TwinsSection>((uint)RM_Instance_Sections.Camera);
             for (int i = 0; i < cameras.Records.Count; ++i)
             {
                 Camera cam = (Camera)cameras.Records[i];
                 cam.Enabled        = 0;
                 cameras.Records[i] = cam;
             }
         }
     }
 }
Ejemplo n.º 4
0
 public static void RM_Mod_ClassicHealth(TwinsFile RM_Archive)
 {
     for (uint section_id = (uint)RM_Sections.Instances1; section_id <= (uint)RM_Sections.Instances8; section_id++)
     {
         if (!RM_Archive.ContainsItem(section_id))
         {
             continue;
         }
         TwinsSection section = RM_Archive.GetItem <TwinsSection>(section_id);
         if (section.Records.Count > 0)
         {
             if (!section.ContainsItem((uint)RM_Instance_Sections.ObjectInstance))
             {
                 continue;
             }
             TwinsSection instances = section.GetItem <TwinsSection>((uint)RM_Instance_Sections.ObjectInstance);
             for (int i = 0; i < instances.Records.Count; ++i)
             {
                 Instance instance = (Instance)instances.Records[i];
                 if (instance.ObjectID == (uint)ObjectID.CRASH || instance.ObjectID == (uint)ObjectID.CORTEX ||
                     instance.ObjectID == (uint)ObjectID.NINA || instance.ObjectID == (uint)ObjectID.MECHABANDICOOT)
                 {
                     instance.UnkI323[2] = 1;
                 }
                 instances.Records[i] = instance;
             }
         }
     }
 }
Ejemplo n.º 5
0
 public static void RM_CharacterMod_DoubleJumpNina(TwinsFile RM_Archive)
 {
     for (uint section_id = (uint)RM_Sections.Instances1; section_id <= (uint)RM_Sections.Instances8; section_id++)
     {
         if (!RM_Archive.ContainsItem(section_id))
         {
             continue;
         }
         TwinsSection section = RM_Archive.GetItem <TwinsSection>(section_id);
         if (section.Records.Count > 0)
         {
             if (!section.ContainsItem((uint)RM_Instance_Sections.ObjectInstance))
             {
                 continue;
             }
             TwinsSection instances = section.GetItem <TwinsSection>((uint)RM_Instance_Sections.ObjectInstance);
             for (int i = 0; i < instances.Records.Count; ++i)
             {
                 Instance instance = (Instance)instances.Records[i];
                 if (instance.ObjectID == (uint)ObjectID.NINA)
                 {
                     // Nina mods
                     instance.UnkI322[(int)CharacterInstanceFloats.DoubleJumpHeight] = 16;
                     instance.UnkI322[(int)CharacterInstanceFloats.DoubleJumpUnk22]  = 64;
                     instance.UnkI322[(int)CharacterInstanceFloats.DoubleJumpArcUnk] = 72.951f;
                 }
                 instances.Records[i] = instance;
             }
         }
     }
 }
Ejemplo n.º 6
0
 public static void RM_CharacterMod_ClassicSlideJump(TwinsFile RM_Archive)
 {
     for (uint section_id = (uint)RM_Sections.Instances1; section_id <= (uint)RM_Sections.Instances8; section_id++)
     {
         if (!RM_Archive.ContainsItem(section_id))
         {
             continue;
         }
         TwinsSection section = RM_Archive.GetItem <TwinsSection>(section_id);
         if (section.Records.Count > 0)
         {
             if (!section.ContainsItem((uint)RM_Instance_Sections.ObjectInstance))
             {
                 continue;
             }
             TwinsSection instances = section.GetItem <TwinsSection>((uint)RM_Instance_Sections.ObjectInstance);
             for (int i = 0; i < instances.Records.Count; ++i)
             {
                 Instance instance = (Instance)instances.Records[i];
                 if (instance.ObjectID == (uint)ObjectID.CRASH)
                 {
                     // Crash mods
                     if (instance.UnkI321.Count > 8)
                     {
                         instance.UnkI321[(int)CharacterInstanceFlags.SlideJumpRotationSpeed] = 0x10000;
                     }
                 }
                 instances.Records[i] = instance;
             }
         }
     }
 }
Ejemplo n.º 7
0
 public static void RM_CharacterMod_EnableFlyingKick(TwinsFile RM_Archive)
 {
     for (uint section_id = (uint)RM_Sections.Instances1; section_id <= (uint)RM_Sections.Instances8; section_id++)
     {
         if (!RM_Archive.ContainsItem(section_id))
         {
             continue;
         }
         TwinsSection section = RM_Archive.GetItem <TwinsSection>(section_id);
         if (section.Records.Count > 0)
         {
             if (!section.ContainsItem((uint)RM_Instance_Sections.ObjectInstance))
             {
                 continue;
             }
             TwinsSection instances = section.GetItem <TwinsSection>((uint)RM_Instance_Sections.ObjectInstance);
             for (int i = 0; i < instances.Records.Count; ++i)
             {
                 Instance instance = (Instance)instances.Records[i];
                 if (instance.ObjectID == (uint)ObjectID.CRASH)
                 {
                     // Crash mods
                     instance.UnkI322[(int)CharacterInstanceFloats.FlyingKickHangTime]     = 0.15f;
                     instance.UnkI322[(int)CharacterInstanceFloats.FlyingKickForwardSpeed] = 50;
                     instance.UnkI322[(int)CharacterInstanceFloats.FlyingKickGravity]      = 10;
                 }
                 instances.Records[i] = instance;
             }
         }
     }
 }
Ejemplo n.º 8
0
        //example
        public static void RM_CharacterMod(TwinsFile RM_Archive)
        {
            for (uint section_id = (uint)RM_Sections.Instances1; section_id <= (uint)RM_Sections.Instances8; section_id++)
            {
                if (!RM_Archive.ContainsItem(section_id))
                {
                    continue;
                }
                TwinsSection section = RM_Archive.GetItem <TwinsSection>(section_id);
                if (section.Records.Count > 0)
                {
                    if (!section.ContainsItem((uint)RM_Instance_Sections.ObjectInstance))
                    {
                        continue;
                    }
                    TwinsSection instances = section.GetItem <TwinsSection>((uint)RM_Instance_Sections.ObjectInstance);
                    for (int i = 0; i < instances.Records.Count; ++i)
                    {
                        Instance instance = (Instance)instances.Records[i];
                        if (instance.ObjectID == (uint)ObjectID.CRASH)
                        {
                            // Crash mods

                            //instance.UnkI322[(int)CharacterInstanceFloats.Static1] = 0; // 1
                        }
                        else if (instance.ObjectID == (uint)ObjectID.CORTEX)
                        {
                            // Cortex mods

                            //instance.UnkI322[(int)CharacterInstanceFloats.BodyslamHangTime] = 0.4f;
                        }
                        else if (instance.ObjectID == (uint)ObjectID.NINA)
                        {
                            // Nina mods

                            //instance.UnkI322[(int)CharacterInstanceFloats.CrawlSpeed] = 1.75f;
                        }
                        else if (instance.ObjectID == (uint)ObjectID.MECHABANDICOOT)
                        {
                            // Mechabandicoot mods

                            //instance.UnkI322[(int).CharacterInstanceFloats.StrafingSpeed] = 10;
                        }
                        instances.Records[i] = instance;
                    }
                }
            }
        }
Ejemplo n.º 9
0
        public static void SM_Rand_WorldPalette(TwinsFile SM_Archive, Modder_Twins.ColorSwizzleData Swiz)
        {
            if (SM_Archive.Type != TwinsFile.FileType.SM2)
            {
                return;
            }
            if (!SM_Archive.ContainsItem(6))
            {
                return;
            }
            TwinsSection section = SM_Archive.GetItem <TwinsSection>(6);

            if (section.ContainsItem((uint)RM_Graphics_Sections.Models) && section.Records.Count > 0)
            {
                TwinsSection model_section = section.GetItem <TwinsSection>((uint)RM_Graphics_Sections.Models);

                foreach (TwinsItem item in model_section.Records)
                {
                    Model model = (Model)item;
                    for (int i = 0; i < model.SubModels.Count; i++)
                    {
                        for (int g = 0; g < model.SubModels[i].Groups.Count; g++)
                        {
                            for (int v = 0; v < model.SubModels[i].Groups[g].VData.Length; v++)
                            {
                                float maxVal = Math.Max(model.SubModels[i].Groups[g].VData[v].R, model.SubModels[i].Groups[g].VData[v].G);
                                maxVal = Math.Max(maxVal, model.SubModels[i].Groups[g].VData[v].B);
                                maxVal = maxVal / 255f;

                                int r  = model.SubModels[i].Groups[g].VData[v].R;
                                int gr = model.SubModels[i].Groups[g].VData[v].G;
                                int b  = model.SubModels[i].Groups[g].VData[v].B;

                                model.SubModels[i].Groups[g].VData[v].R = (byte)((Swiz.r_r * r + Swiz.r_g * gr + Swiz.r_b * b) / Swiz.r_s);
                                model.SubModels[i].Groups[g].VData[v].G = (byte)((Swiz.g_r * r + Swiz.g_g * gr + Swiz.g_b * b) / Swiz.g_s);
                                model.SubModels[i].Groups[g].VData[v].B = (byte)((Swiz.b_r * r + Swiz.b_g * gr + Swiz.b_b * b) / Swiz.b_s);
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 10
0
        public static void RM_Mod_ClassicExplosions(TwinsFile RM_Archive, Script GenericCrateExplode)
        {
            if (RM_Archive.ContainsItem((uint)RM_Sections.Code))
            {
                TwinsSection code_section = RM_Archive.GetItem <TwinsSection>((uint)RM_Sections.Code);

                if (code_section.ContainsItem((uint)RM_Code_Sections.Script))
                {
                    TwinsSection script_section = code_section.GetItem <TwinsSection>((uint)RM_Code_Sections.Script);
                    if (script_section.Records.Count > 0)
                    {
                        if (script_section.ContainsItem((uint)ScriptID.COM_GENERIC_CRATE_EXPLODE))
                        {
                            script_section.RemoveItem((uint)ScriptID.COM_GENERIC_CRATE_EXPLODE);
                            script_section.Records.Add(GenericCrateExplode);
                        }
                    }
                }
            }
        }
Ejemplo n.º 11
0
        public static void SM_Mod_UntexturedWorld(TwinsFile SM_Archive)
        {
            if (!SM_Archive.ContainsItem(6))
            {
                return;
            }
            TwinsSection section = SM_Archive.GetItem <TwinsSection>(6);

            if (section.ContainsItem((uint)RM_Graphics_Sections.Materials) && section.Records.Count > 0)
            {
                TwinsSection mat_section = section.GetItem <TwinsSection>((uint)RM_Graphics_Sections.Materials);

                foreach (TwinsItem item in mat_section.Records)
                {
                    Material mat = (Material)item;
                    for (int i = 0; i < mat.Shaders.Count; i++)
                    {
                        mat.Shaders[i].TextureId  = 0;
                        mat.Shaders[i].TxtMapping = TwinsShader.TextureMapping.OFF;
                    }
                }
            }
        }
Ejemplo n.º 12
0
        public static void SM_Mod_GreyscaleWorld(TwinsFile SM_Archive)
        {
            if (SM_Archive.Type != TwinsFile.FileType.SM2)
            {
                return;
            }
            if (!SM_Archive.ContainsItem(6))
            {
                return;
            }
            TwinsSection section = SM_Archive.GetItem <TwinsSection>(6);

            if (section.ContainsItem((uint)RM_Graphics_Sections.Models) && section.Records.Count > 0)
            {
                TwinsSection model_section = section.GetItem <TwinsSection>((uint)RM_Graphics_Sections.Models);

                foreach (TwinsItem item in model_section.Records)
                {
                    Model model = (Model)item;
                    for (int i = 0; i < model.SubModels.Count; i++)
                    {
                        for (int g = 0; g < model.SubModels[i].Groups.Count; g++)
                        {
                            for (int v = 0; v < model.SubModels[i].Groups[g].VData.Length; v++)
                            {
                                int maxVal = Math.Max(model.SubModels[i].Groups[g].VData[v].R, model.SubModels[i].Groups[g].VData[v].G);
                                maxVal = Math.Max(maxVal, model.SubModels[i].Groups[g].VData[v].B);
                                model.SubModels[i].Groups[g].VData[v].R = (byte)maxVal;
                                model.SubModels[i].Groups[g].VData[v].G = (byte)maxVal;
                                model.SubModels[i].Groups[g].VData[v].B = (byte)maxVal;
                            }
                        }
                    }
                }
            }
            if (section.ContainsItem((uint)RM_Graphics_Sections.Textures) && section.Records.Count > 0)
            {
                TwinsSection tex_section = section.GetItem <TwinsSection>((uint)RM_Graphics_Sections.Textures);

                foreach (TwinsItem item in tex_section.Records)
                {
                    Texture tex = (Texture)item;
                    for (int i = 0; i < tex.RawData.Length; i++)
                    {
                        int maxVal = Math.Max(tex.RawData[i].R, tex.RawData[i].G);
                        maxVal         = Math.Max(maxVal, tex.RawData[i].B);
                        tex.RawData[i] = Color.FromArgb(tex.RawData[i].A, maxVal, maxVal, maxVal);
                    }
                    tex.UpdateImageData();
                }
            }

            SceneryData scenery = (SceneryData)SM_Archive.GetItem <TwinsItem>(0);

            if (scenery.LightsAmbient.Count > 0)
            {
                foreach (SceneryData.LightAmbient light in scenery.LightsAmbient)
                {
                    float maxVal = Math.Max(light.Color_R, light.Color_G);
                    maxVal        = Math.Max(maxVal, light.Color_B);
                    light.Color_R = maxVal;
                    light.Color_G = maxVal;
                    light.Color_B = maxVal;
                }
            }
            if (scenery.LightsDirectional.Count > 0)
            {
                foreach (SceneryData.LightDirectional light in scenery.LightsDirectional)
                {
                    float maxVal = Math.Max(light.Color_R, light.Color_G);
                    maxVal        = Math.Max(maxVal, light.Color_B);
                    light.Color_R = maxVal;
                    light.Color_G = maxVal;
                    light.Color_B = maxVal;
                }
            }
            if (scenery.LightsPoint.Count > 0)
            {
                foreach (SceneryData.LightPoint light in scenery.LightsPoint)
                {
                    float maxVal = Math.Max(light.Color_R, light.Color_G);
                    maxVal        = Math.Max(maxVal, light.Color_B);
                    light.Color_R = maxVal;
                    light.Color_G = maxVal;
                    light.Color_B = maxVal;
                }
            }
            if (scenery.LightsNegative.Count > 0)
            {
                foreach (SceneryData.LightNegative light in scenery.LightsNegative)
                {
                    float maxVal = Math.Max(light.Color_R, light.Color_G);
                    maxVal        = Math.Max(maxVal, light.Color_B);
                    light.Color_R = maxVal;
                    light.Color_G = maxVal;
                    light.Color_B = maxVal;
                }
            }
        }
Ejemplo n.º 13
0
        public static void RM_CharacterObjectMod(TwinsFile RM_Archive)
        {
            if (RM_Archive.ContainsItem((uint)RM_Sections.Code))
            {
                TwinsSection code_section = RM_Archive.GetItem <TwinsSection>((uint)RM_Sections.Code);

                /*
                 * if (code_section.ContainsItem((uint)RM_Code_Sections.Script))
                 * {
                 *  TwinsSection script_section = code_section.GetItem<TwinsSection>((uint)RM_Code_Sections.Script);
                 *  if (script_section.Records.Count > 0)
                 *  {
                 *      script_section.Records.Add(Twins_Data.GetScriptByID(ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_LEFT));
                 *      script_section.Records.Add(Twins_Data.GetScriptByID(ScriptID.COM_GENERIC_CHARACTER_STRAFE_LEFT));
                 *      script_section.Records.Add(Twins_Data.GetScriptByID(ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_RIGHT));
                 *      script_section.Records.Add(Twins_Data.GetScriptByID(ScriptID.COM_GENERIC_CHARACTER_STRAFE_RIGHT));
                 *  }
                 * }
                 */
                if (code_section.ContainsItem((uint)RM_Code_Sections.Object))
                {
                    TwinsSection obj_section = code_section.GetItem <TwinsSection>((uint)RM_Code_Sections.Object);
                    if (obj_section.Records.Count > 0)
                    {
                        for (int obj = 0; obj < obj_section.Records.Count; obj++)
                        {
                            if (obj_section.Records[obj].ID == (uint)ObjectID.CRASH)
                            {
                                GameObject gameObj = (GameObject)obj_section.Records[obj];
                                //gameObj.Scripts[(int)CharacterGameObjectScriptOrder.OnStrafeLeft] = (ushort)ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_LEFT;
                                //gameObj.Scripts[(int)CharacterGameObjectScriptOrder.OnStrafeRight] = (ushort)ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_RIGHT;

                                //if (Options[ModStompKick].Enabled)
                                //{
                                gameObj.Scripts[(int)CharacterGameObjectScriptOrder.OnFlyingKick]     = (ushort)ScriptID.HEAD_COM_CRASH_STOMP_KICK;
                                gameObj.Scripts[(int)CharacterGameObjectScriptOrder.OnFlyingKickLand] = (ushort)ScriptID.HEAD_COM_CRASH_STOMP_KICK_LAND;
                                //}

                                obj_section.Records[obj] = gameObj;
                            }
                            else if (obj_section.Records[obj].ID == (uint)ObjectID.CORTEX)
                            {
                                //GameObject gameObj = (GameObject)obj_section.Records[obj];

                                //gameObj.Scripts[(int)CharacterGameObjectScriptOrder.Unk35] = (ushort)ScriptID.HEAD_COM_CORTEX_RECOIL;

                                //obj_section.Records[obj] = gameObj;
                            }
                            else if (obj_section.Records[obj].ID == (uint)ObjectID.NINA)
                            {
                                //GameObject gameObj = (GameObject)obj_section.Records[obj];
                                //gameObj.Scripts[(int)CharacterGameObjectScriptOrder.OnStrafeLeft] = (ushort)ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_LEFT;
                                //gameObj.Scripts[(int)CharacterGameObjectScriptOrder.OnStrafeRight] = (ushort)ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_RIGHT;

                                //gameObj.Scripts[(int)CharacterGameObjectScriptOrder.OnThrowPunch] = (ushort)ScriptID.HEAD_COM_NINA_ENTER_VEHICLE;

                                //obj_section.Records[obj] = gameObj;
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 14
0
        public static void RM_SwitchCharactersMod(TwinsFile RM_Archive, Script StrafeLeft, Script StrafeRight)
        {
            if (RM_Archive.ContainsItem((uint)RM_Sections.Code))
            {
                TwinsSection code_section = RM_Archive.GetItem <TwinsSection>((uint)RM_Sections.Code);

                bool containsCharacter = false;
                if (code_section.ContainsItem((uint)RM_Code_Sections.Object))
                {
                    TwinsSection obj_section = code_section.GetItem <TwinsSection>((uint)RM_Code_Sections.Object);
                    if (obj_section.Records.Count > 0)
                    {
                        for (int obj = 0; obj < obj_section.Records.Count; obj++)
                        {
                            if (obj_section.Records[obj].ID == (uint)ObjectID.CRASH)
                            {
                                GameObject gameObj = (GameObject)obj_section.Records[obj];
                                gameObj.Scripts[(int)CharacterGameObjectScriptOrder.OnStrafeLeft]  = (ushort)ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_LEFT;
                                gameObj.Scripts[(int)CharacterGameObjectScriptOrder.OnStrafeRight] = (ushort)ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_RIGHT;

                                obj_section.Records[obj] = gameObj;
                                containsCharacter        = true;
                            }
                            else if (obj_section.Records[obj].ID == (uint)ObjectID.CORTEX)
                            {
                                GameObject gameObj = (GameObject)obj_section.Records[obj];
                                gameObj.Scripts[(int)CharacterGameObjectScriptOrder.OnStrafeLeft]  = (ushort)ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_LEFT;
                                gameObj.Scripts[(int)CharacterGameObjectScriptOrder.OnStrafeRight] = (ushort)ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_RIGHT;

                                obj_section.Records[obj] = gameObj;
                                containsCharacter        = true;
                            }
                            else if (obj_section.Records[obj].ID == (uint)ObjectID.NINA)
                            {
                                GameObject gameObj = (GameObject)obj_section.Records[obj];
                                gameObj.Scripts[(int)CharacterGameObjectScriptOrder.OnStrafeLeft]  = (ushort)ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_LEFT;
                                gameObj.Scripts[(int)CharacterGameObjectScriptOrder.OnStrafeRight] = (ushort)ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_RIGHT;

                                obj_section.Records[obj] = gameObj;
                                containsCharacter        = true;
                            }
                        }
                    }
                }

                if (containsCharacter)
                {
                    if (code_section.ContainsItem((uint)RM_Code_Sections.Script))
                    {
                        TwinsSection script_section = code_section.GetItem <TwinsSection>((uint)RM_Code_Sections.Script);
                        if (script_section.Records.Count > 0)
                        {
                            if (script_section.ContainsItem((uint)ScriptID.COM_GENERIC_CHARACTER_STRAFE_LEFT))
                            {
                                script_section.RemoveItem((uint)ScriptID.COM_GENERIC_CHARACTER_STRAFE_LEFT);
                            }
                            if (script_section.ContainsItem((uint)ScriptID.COM_GENERIC_CHARACTER_STRAFE_RIGHT))
                            {
                                script_section.RemoveItem((uint)ScriptID.COM_GENERIC_CHARACTER_STRAFE_RIGHT);
                            }
                            if (!script_section.ContainsItem((uint)ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_LEFT))
                            {
                                script_section.Records.Add(Twins_Data.allScripts[(uint)ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_LEFT]);
                            }
                            if (!script_section.ContainsItem((uint)ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_RIGHT))
                            {
                                script_section.Records.Add(Twins_Data.allScripts[(uint)ScriptID.HEAD_COM_GENERIC_CHARACTER_STRAFE_RIGHT]);
                            }
                            script_section.Records.Add(StrafeLeft);
                            script_section.Records.Add(StrafeRight);
                        }
                    }
                }
            }

            for (uint section_id = (uint)RM_Sections.Instances1; section_id <= (uint)RM_Sections.Instances8; section_id++)
            {
                if (!RM_Archive.ContainsItem(section_id))
                {
                    continue;
                }
                TwinsSection section = RM_Archive.GetItem <TwinsSection>(section_id);
                if (section.Records.Count > 0)
                {
                    if (!section.ContainsItem((uint)RM_Instance_Sections.ObjectInstance))
                    {
                        continue;
                    }
                    TwinsSection instances = section.GetItem <TwinsSection>((uint)RM_Instance_Sections.ObjectInstance);
                    for (int i = 0; i < instances.Records.Count; ++i)
                    {
                        Instance instance = (Instance)instances.Records[i];
                        if (instance.ObjectID == (uint)ObjectID.CRASH)
                        {
                            instance.UnkI322[(int)CharacterInstanceFloats.StrafingSpeed] = 0.1f;
                        }
                        else if (instance.ObjectID == (uint)ObjectID.CORTEX)
                        {
                            instance.UnkI322[(int)CharacterInstanceFloats.StrafingSpeed] = 0.1f;
                        }
                        else if (instance.ObjectID == (uint)ObjectID.NINA)
                        {
                            instance.UnkI322[(int)CharacterInstanceFloats.StrafingSpeed] = 0.1f;
                        }
                        instances.Records[i] = instance;
                    }
                }
            }
        }