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

Topics - LWM

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?
Releases / Fuel Filter
April 18, 2021, 07:14:47 PM
Hey, y'all! I got tired of my colonists burning super valuable Thrumbone in the blast furnace instead of wood, so I finally made a mod that allows you to select what is used for refueling:

(also available on Steam

LWM's Fuel Filter allows you to choose which possible fuels will actually get used when refueling.

"Hey, what do you have there in your arms?"

        "A big pile of Thrumbone - it's a super expensive bone from a neat mod!"

"Really expensive, eh?"

        "Yeah!  Hard to get - we barely have any and it's great stuff - you can use it like wood!"

"I notice you're walking towards the Blast Furnace. Where are you taking it?"

        "Oh, I'm going to burn it all as fuel."

"Don't we have a lot of really cheap wood?"

        "Yeah, but this was closer!"


As a bonus, I patch anything that burns "WoodLog" (that is, wood) to burn "Woody" things (only helps if you have mods that add woody things, such as Lulu's bone mod, or some of the expanded biome mods...but unless you have a mod like that, you probably don't need this anyway!)  So the Blast Furnace from Project RimFactory can burn the sequoia wood from expanded biomes.  If a similar patch is needed for metals, I can do that too.

Enjoy, --LWM
Please, could you make Graphic_Linked's LinkedDrawFromMat(...) virtual? Given how Prints work, this shouldn't have any impact on performance and would allow greater flexibility for modding.

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)

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?

Bugs / Colonists use telescope during hard snow
August 28, 2020, 11:57:29 AM
Colonists seem perfectly happy to use the telescope during periods of bad weather.  Unless they have the 'creepy' trait (and of course, RW has better taste than that), there isn't anything to look at.

Using the telescope should only happen during clear weather and some of the time during cloudy weather.

It's not a big thing but should be an easy fix for you all.


Could not reserve Thing_DoubleBed216411 (layer: null) for Archie for job Meditate (Job_1401307) A=Thing_DoubleBed216411 (now doing job Meditate (Job_1401307) A=Thing_DoubleBed216411(curToil=-1)) for maxPawns 1 and stackCount -1. Existing reserver: Wolf doing job LayDown (Job_1401288) A=Thing_DoubleBed216411 (toilIndex=2)
Verse.Log:Error(String, Boolean)
Verse.AI.ReservationManager:LogCouldNotReserveError(Pawn, Job, LocalTargetInfo, Int32, Int32, ReservationLayerDef)
Verse.AI.ReservationManager:Reserve(Pawn, Job, LocalTargetInfo, Int32, Int32, ReservationLayerDef, Boolean)
Verse.AI.ReservationUtility:Reserve(Pawn, LocalTargetInfo, Job, Int32, Int32, ReservationLayerDef, Boolean)
Verse.AI.Pawn_JobTracker:StartJob(Job, JobCondition, ThinkNode, Boolean, Boolean, ThinkTreeDef, Nullable`1, Boolean, Boolean)

Followed by the warning:

TryMakePreToilReservations() returned false for a non-queued job right after StartJob(). This should have been checked before. curJob=Meditate (Job_1401307) A=Thing_DoubleBed216411
Verse.Log:Warning(String, Boolean)
Verse.AI.Pawn_JobTracker:StartJob(Job, JobCondition, ThinkNode, Boolean, Boolean, ThinkTreeDef, Nullable`1, Boolean, Boolean)

Archie, for what it's worth, is a Wimp, and is in pain shock; no idea if that affects anything, especially given other reports of meditation problems with two ppl in one bed?

I have no idea if this happens in larger beds.
If you shoot a mechanoid and completely destroy a body part, it does not wake the mechanoid.

Example: Jojo just shot the pikeman and shot off the rear right foot.  The mechanoid continues to sleep (its log is aware Jojo hit the pikeman with a bullet).

Expected: Jojo is murdered in so many ways by robotic horrors.
The defoliator ship part's description includes "These kinds of weapons are sometimes scattered across farmlands or forests during land"

This doesn't make sense?

The description isn't 100% otherwise, either - they are some sort of "Agent Orange" that doesn't hurt humans?

I had several wounded enemy pawns in beds, and at one point, this error showed up:
(It looks like RimWorld.JobGiver_MeditateInBed:TryGiveJob(Pawn) tried to call the royalty function)

Meditation foci are a Royalty-specific game system. If you want to use this code please check ModLister.RoyaltyInstalled before calling it.
Verse.Log:Error(String, Boolean)
Verse.Log:ErrorOnce(String, Int32, Boolean)
RimWorld.StatWorker_PossibleCompOffsets:GetValueUnfinalized(StatRequest, Boolean)
RimWorld.StatWorker:GetValue(StatRequest, Boolean)
RimWorld.StatWorker:GetValue(Thing, Pawn, Boolean)
RimWorld.StatExtension:GetStatValueForPawn(Thing, StatDef, Pawn, Boolean)
RimWorld.MeditationUtility:BestFocusAt(LocalTargetInfo, Pawn)
Verse.AI.ThinkNode_JobGiver:TryIssueJobPackage(Pawn, JobIssueParams)
If a colonist is on fire-duty, and a tree right next to them is on fire, and it's a tree in the home area and its on fire, but another pawn on the other side of the map says they'll take care of it, the pawn right next to the burning tree will decide their duty is done and will stop to eat while sparks fall around them, or maybe will walk back to bed while the fire they were right next to spreads behind them, destined to destroy half the orchard.

You can't even micro-manage them by right clicking on the fire.  (and you shouldn't have to - they're right next to a tree that's an inferno!)

Putting out fire should definitely NOT be reserved like this.  (Although it was kind of funny, in a "poor life choices" kind of way)
Verse.TexButton is an internal class.  If it were a public class, then modders could more easily match the look of the vanilla game.

Modders can get around this by keeping a static Texture2D and using Harmony (or reflection):

        static MyThingThatNeedsTexture_StaticConstructor () {
                .TypeByName("Verse.TexButton"), "Drop").GetValue(null);
        private static Texture2D Drop; // == TexButton.Drop

But that is not elegant and adds unnecessary clutter to mods.

Thank you for the consideration!
GenConstruct's CanPlaceBlueprintOver will not allow placing a terrain (e.g., wood floor) underneath a building which has no terrainAffordanceNeeded requirement (e.g., a modded marker with terrainAffordanceNeeded of null).

Instead, the player must remove the building with no terrain requirement, put down the new floor, and then replace the building with no terrain requirement, which does not make sense.

Better would be: if the new def is a TerrainDef and the old def has no requirement, skip any terrain affordance tests.

A minor bug, but annoying when it crops up!

If a pawn is blind, they can still run around an unfamiliar base at full speed.  If you check their move speed, it includes:
Moving: x100% (100% importance)
Multiplier for Light 100%: x100%
The health multiplier should probably be adjusted for a pawn's sight when moving. Blind people are quite capable of moving at a decent speed IRL, but they do need to be careful about legos left out on the floor or chairs some idiot built in the middle of the sidewalk.  (This is not much of an issue at a personal workbench, as they will know where they keep their tools, etc)

The Light modifier should not apply for pawns with very minimal vision stats - they are used to moving around with minimal light, so ambient light doesn't matter as much.

I'm not blind, so I can't give a good estimate of appropriate adjustments.
Stories / Who needs eyes, anyway?
May 09, 2020, 02:11:35 AM
So I have a blanket rule:  If I'm fighting a child soldier and they get downed, I do what I can to capture them and if possible recruit them.  (otherwise, I rarely recruit prisoners - seems too creepy)

Okay, current game, I'm raiding a camp that's been attacking caravans in the area, and I lure the pirates into an abandoned building where I can hit them with everything at once, and I'm bringing my melee fighter around to intercept the pirate with the incendiary launcher before he can get a shot off.  I check on the poor bastard who walked into the choke point and is getting hit hard, and I pull up the Heath tab.

Both eyes torn out by the elephant.  Wow, that's harsh.  And she's just a kid.  Ouch.  I glance at the Bio - minimal skills, terrible fighter, beginner cook, but hey, at least she's both an Undergrounder AND a Night Owl?  (If blind Night Owls get penalties while inside, I am SO filing a Bug report!)  So she should at least accept the whole "darkness" thing.

Well, maybe she'll die?  Oh hey, she went down, pirates are fleeing, and Ali is in Pain Shock.  And her only bleeding wounds are the eyes.  Okay then.  Guess it's good that the reward I was getting was a bionic eye?

I love this game.
I have enjoyed playing scenarios of "crash landed on a planet really far from anywhere, and there are no trade ships, etc."  How am I supposed to get plasteel without mechanoids to disassemble?

:(   >:(

I can't dig for it with the new deep drills, because the scanner still requires advanced components - which, guess what, you also can't get without trade.  So I'm not impressed with them much.

I guess the only option is to go on long enough that I finally get some centipedes that can give plasteel?  I can still get Advanced Components form mech ships that fall, right?

I'm not liking the restricted options here; not fun.
If an animal is designated for hunting and you select a pawn, you can right-click on the animal to prioritize hunting.

Good so far.  However, if the animal is moving, the right-click menu only offers the "hunt" option if the player right-clicks on the cell the animal is still registered in - including if the animal appears to be in another cell.  This can make prioritizing hunting very difficult.

(Speaking of right-clicking, RimWorld.FloatMenuMakerMap's AddHumanlikeOrders() still calls GenUI's TargetsAt() which is marked as "Obsolete:" "Only need this overload to not break mod compatibility."  Is that changing at some point?  Is TargetsAt() not actually obsolete?  Is there a better place to ask this question?)
This isn't an issue on systems that are case-insensitive, but this causes players on Linux systems to show the mod as being seriously flawed (no name, description, versions, etc).

RimWorld should complain when a player uploads a mod with "about.xml" instead of "About.xml".

Alternately, RimWorld should accept both about.xml and About.xml.
If you have no mods active, and go to a mod that requires HugsLib (which is available, just not active), the page will helpfully tell you what is required and will even let you go to the HugsLib page...however, you cannot actually activate HugsLib without going and looking and eventually finding it in the giant list of mods you have.

Much better would be the option to directly activate a required mod (and either automatically sort the two mods, or trigger an indication that the mod list needs to be sorted?)

Thank you
General Discussion / Geothermal fires: new update?
April 26, 2020, 01:13:48 PM
So the most recent update seems to have changed how geothermal power plants work?  I have had one top of a geyser, tightly enclosed in a room attached to my living quarters.  It's cold out, so I was keeping it roofed and venting to the rest of the base.  During summer, I would remove the roof so as not to overheat.

This year....this year I am on the Apr 20th update and now geothermal plants are no longer walkable?  I don't seem to be able to do anything about the roof - which seems a terrible terrible choice (esp for any new players who find out too late they shouldn't have left roof over the inside squares!  Too late now!), but which also means that spontaneous fires are starting on the doors around the building, as they spike in temperature to over 400C and start burning.

So....geothermal plants are no longer as viable as heat sources...  Unless there's a way to use them I'm not seeing?
If one pawn (with ranged weapon) is selected, the user may press 'b' or the appropriate weapon gizmo and then select a target beyond the weapon's maximum range.  The pawn will then begin targeting, and when the target closes to range, the pawn will attack as per normal.

If multiple pawns (with ranged weapons) are selected, the user may still press 'b' or the 'attack' gizmo and then select a target.  Any pawns whose weapons can reach the distant target will begin attacking/aiming as per normal.  Any pawns whose weapons are out of range of the target will ....just stand there, looking for bunnies in the clouds.

Expected behavior: pawns out of range will behave as if they were the only one selected, and wait for target to close before opening fire.  (targeting as opposed to trying to attack?)

(Where this might come up: hunting approaching animals in drafted groups, or concentrating fire on one particular enemy as they close)