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

#166
Tools / Re: [LIB] Harmony v1.2.0.1
June 08, 2020, 09:19:39 AM
Try starting with

if (codes[i].operand!=null &&....)

If the operand is null, then Parse() will throw that exception.
#167
If you forbid-unforbid them, do they show up?
#168
Running the game from Steam, the logfile is automatically set to /tmp/rimworld_log (line 24 of start_Rimworld.sh).

Perhaps it would be better to:

LOG="-logfile /tmp/rimworld_log_$UID"
# or perhaps
LOG="-logfile /tmp/rimworld_$UID.log"


This would allow Steam (and non-steam players) to correctly start the game.

But yes, this is a problem, and unless the player is knowledgeable, is very difficult to track down - especially for a Steam user.  Please update the start scripts.

Thanks!
#169
I meant "hard" in the sense of "you would have to do it yourself, instead of having RimWorld do it."

RimWorld creates a static background glow level that probably eases that FPS thing (or maybe not, I'm sure you know more about it than I do!), but it doesn't work with anything moving, so....I called it "hard" :)
#170

  • Adding glow to pawns/objects
This is "hard" - the CompGlower will easily add glow to things that don't move, but once they move it's harder.  A few people have managed.  Someone did mining helmets, I think? And maybe vehicles?  So you might look for that and see how they did it.
#171
Tools / Re: [LIB] Harmony v1.2.0.1
June 03, 2020, 06:45:42 PM
Let's see your code?
#172
Help / Re: Adding "Leathery" objects to a recipe
June 02, 2020, 12:41:10 PM
There IS a mod that allows a material filter (Canute - it's been updated to 1.1 and should work fine for Deep Storage, too).  I only see it on Steam:  https://steamcommunity.com/sharedfiles/filedetails/?id=1541305730&searchtext=material+filter

As far as your recipe goes...it's complicated by the fact that in Vanilla, you can't specify what the apparel is made of.  All you can do is say "this recipe uses apparel."   But, if you use the Material Filter mod, you can set up your recipe to only allow leathery goods?  I think - I don't use it myself, so I don't know.

Worst case scenario, you could use C# to write a RecipeWorker and ...maybe IngredientValueWorkerClass? and those might let you force only leathery ingredients.

I can't help much more than that - I don't really do recipes  8)

#173
Better might be: pick an unreserved fire if one exists, otherwise just pick a fire?
#174
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)
#175
Tools / Re: [LIB] Harmony v1.2.0.1
May 29, 2020, 01:18:24 AM
Ah.  That's because the operand isn't a string. It's a method.

I don't know why it's returning null for you, but I've never tried that.  I have checked ((MethodInfo)code[i+9].operand).Name=="TryStartMarriageCeremony (with appropriate checks, that the operation is a Call, that there are 9 more instructions, etc).

As far as calling a method goes, usually it's something like

  yield return new CodeInstruction(OpCodes.Call,  // or the virtual call if appropriate
                    HarmonyLib.AccessTools.Method(typeof(WhateverClass), "NameOfMethod"));
    //       also ....Method("WhateverClass:NameOfMethod"));


If you want to look at Transpilers in the wild, there are a lot of mods that use them.  I try and document what I'm doing in mine as well as I can (so I can use them as a reference, and so I can remember what I was doin).  Transpilers are hard, but really powerful.

What's the link of the example you're looking at?
#176
Tools / Re: [LIB] Harmony v1.2.0.1
May 28, 2020, 08:16:40 PM
I think you can just check  "as string" and it will work if it's actually a string?  What is the context of what you're doing?  A lot of the operands are...difficult for mortals to use (for example, to get the operand from a Ld_loc 13, you'd have to cast it to a ...LocalBuilder? And then get the .index?)  Following someone else's example is often very helpful.
#177
I think two projects (assuming you want to keep code bases the same) is probably the way to go.  If you use git, you can have two different branches, and merging changes from the development branch to the 1.0 and 1.1 branches is relatively straightforward.  Then all you need to do is have to projects, one in 1.0/Source, one in 1.1/Source, and pull the code for each - each from their own branch, and build.

If you do command line building, you can easily have it all basically one step.

I, myself, abandoned the 1.0 branch of my code ;p  The mod still work, but no new updates...  But I don't have a 1.0 version of RW to build against anymore anyway, b/c I was stupid and got the game from Steam.  So I have an excuse, anyway :)
#178
I highly recommend ONE mod that has name that DOES NOT change: this highly increases the likelihood that any compatibility patches will continue to work with your mod after any updates.
#179
Help / Re: PatchOperationFindMod failed
May 28, 2020, 01:01:18 AM
BTW, you probably want to do "/Defs/HediffDef..." instead of "*/HediffDef..." - it's muuuch slower to do the */...

#180
Help / Re: Not Patch on Mod Detected
May 27, 2020, 12:27:50 PM
<nomatch PatchOperation=....>your stuff here</nomatch>