Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - CallMeDio

#1
Help / Re: Need help with Harmony Detour
June 12, 2017, 07:33:35 PM
Hello, first of all thanks a lot Fluffy and scuba for putting together this awesome well explained responses, it cleared my mind on the parts I didn't understand about harmony, this is pure gold for awful self thought programmers like me.
I saw the wiki but when I did I saw that prefix was before and postfix after and I wrongly got the idea I needed the other (transpiler) to actually change the method but that was not it, I will double my attention when reading documentations next time (my bad).

So if I got it right the transpiler is for replacing a method on one of its uses inside other method? Like for example if I have a method A that uses method B, the transpiler would be to only replace that method B being used by Method A without actually replacing B for all it other uses?

btw, the posted examples worked and I finally got the "abc"!


edit: and how to deal with methods that use methods that are private?
edit²: is it using reflection?
#2
Help / [Solved] Need help with Harmony Detour
June 12, 2017, 03:25:11 PM
After not modding since A14 im trying to recreate an old mod using harmony instead of ccl.
What im trying to do for this first test is replace the pawn.MainDesc with my method that returns "abc", this very first test has taken me more than 10 hours so far and no success, so time to ask for help as im sure this must be stupidly simple.
Current attempt:
namespace Stem_Cells
{
    [StaticConstructorOnStartup]
    class Main
    {
        static Main()
        {
            HarmonyInstance.DEBUG = true;
            var harmony = HarmonyInstance.Create("Dio.test.stmod");
            harmony.PatchAll(Assembly.GetExecutingAssembly());
        }
       
    }

    [HarmonyPatch(typeof(Pawn))]
    [HarmonyPatch("MainDesc")]
    static class PawnPatch
    {
        public static IEnumerable<CodeInstruction> Transpiler(
            MethodBase original,
            IEnumerable<CodeInstruction> instructions)
        {
            return instructions.MethodReplacer(
                AccessTools.Method(typeof(Pawn), "MainDesc"),
                AccessTools.Method(typeof(PawnPatch), "MainDescPatch"));
        }
        static string MainDescPatch(bool writeAge)
        {
            Log.Message("My method was executed");
           
            return "abc";
           
        }
    }
}



harmony log:
PATCHING Verse.Pawn System.String MainDesc(Boolean)
L_0000: Local var #0 System.String
L_0000: ldarg.0
L_0001: ldc.i4.1
L_0002: ldc.i4.1
L_0003: ldc.i4.0
L_0004: call System.String BestKindLabel(Verse.Pawn, Boolean, Boolean, Boolean)
L_0009: stloc.0
L_000a: ldarg.0
L_000b: call RimWorld.Faction get_Faction()
L_0010: brfalse Label #2
L_0015: ldarg.0
L_0016: call RimWorld.Faction get_Faction()
L_001b: ldfld RimWorld.FactionDef def
L_0020: ldfld System.Boolean hidden
L_0025: brtrue Label #3
L_002a: ldstr "PawnMainDescFactionedWrap"
L_002f: ldc.i4.2
L_0030: newarr System.Object
L_0035: dup
L_0036: ldc.i4.0
L_0037: ldloc.0
L_0038: stelem.ref
L_0039: dup
L_003a: ldc.i4.1
L_003b: ldarg.0
L_003c: call RimWorld.Faction get_Faction()
L_0041: callvirt System.String get_Name()
L_0046: stelem.ref
L_0047: call System.String Translate(System.String, System.Object[])
L_004c: stloc.0
L_004d: Label #2
L_004d: Label #3
L_004d: ldarg.1
L_004e: brfalse Label #4
L_0053: ldarg.0
L_0054: ldfld Verse.Pawn_AgeTracker ageTracker
L_0059: brfalse Label #5
L_005e: ldloc.0
L_005f: ldstr ", "
L_0064: ldstr "AgeIndicator"
L_0069: ldc.i4.1
L_006a: newarr System.Object
L_006f: dup
L_0070: ldc.i4.0
L_0071: ldarg.0
L_0072: ldfld Verse.Pawn_AgeTracker ageTracker
L_0077: callvirt System.String get_AgeNumberString()
L_007c: stelem.ref
L_007d: call System.String Translate(System.String, System.Object[])
L_0082: call System.String Concat(System.String, System.String, System.String)
L_0087: stloc.0
L_0088: Label #4
L_0088: Label #5
L_0088: ldloc.0
L_0089: call System.String CapitalizeFirst(System.String)
L_008e: br Label #0
L_0093: Label #0
L_0093: ret
DONE

PATCHING Verse.AreaManager Void ExposeData()
L_0000: ldarg.0
L_0001: call Void Prefix(Verse.AreaManager)
L_0006: ldarg.0
L_0007: ldflda System.Collections.Generic.List`1[Verse.Area] areas
L_000c: ldstr "areas"
L_0011: ldc.i4.2
L_0012: ldc.i4.0
L_0013: newarr System.Object
L_0018: call Void Look[Area](System.Collections.Generic.List`1[Verse.Area] ByRef, System.String, LookMode, System.Object[])
L_001d: ldsfld Verse.LoadSaveMode mode
L_0022: ldc.i4.2
L_0023: bne.un Label #2
L_0028: ldarg.0
L_0029: call Void UpdateAllAreasLinks()
L_002e: Label #2
L_002e: br Label #0
L_0033: Label #0
L_0033: ret
DONE

PATCHING RimWorld.PlaySettings Void DoPlaySettingsGlobalControls(Verse.WidgetRow, Boolean)
L_0000: Local var #0 System.Boolean
L_0000: Local var #1 System.Boolean
L_0000: Local var #2 System.Boolean
L_0000: Local var #3 System.Boolean
L_0000: ldarg.0
L_0001: ldfld System.Boolean showColonistBar
L_0006: stloc.0
L_0007: ldarg.2
L_0008: brfalse Label #2
L_000d: call ProgramState get_ProgramState()
L_0012: ldc.i4.2
L_0013: bne.un Label #3
L_0018: ldarg.1
L_0019: ldarg.0
L_001a: ldflda System.Boolean showColonistBar
L_001f: ldsfld UnityEngine.Texture2D ShowColonistBar
L_0024: ldstr "ShowColonistBarToggleButton"
L_0029: call System.String Translate(System.String)
L_002e: ldsfld Verse.SoundDef MouseoverToggle
L_0033: ldnull
L_0034: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_0039: Label #3
L_0039: ldarg.0
L_003a: ldfld System.Boolean lockNorthUp
L_003f: stloc.1
L_0040: ldarg.1
L_0041: ldarg.0
L_0042: ldflda System.Boolean lockNorthUp
L_0047: ldsfld UnityEngine.Texture2D LockNorthUp
L_004c: ldstr "LockNorthUpToggleButton"
L_0051: call System.String Translate(System.String)
L_0056: ldsfld Verse.SoundDef MouseoverToggle
L_005b: ldnull
L_005c: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_0061: ldloc.1
L_0062: ldarg.0
L_0063: ldfld System.Boolean lockNorthUp
L_0068: beq Label #4
L_006d: ldarg.0
L_006e: ldfld System.Boolean lockNorthUp
L_0073: brfalse Label #5
L_0078: call RimWorld.Planet.WorldCameraDriver get_WorldCameraDriver()
L_007d: ldc.i4.1
L_007e: callvirt Void RotateSoNorthIsUp(Boolean)
L_0083: Label #4
L_0083: Label #5
L_0083: ldarg.1
L_0084: ldarg.0
L_0085: ldflda System.Boolean usePlanetDayNightSystem
L_008a: ldsfld UnityEngine.Texture2D UsePlanetDayNightSystem
L_008f: ldstr "UsePlanetDayNightSystemToggleButton"
L_0094: call System.String Translate(System.String)
L_0099: ldsfld Verse.SoundDef MouseoverToggle
L_009e: ldnull
L_009f: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_00a4: ldarg.1
L_00a5: ldarg.0
L_00a6: ldflda System.Boolean expandingIcons
L_00ab: ldsfld UnityEngine.Texture2D ExpandingIcons
L_00b0: ldstr "ExpandingIconsToggleButton"
L_00b5: call System.String Translate(System.String)
L_00ba: ldsfld Verse.SoundDef MouseoverToggle
L_00bf: ldnull
L_00c0: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_00c5: br Label #6
L_00ca: Label #2
L_00ca: ldarg.1
L_00cb: ldarg.0
L_00cc: ldflda System.Boolean showLearningHelper
L_00d1: ldsfld UnityEngine.Texture2D ShowLearningHelper
L_00d6: ldstr "ShowLearningHelperWhenEmptyToggleButton"
L_00db: call System.String Translate(System.String)
L_00e0: ldsfld Verse.SoundDef MouseoverToggle
L_00e5: ldnull
L_00e6: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_00eb: ldarg.1
L_00ec: ldarg.0
L_00ed: ldflda System.Boolean showZones
L_00f2: ldsfld UnityEngine.Texture2D ShowZones
L_00f7: ldstr "ZoneVisibilityToggleButton"
L_00fc: call System.String Translate(System.String)
L_0101: ldsfld Verse.SoundDef MouseoverToggle
L_0106: ldnull
L_0107: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_010c: ldarg.1
L_010d: ldarg.0
L_010e: ldflda System.Boolean showEnvironment
L_0113: ldsfld UnityEngine.Texture2D ShowEnvironment
L_0118: ldstr "ShowEnvironmentToggleButton"
L_011d: call System.String Translate(System.String)
L_0122: ldsfld Verse.SoundDef MouseoverToggle
L_0127: ldstr "InspectRoomStats"
L_012c: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_0131: ldarg.1
L_0132: ldarg.0
L_0133: ldflda System.Boolean showColonistBar
L_0138: ldsfld UnityEngine.Texture2D ShowColonistBar
L_013d: ldstr "ShowColonistBarToggleButton"
L_0142: call System.String Translate(System.String)
L_0147: ldsfld Verse.SoundDef MouseoverToggle
L_014c: ldnull
L_014d: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_0152: ldarg.1
L_0153: ldarg.0
L_0154: ldflda System.Boolean showRoofOverlay
L_0159: ldsfld UnityEngine.Texture2D ShowRoofOverlay
L_015e: ldstr "ShowRoofOverlayToggleButton"
L_0163: call System.String Translate(System.String)
L_0168: ldsfld Verse.SoundDef MouseoverToggle
L_016d: ldnull
L_016e: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_0173: ldarg.1
L_0174: ldarg.0
L_0175: ldflda System.Boolean autoHomeArea
L_017a: ldsfld UnityEngine.Texture2D AutoHomeArea
L_017f: ldstr "AutoHomeAreaToggleButton"
L_0184: call System.String Translate(System.String)
L_0189: ldsfld Verse.SoundDef MouseoverToggle
L_018e: ldnull
L_018f: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_0194: call Boolean get_ResourceReadoutCategorized()
L_0199: stloc.2
L_019a: ldloc.2
L_019b: stloc.3
L_019c: ldarg.1
L_019d: ldloca.s 2 (System.Boolean)
L_019f: ldsfld UnityEngine.Texture2D CategorizedResourceReadout
L_01a4: ldstr "CategorizedResourceReadoutToggleButton"
L_01a9: call System.String Translate(System.String)
L_01ae: ldsfld Verse.SoundDef MouseoverToggle
L_01b3: ldnull
L_01b4: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_01b9: ldloc.2
L_01ba: ldloc.3
L_01bb: beq Label #7
L_01c0: ldloc.2
L_01c1: call Void set_ResourceReadoutCategorized(Boolean)
L_01c6: Label #6
L_01c6: Label #7
L_01c6: ldloc.0
L_01c7: ldarg.0
L_01c8: ldfld System.Boolean showColonistBar
L_01cd: beq Label #8
L_01d2: call RimWorld.ColonistBar get_ColonistBar()
L_01d7: callvirt Void MarkColonistsDirty()
L_01dc: Label #8
L_01dc: br Label #0
L_01e1: Label #0
L_01e1: ldarg 1
L_01e7: ldarg 2
L_01ed: call Void Postfix(Verse.WidgetRow, Boolean)
L_01f2: ret
DONE

PATCHING Verse.Pawn System.String MainDesc(Boolean)
L_0000: Local var #0 System.String
L_0000: ldarg.0
L_0001: ldc.i4.1
L_0002: ldc.i4.1
L_0003: ldc.i4.0
L_0004: call System.String BestKindLabel(Verse.Pawn, Boolean, Boolean, Boolean)
L_0009: stloc.0
L_000a: ldarg.0
L_000b: call RimWorld.Faction get_Faction()
L_0010: brfalse Label #2
L_0015: ldarg.0
L_0016: call RimWorld.Faction get_Faction()
L_001b: ldfld RimWorld.FactionDef def
L_0020: ldfld System.Boolean hidden
L_0025: brtrue Label #3
L_002a: ldstr "PawnMainDescFactionedWrap"
L_002f: ldc.i4.2
L_0030: newarr System.Object
L_0035: dup
L_0036: ldc.i4.0
L_0037: ldloc.0
L_0038: stelem.ref
L_0039: dup
L_003a: ldc.i4.1
L_003b: ldarg.0
L_003c: call RimWorld.Faction get_Faction()
L_0041: callvirt System.String get_Name()
L_0046: stelem.ref
L_0047: call System.String Translate(System.String, System.Object[])
L_004c: stloc.0
L_004d: Label #2
L_004d: Label #3
L_004d: ldarg.1
L_004e: brfalse Label #4
L_0053: ldarg.0
L_0054: ldfld Verse.Pawn_AgeTracker ageTracker
L_0059: brfalse Label #5
L_005e: ldloc.0
L_005f: ldstr ", "
L_0064: ldstr "AgeIndicator"
L_0069: ldc.i4.1
L_006a: newarr System.Object
L_006f: dup
L_0070: ldc.i4.0
L_0071: ldarg.0
L_0072: ldfld Verse.Pawn_AgeTracker ageTracker
L_0077: callvirt System.String get_AgeNumberString()
L_007c: stelem.ref
L_007d: call System.String Translate(System.String, System.Object[])
L_0082: call System.String Concat(System.String, System.String, System.String)
L_0087: stloc.0
L_0088: Label #4
L_0088: Label #5
L_0088: ldloc.0
L_0089: call System.String CapitalizeFirst(System.String)
L_008e: br Label #0
L_0093: Label #0
L_0093: ret
DONE

PATCHING Verse.AreaManager Void ExposeData()
L_0000: ldarg.0
L_0001: call Void Prefix(Verse.AreaManager)
L_0006: ldarg.0
L_0007: ldflda System.Collections.Generic.List`1[Verse.Area] areas
L_000c: ldstr "areas"
L_0011: ldc.i4.2
L_0012: ldc.i4.0
L_0013: newarr System.Object
L_0018: call Void Look[Area](System.Collections.Generic.List`1[Verse.Area] ByRef, System.String, LookMode, System.Object[])
L_001d: ldsfld Verse.LoadSaveMode mode
L_0022: ldc.i4.2
L_0023: bne.un Label #2
L_0028: ldarg.0
L_0029: call Void UpdateAllAreasLinks()
L_002e: Label #2
L_002e: br Label #0
L_0033: Label #0
L_0033: ret
DONE

PATCHING RimWorld.PlaySettings Void DoPlaySettingsGlobalControls(Verse.WidgetRow, Boolean)
L_0000: Local var #0 System.Boolean
L_0000: Local var #1 System.Boolean
L_0000: Local var #2 System.Boolean
L_0000: Local var #3 System.Boolean
L_0000: ldarg.0
L_0001: ldfld System.Boolean showColonistBar
L_0006: stloc.0
L_0007: ldarg.2
L_0008: brfalse Label #2
L_000d: call ProgramState get_ProgramState()
L_0012: ldc.i4.2
L_0013: bne.un Label #3
L_0018: ldarg.1
L_0019: ldarg.0
L_001a: ldflda System.Boolean showColonistBar
L_001f: ldsfld UnityEngine.Texture2D ShowColonistBar
L_0024: ldstr "ShowColonistBarToggleButton"
L_0029: call System.String Translate(System.String)
L_002e: ldsfld Verse.SoundDef MouseoverToggle
L_0033: ldnull
L_0034: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_0039: Label #3
L_0039: ldarg.0
L_003a: ldfld System.Boolean lockNorthUp
L_003f: stloc.1
L_0040: ldarg.1
L_0041: ldarg.0
L_0042: ldflda System.Boolean lockNorthUp
L_0047: ldsfld UnityEngine.Texture2D LockNorthUp
L_004c: ldstr "LockNorthUpToggleButton"
L_0051: call System.String Translate(System.String)
L_0056: ldsfld Verse.SoundDef MouseoverToggle
L_005b: ldnull
L_005c: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_0061: ldloc.1
L_0062: ldarg.0
L_0063: ldfld System.Boolean lockNorthUp
L_0068: beq Label #4
L_006d: ldarg.0
L_006e: ldfld System.Boolean lockNorthUp
L_0073: brfalse Label #5
L_0078: call RimWorld.Planet.WorldCameraDriver get_WorldCameraDriver()
L_007d: ldc.i4.1
L_007e: callvirt Void RotateSoNorthIsUp(Boolean)
L_0083: Label #4
L_0083: Label #5
L_0083: ldarg.1
L_0084: ldarg.0
L_0085: ldflda System.Boolean usePlanetDayNightSystem
L_008a: ldsfld UnityEngine.Texture2D UsePlanetDayNightSystem
L_008f: ldstr "UsePlanetDayNightSystemToggleButton"
L_0094: call System.String Translate(System.String)
L_0099: ldsfld Verse.SoundDef MouseoverToggle
L_009e: ldnull
L_009f: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_00a4: ldarg.1
L_00a5: ldarg.0
L_00a6: ldflda System.Boolean expandingIcons
L_00ab: ldsfld UnityEngine.Texture2D ExpandingIcons
L_00b0: ldstr "ExpandingIconsToggleButton"
L_00b5: call System.String Translate(System.String)
L_00ba: ldsfld Verse.SoundDef MouseoverToggle
L_00bf: ldnull
L_00c0: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_00c5: br Label #6
L_00ca: Label #2
L_00ca: ldarg.1
L_00cb: ldarg.0
L_00cc: ldflda System.Boolean showLearningHelper
L_00d1: ldsfld UnityEngine.Texture2D ShowLearningHelper
L_00d6: ldstr "ShowLearningHelperWhenEmptyToggleButton"
L_00db: call System.String Translate(System.String)
L_00e0: ldsfld Verse.SoundDef MouseoverToggle
L_00e5: ldnull
L_00e6: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_00eb: ldarg.1
L_00ec: ldarg.0
L_00ed: ldflda System.Boolean showZones
L_00f2: ldsfld UnityEngine.Texture2D ShowZones
L_00f7: ldstr "ZoneVisibilityToggleButton"
L_00fc: call System.String Translate(System.String)
L_0101: ldsfld Verse.SoundDef MouseoverToggle
L_0106: ldnull
L_0107: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_010c: ldarg.1
L_010d: ldarg.0
L_010e: ldflda System.Boolean showEnvironment
L_0113: ldsfld UnityEngine.Texture2D ShowEnvironment
L_0118: ldstr "ShowEnvironmentToggleButton"
L_011d: call System.String Translate(System.String)
L_0122: ldsfld Verse.SoundDef MouseoverToggle
L_0127: ldstr "InspectRoomStats"
L_012c: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_0131: ldarg.1
L_0132: ldarg.0
L_0133: ldflda System.Boolean showColonistBar
L_0138: ldsfld UnityEngine.Texture2D ShowColonistBar
L_013d: ldstr "ShowColonistBarToggleButton"
L_0142: call System.String Translate(System.String)
L_0147: ldsfld Verse.SoundDef MouseoverToggle
L_014c: ldnull
L_014d: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_0152: ldarg.1
L_0153: ldarg.0
L_0154: ldflda System.Boolean showRoofOverlay
L_0159: ldsfld UnityEngine.Texture2D ShowRoofOverlay
L_015e: ldstr "ShowRoofOverlayToggleButton"
L_0163: call System.String Translate(System.String)
L_0168: ldsfld Verse.SoundDef MouseoverToggle
L_016d: ldnull
L_016e: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_0173: ldarg.1
L_0174: ldarg.0
L_0175: ldflda System.Boolean autoHomeArea
L_017a: ldsfld UnityEngine.Texture2D AutoHomeArea
L_017f: ldstr "AutoHomeAreaToggleButton"
L_0184: call System.String Translate(System.String)
L_0189: ldsfld Verse.SoundDef MouseoverToggle
L_018e: ldnull
L_018f: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_0194: call Boolean get_ResourceReadoutCategorized()
L_0199: stloc.2
L_019a: ldloc.2
L_019b: stloc.3
L_019c: ldarg.1
L_019d: ldloca.s 2 (System.Boolean)
L_019f: ldsfld UnityEngine.Texture2D CategorizedResourceReadout
L_01a4: ldstr "CategorizedResourceReadoutToggleButton"
L_01a9: call System.String Translate(System.String)
L_01ae: ldsfld Verse.SoundDef MouseoverToggle
L_01b3: ldnull
L_01b4: callvirt Void ToggleableIcon(Boolean ByRef, UnityEngine.Texture2D, System.String, Verse.SoundDef, System.String)
L_01b9: ldloc.2
L_01ba: ldloc.3
L_01bb: beq Label #7
L_01c0: ldloc.2
L_01c1: call Void set_ResourceReadoutCategorized(Boolean)
L_01c6: Label #6
L_01c6: Label #7
L_01c6: ldloc.0
L_01c7: ldarg.0
L_01c8: ldfld System.Boolean showColonistBar
L_01cd: beq Label #8
L_01d2: call RimWorld.ColonistBar get_ColonistBar()
L_01d7: callvirt Void MarkColonistsDirty()
L_01dc: Label #8
L_01dc: br Label #0
L_01e1: Label #0
L_01e1: ldarg 1
L_01e7: ldarg 2
L_01ed: call Void Postfix(Verse.WidgetRow, Boolean)
L_01f2: ret
DONE




no error, no log message,it simply doesn't replace the text with "abc"
sorry if it is a dumb question/post but I simply can't spot the problem
#3
I was trying to operate a raider prisoner that had just gained a peg leg to replace his lost leg, I don't remember exactly what the surgery was but the doctor made a mistake and turns out he made a cut in the peg leg, and it WAS BLEEDING.

After a raider fight one of my initial colonists named Sasquatch had about 3 rifle shots on his torso one of them in the lung, and a finger or hand shot off, if I remember all right, all fresh and bleeding, and then after the fight was over he casually went to the fridge, picked up a potato meal, went to the table, sited, ate his meal while chatting with the cook, and after that he walked to the hospital.
#4
Help / Re: Sluggish Performance
August 28, 2016, 07:28:06 PM
There is a chance that a mod in the middle of this list does something in a very inefficient manner and eat your RAM and processing power. Some time ago I missed a line in my code and ended up eating all of my 16 gb of ram in around 7 seconds. Is there any modded stuff present in your killbox that is not anywhere else in the rest of the map? even if it is a mod that change behaviour  of batteries, switches or turrets or add a object you have there?
#5
Mods / Re: [request] Save/Load Mod list order
August 28, 2016, 12:51:34 PM
Hey, I'm taking that but as a Windows application instead of mod

Edit: Apparently one already exists> https://ludeon.com/forums/index.php?topic=7188.0
But as the one I started making before I noticed will work with a different purpose I will make it if I have time.
#6
Mods / Re: Race wide pain factor reduction?
August 27, 2016, 11:35:53 PM
I think you can make a invisible hediff, you can use <everVisible>false</everVisible>, notice that it is a tag of hediff stages it has to be in a stage, take a look at hediff alcohol to see it in action. To make a hediff permanently invisible you can set a initial severity that makes the hediff be on the stage with the everVisible false and do a
<li>
        <compClass>HediffComp_Immunizable</compClass>
        <severityPerDayNotImmune>0</severityPerDayNotImmune>
      </li>


I believe this will be able to make a eternal invisible hediff. (not tested), but it is worth a try don't you think?  ;)
Cheers
#7
Help / Re: Texture looks bad ingame
August 27, 2016, 04:12:40 PM
Hello, I don't know the solution for you, but that topic you linked is out of date, it is from november 2013 back when you needed unity assets explorer to mod textures.
#8
Help / Re: Mod Settings and XML's
August 26, 2016, 10:53:37 PM
What you meant in the original post?, it looks like you didn't knew about CCL so I guess the original post wasn't about its configuration.
#9
You will probably have to code something that detects pawns standing in the floor and adds to the pawn comfort, the thing that floors don't have stats will not enable to do it from xml

edit: You asked where to start on the title so a good place would be the tutorials on the wiki about .dll modding and how to set up a solution, decompiling also
#10
Help / Re: Adding a field to an existing core class
August 25, 2016, 09:17:53 PM
In my opinion that post you linked should be a stick in the mod help forum,  I have a mod(unreleased) where I didn't defined the abstract, it works perfectly and don't cause problems to others but I will check it out for sure when I have time. Thanks 1000101
#11
Help / Re: ageFractionChanceCurve
August 25, 2016, 03:02:45 PM
Nice, I was watching this thread because I found it interesting and wanted to know, only to add on the information about the first number, the human lifespan in rimworld is 80, so a 1 on the first number means it will be the chance at 80 years old, and a 1.5 will be 120 years old.
#12
Help / Re: need help with idea.
August 24, 2016, 09:32:37 AM
Just a guess, I think it is a good idea to look into mods that allow the user to set a area to be cleaned and how the game/mod detects the dirt inside this area, after you figured you will have to find out how the game calculates the area to be affected by light (how it stops at walls,etc), OR do something like a orbital trade beacon that sets a area, and sometimes delete some dirt you detected inside this area.
#13
Help / Re: Detour tutorial?
August 23, 2016, 10:19:48 AM
QuoteWell, is this more or less "offensive" and useless?
It is not offensive, but its still useless(not understandable or applicable) to who this thread might interest (beginners), it is like saying for someone detouring for the first time:
Quoteuse (BindingFlags)60 or 0x3F3C
they are probably going to spend 2 hours trying to figure why typing 0x3F3C is giving a error, how big of a help is this? this is a help forum.

QuoteCurrent question is unrelated to CCL or RimWorld, it's generic C# question covered by MSDN documentation.
Original post:
QuoteTrying to learn how to use detours using CCL.
It is related to CCL or Rimworld, even if the original question was about bindingflags, the game modding is done in C# of course is there going to be C# on the forums, what you said is like wanting to do a forum about plumbing without mentioning water.
I have seen several university teachers like you, they know so much and it is so easy that they completely erase of memory how it was when they knew nothing and think everybody understand what they say as easily as they see it.
#14
I don't understand exactly what you want to do and why, but a thing I use all the time is to open the folder I want to look in and put like <backstoryCategory> in the Windows search, it will return nothing, but there will be a option like "content of files" or something like that bellow, then you click it to see all the files that contain it, from there open the files and Ctrl+F it and go hopping occurrences with next.
#15
Help / Re: Broken Traders due to Mods?
August 22, 2016, 08:40:18 PM
Hey, enter on your mod folder and do a search for TraderKindDefs, ignore any results that are in the core folder, the remaining will be inside mods that can be causing the problem.
From there is matter of enabling/disabling the ones that you found in the search to find out exactly the one causing the problem.
To help test faster you can enable dev mode in the options of the game, then click in the left white cog icon above screen and use the button "replace all traders" or something of that sort, this will spawn orbital traders so you can test faster.
Cheers