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 - LWM

#46
It's possible to do it via C# (with a Harmony Postfix of BackwardCompatibility to add in replacing your def with theirs, while simultaneously removing your def via patching), but I don't think there's any way to do it with just XML.

Honestly, hiding it behind research like that is a good hack.
#47
Another option would be

[HarmonyPatch(typeof(Caravan), "get_NightResting")]

This is, I believe, an artifact of the way C# internally names things.  The "MethodType.Getter" is probably easier to read for people who are new to Harmony.
#48
How about pasting the XML you're trying to patch?
#49
Patch Operations are how to change something in XML.  They're all explained in the wiki?

Harmony works on anything?

What are you trying to do?
#50
The packageID may be correct, but that doesn't matter.  You need to use name.
#51
You might have multilple things fighting for the same input in that rect.

Why not split up the rect into two parts, and pass one part to base.DoWindowContents, and then put your TextField into the other rect?
#52
If you have a piece of apparel on the ground, the graphic used is a cached Graphic_RandomRotated.  If you take the graphic and do a GetCopy(newSize) it fails.

  var tinyGraphic = apparel.Graphic.GetCopy(new Vector2(0.5f,0.5f));

When this is attempted in game, the GraphicDatabase fails:

Exception getting Verse.Graphic_RandomRotated at : System.ArgumentException: Invalid generic arguments
Parameter name: typeArguments
  at (wrapper managed-to-native) System.Reflection.MonoMethod.MakeGenericMethod_impl(System.Reflection.MonoMethod,System.Type[])
  at System.Reflection.MonoMethod.MakeGenericMethod (System.Type[] methodInstantiation) [0x00071] in <567df3e0919241ba98db88bec4c6696f>:0
  at Verse.GenGeneric.InvokeStaticGenericMethod (System.Type baseClass, System.Type genericParam, System.String methodName, System.Object[] args) [0x00009] in <b02b390b894d4487a224faae4a3db641>:0
  at Verse.GraphicDatabase.Get (System.Type graphicClass, System.String path, UnityEngine.Shader shader, UnityEngine.Vector2 drawSize, UnityEngine.Color color, UnityEngine.Color colorTwo, Verse.GraphicData data, System.Collections.Generic.List`1[T] shaderParameters) [0x00105] in <b02b390b894d4487a224faae4a3db641>:0
Verse.Log:Error(String, Boolean)
Verse.GraphicDatabase:Get(Type, String, Shader, Vector2, Color, Color, GraphicData, List`1)
Verse.GraphicDatabase:Get(Type, String, Shader, Vector2, Color, Color)
Verse.Graphic:GetCopy(Vector2)


This is mainly of interest to mod authors who want to draw tiny suits of plate armor on conveyor belts or in storage.  At the least, if `subGraphic` were public, we could use that.  If there is another workaround (or a better way to scale the image of spawned apparel) I would happily use it?

Thanks,
LWM
#53
General Discussion / Re: The Problem With Royalty
September 29, 2020, 10:11:42 PM
You know, I have always thought "If I wanted to, I'd load the RimWorld of Magic mod and play with spells/etc"  But maybe I'll give Royalty a go!
#54
Help / Re: Patching fails, why??
September 29, 2020, 01:46:09 AM
Try making it a series of 4 separate operations - that way, if one fails, you'll get red errors on startup.

Regarding the label and description...they don't seem to be amenable to changes via PatchOperations. I know they can be changed by way of Language defInjections (look at any language file for vanilla defs to see examples), so that might be an option for you.

Regarding showing contents, I thought that was one of the things one can change in the DS mod settings :)

Worst case scenario, you could always create a new def that does what you want and hide the old one via mod settings?
#55
Ideas / Re: Allow override of enforced slowdown
September 26, 2020, 11:09:38 PM
TD's Enhancement Pack lets you Shift-Click to set a speed despite the lock at normal speed.
#56
There is actually a very small chance it can happen even at level 20 skill!

For our automated accident-free kitchen (Project RimFactory) we had to directly patch the code to skip that chance :p  So....you got unlucky.  Maybe your cook got distracted that day and didn't realize they were grabbing day-old egg whites and ...ew?
#57
Ideas / Re: Your Cheapest Ideas
September 26, 2020, 06:26:44 PM
Better Pawn Management (I think that's what it's called) allows you to do that with 3 clicks (open Animals window, click button, select your allowed areas for raid conditions)
#58
One advantage of removing the def entirely: it doesn't accidentally show up somewhere in game because there was an unknown reference - you *KNOW* there's another reference because it breaks  ;D ::) :laughs:

Another really nice advantage: it doesn't show up in ThingFilters for storage - if you're trying to store all your leathers by category, having to wade through a dozen Elephant/Gopher/Lynx/Giant Moth/Armadillo/Giant Snail/Tapir/Sloth/Python/Reindeer/Crocodile/Hippo/Macaw/Sea Lion/Meerkat/Auroch/Pug/LLama/Pheasant/Hermit Crab/Space Amoeba/Lion/Wildebeest/Skunk/... what was I saying?
#59
The way defs go is this:
First round of defs are loaded.
Patches are run
Crossreferences are resolved  <----error is happening here.

(Somewhere in there, magic defs are generated, including a lot of leather defs and meat)

I think something is referencing the old elephant leather, so when you remove the def, when it gets around to step 3, it goes looking for the def and can't find it.

Search all xml for references to elephant leather to find what else might need patching?  Or maybe something weird is happening in regards the generated defs?

--LWM

ps - mod order doesn't matter.  All it means is that your patches run after VExpanded's patches....which they probably don't bother having.
#60
If your C# is strong, you could always make a derived class of the comp, and make it auto-reload?  I don't know if it would solve the problem (you clearly have a better grasp than I) but it's a thought?