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

#16
Help / Re: Nested Scroll windows?
April 26, 2021, 02:21:45 AM
Answer: it works when it's not a ThingFiter UI (with scroll bars) inside a Listing_Standard.

I got around the problem by using something like this:

Widgets.ScrollView(...);//use height to make Rects
var l = new Listing_Standard();
l.Begin(innerRect);
...
height=l.CurHeight; //height is an object field
l.End();
var filterRect = new Rect(...);
ThingFilterUI.DoThingFilterConfigWidnow(...);
Widgets.EndScrollView();

It works for now, anyway :)  But listing standards seem hard to use if you want to do anything slightly complicated.  :P
#17
How is your C#?

Another option might be to create an HeDiff that gets applied if the wearer has the right kind of clothing on?
#18
Help / Re: Remove trait by patch
April 25, 2021, 10:46:41 PM
Oh, good, you figured out what was going on :)
#19
Help / Nested Scroll windows?
April 25, 2021, 10:43:27 PM
Hey, everyone!  UI question here:

I have a Listing_Standard with a ScrollView, and inside that scroll view I get a Rect and inside that Rect I do the ThingFilter UI.  The problem is that the ThingFilter's scroll bars do not appear!  Only the ScrollView scroll bars appear...

Does anyone know if this problem will go away if I rewrite everything without the Listing_Standard?
#20
I'm afraid you are referencing technical details that I'm not familiar with.  "Pointers" is a very avoided word in most C# literature, so I'm not sure what you mean?

#21
Help / Re: Remove trait by patch
April 25, 2021, 12:05:53 AM
Hmm.  What's the XML you are using to remove it, what's the trait, and what's the full stack trace from the "Failed to find" error you got?

If you don't see any other references to its defName in any XML files, then something unusual is happening to the def.
#22
Help / Re: Remove trait by patch
April 23, 2021, 11:07:07 PM
...search through all the XML for everything that explicitly references this trait?

That's the most likely source of this error.
#23
There are various ways to make this a faster calculation (if you need speed - and I don't think you do if it's something that only happens from time to time)

One is to cache the .GetField() result during setup in some static variable, and call only .GetValue() when you need it.

A much fancier approach is to write a dynamic method to call it directly (we do this in Project RimFactory to call NoStorageBlockersIn(), which can get called a lot) - it's harder to manage, but is also faster, so if anyone else needs that, it's an option.

In your case, you probably don't need anything more fancy :)  Except null checks - because weird things do happen when mods are involved  ::) (I ran into a Thing with a null ...thingClass? once; I didn't think it was possible and yet...)
#24
Help / Re: How to Create a Settings Page for Mod
April 23, 2021, 10:54:56 PM
Actually, that sort of thing would probably be easy with the XML settings engine Nobo built for Project RimFactory.  In general, there needs to be some link between Settings - which are C#-based, and def patches, which are XML.

If no one else comes up with a useful suggestion, we can see about factoring out the engine to a support mod (which we have talked about doing anyway), and then you could use it?
#25
Quote from: Ashtore on March 08, 2021, 04:54:39 PM
so, the problem has been solved but I have no idea how it got so messed up in the first place.
Almost certainly you ended up with either corrupted mod files, OR(and?) an earlier version of Harmony getting loaded instead of the current one.

Nuking everything from orbit usually fixes this sort of thing  ;D
#26
Just by the way, I have been using your bone mods and a slightly changed version of your surgery mods, and they are great :)  Especially the surgery one - it was really easy for me to finally have my dream scar removal that involves using Components to hack the nanobots in glitterworld medicine.

Yay!
#27
You might look at my Harmony Patches to try and get an understanding of how it's used in the wild - I try and comment all of my patches!
Here's a bunch I've done: https://github.com/lilwhitemouse/RimWorld-LWM.MinorChanges/tree/master/Source

As for your specific case, I see two things:

1.  ...are dead bodies pawns?  I thought they were Things that contain a reference to the dead pawn?  I could super easily be wrong here ;)
2. The simplest approach might be a Prefix - you could test if the gift is a dead pawn of the correct faction and if so, just return your own goodwill result.
#28
Help / Re: A quick tutorial of xpathing and patching
April 18, 2021, 07:39:10 PM
A couple of notes on your xpaths:

First, the PatchOperationTest is mostly superfluous - the PatchOperationAdd will only affect things that match the xpath (and if you set <success>Always</success> you won't get an error message if nothing matches)

Second...what happens when something already has a set of comps?  You might want to do something like

  <PatchOperation Class="PatchOperationAdd">
    <xpath>/Defs/ThingDef[category="Item" and not(comps)]</xpath><!--only add comps if not there-->
    <value><comps /></value>
  </PatchOperation>

and then add your comp.

...I have often found that just going through the DefDatabase in C# is the easier approach :shrug:
#29
Ideas / Re: Your Cheapest Ideas
April 18, 2021, 07:27:41 PM
Quote from: Prologue on November 20, 2020, 11:30:58 AM
Currently captured prisoners are taken to a random empty prisoner bed. When you have multiple places where prisoners can sleep this may result in freshly captured (and often wounded) prisoners getting moved around to every corner of my colony.

You can mark prisoner beds as Hospital beds as well - this can be a really helpful way to specify where wounded prisoners are taken!
#30
Quote from: Waras on December 27, 2020, 04:29:49 AM
Actually this one is still working on 1.2, no bugs or errors so far, even if it shows yellow, as for Rimfactory, I don't want another factory mod as I already have one.
There's also Project RimFactory Lite, which is only conveyors/splitters/etc I think?  So, not a full factory mod.  I have Deep Storage working with PRF!

We found a (somewhat) easy approach to using Deep Storage with the belts; it should be doable with IR if the author would like to use it.