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

#1066
Help / Re: New to modding, have a couple of questions
August 30, 2018, 12:26:06 AM
Re: 4.  Actually, both Harmony and HugsLib (which is Harmony with extra fancy icing) offer not only checking dependencies, but also let you see who else is modding a given function and decide where to put yourself in the order.  On the other hand, getting really subtle rules that won't break in unforseen circumstances is pretty much Master-Level coding, and most people probably don't even try.

--LWM
#1067
Help / Re: New to modding, have a couple of questions
August 29, 2018, 02:23:54 PM
1.  How much code your computer can handle.  Realistically, no, there's (probably) no limit, altho your performance might suffer enough that you decide it's not worth it any more...
2.  Mod stability...heh.  A lot of why there's mod instability is one mod stepping on another mod's toes - and that can be really hard to guard against, especially with some of the bigger mods (or more esoteric mods that poke at deep things).  I suppose there are some poorly written mods out there than just crash on their own ;p
3.  Depends on the authors!
4.  I think the answer there is to write a new mod!  :D

#1068
Door code for the win?
#1069
Help / Re: [HELP] Shoot over an impassable structure?
August 29, 2018, 12:37:59 AM
If no one here can answer for you, you might check out any of the embrasure mods to see how they did it.

--LWM
#1070
One approach would be to use Harmony and C# to add a Prefix to the DefDatabase class's Add(T def) method in DefDatabase.cs.  Then check the def to see if it's a building that has compQuality, and if it does, make it so it has a recipe with the proper amount of WorkToMake.  I think ("hope") that would be enough for everything to load properly.

--LWM
#1071
Well...how much spare time to you have?  ^.^  And how willing are you to learn?

This is not actually an impossible task, but it would require some weird hoops to jump through.  Have you done the "setting up a solution" tutorial and the whole "decompile the assembly" thing?

-----
In the "hope of avoiding coding" option, can you just add "workToMake" to the <statBase> section?  It would only work for the items you specified, I suppose, so there's that.

--LWM
#1072
I suspect patching the C# code would make some of this easier/accessible (like WTM loading WTB in object instantiation, etc).  How's your coding skillz?

Sorry not more helpful!

--LWM
#1073
Help / Re: Can't load textures - halp?
August 27, 2018, 03:07:18 PM
Aha!  Yes, but that didn't help.

But I found out what did help!

I needed <texPath>Things/Building/Furniture/shelfx/Shelf</texPath> (or shelfx instead of Shelf if I renamed the images)

So my file path was the directory Things/Building/Furniture/shelfx with files Shelf.png Shelf_front(south).png etc etc, and my texPath needed to point to the filename, not the named directory.

Thanks,

--LWM
#1074
Any coding experience in any language?
#1075
Also, the dialog boxes the game uses are (mostly?) collected in Verse/Dialog_...Rename...etc....cs.

What option are you hoping to add?

--LWM
#1076
You'll have to do something with C#, I think.

So in this case, the message the Comm Console pops up is a great place to start looking.  "Cannot use (no power)" is in the English language XML for CannotUseNoPower, which is located in the game's code in one file:

RimWorld/Building_CommsConsole.cs  (funny that, come to think of it)

So, if you haven't decompiled the assembly yet, do that, and then go poke around in CommsConsole.cs, and you'll see how it's done fairly quickly, I think!

HTH,

--LWM
#1077
Help / Re: [Solved] How to listen for the end of a Job
August 23, 2018, 01:03:19 AM
The other approach would be to try to assign Job B but check for some tangible effect of Job A - and give up on assigning if the effect isn't around.

But that's basically an in-game object/condition taking the place of a global variable.

I'd probably just slap a static List of Job Bs to assign after Job As get done in my class and check for a non-empty list regularly.  Good luck!
#1078
Help / Re: Workaround Needed
August 23, 2018, 12:57:46 AM
You could use the Harmony Transpiler to replace every line with the hardcoded constant fields with a line that uses your own data?

Not super elegant, but you may not have any options, given limitations of compile-time constant fields.

If you rebuild the entire rimworld assembly, you could probably play with it just fine, but uploading it as a mod....doesn't seem quite right.  Don't know if you could do that if you use Steam, either.  I wouldn't go that route!

--LWM
#1079
Help / [Solved] Can't load textures
August 23, 2018, 12:49:34 AM
I'm creating a building, and I'm running into the following error when I try to load my mod:

Failed to find any texture while constructing Multi(initPath=Things/Building/Furniture/shelfx, color=RGBA(0.500, 0.500, 1.000, 0.350), colorTwo=RGBA(1.000, 1.000, 1.000, 1.000))
Verse.Log:Error(String)
Verse.Graphic_Multi:Init(GraphicRequest)

I have copied the "shelf" textures from https://github.com/Alias44/b18-Textures and put them in RimWorld/Mods/MyModName/Textures/Things/Building/Furniture/shelfx

My relevant XML:
    <graphicData>
     <texPath>Things/Building/Furniture/shelfx</texPath>
     <graphicClass>Graphic_Multi</graphicClass>
     <drawSize>(3,2)</drawSize>
      </graphicData>

If I have "Shelf" there instead of "shelfx", it loads fine....What am I doing wrong?

Thanks, LWM
#1080
My reading is that the Reloader mod - which does sound very useful - only applies to the C# .dll part of a mod.  XML?  You're out of luck, unfortunately.

But if your XML is already written, then when you update your dll ("build" or "compile" or whatever) then the changes should get pulled in?  So...you may want to hardcode a skill level in the C# code, play around with it, change it - and auto-reload - etc until you find something that's good, and then put that in the XML?

Good luck, and let us know how it goes!

--LWM