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

#1051
I glanced at how hard this would be to do, by the way.

Making a second fuel requirement as a new comp?  trivial.

Getting it to not produce heat, or glow, or have a fire overlay,  without both fuels?  Well, this can be done?

Or explode if the 2nd fuel is explosiveExpandPerFuel?  Okay...

Getting it to burn fuel 2 while it's being used for whatever?  This is also doable, probably as a derived thingClass, so no patching even.

Getting pawns to refuel it?  Duplicate about 6 files worth of code and corresponding XML :p  But technically doable.

I would estimate this as more than a coffee's worth of work; it probably involves a big bagel sandwich too.

Another approach might be creating a magical piece of dirt that requires fuel and linking it to the parent, but I have no idea if that's any easier - probably not ;)

Doable?  Yes.  First project for C#?  How brave ARE you ;)

--LWM
#1052
Ah.  Nope.  I believe I have solved your problem.

Make your kerosene burner flickable BEFORE you make it burn fuel.  Right now the code checks if it's flickable once - when it loads the burning fuel comp.

You'll still lose fuel in the rain.

BTW, the Glowable comp checks much more often whether it's flickable - it probably shouldn't, actually, as there's a performance hit.  The fire overlay?  That WOULD take C#.  Very simple C# (with Harmony), but C#.  How much do you want it gone?

Also, BTW, the campfire is probably a building_workbench because you can cook on it.  You might go with "Building"...unless you're cooking on the kerosene heater....which actually isn't completely unreasonable, if it's crazy slow?  Maybe?

Hope that helps....and this is actually a really cool little mod idea - I like it!

--LWM
#1053
Help / Re: Can fuel consumption be disabled with flick?
November 30, 2018, 02:26:20 AM
It really seems to me like it should work as you have written it.  I'm not sure why it doesn't, TBH.

Have you considered making it a "Building" instead of a "Building_Worktable"?  Also, even if it's turned "off" it will still burn fuel if it's in the rain, because you have set <fuelConsumptionPerTickInRain>0.0006</fuelConsumptionPerTickInRain>.

--LWM
#1054
Help / Use dnSpy
November 30, 2018, 12:13:35 AM
Quote from: Temeez on January 07, 2015, 02:29:54 AM
I had the same problem. I don't know the exact reason why assembly decompilers can't seem to open those pieces of codes. The only way I managed to understand a JobDriver and WorkGiver was to look at other mods that had them.

I used 3 different decompilers when learning, because sometimes I got different results when decompiling something. Xamarin Studio, JetBrains dotPeek and ILSpy...

I cannot recommend dnSpy enough.  I dual boot Windows and Linux and the only time I ever boot into Windows is so I can use dnSpy when a new version of RimWorld comes out.  I then save(export?) the project and then go back to Linux to work on mods.

https://github.com/0xd4d/dnSpy

--LWM
#1055
Help / Re: C# Pawn Inventory Help
November 29, 2018, 10:38:05 AM
Have you looked at the ThingOwner code?  I think that might be the right place to start?  I've only seen it in passing, so no promises ^.^

--LWM
#1056
Help / Re: Plants producing two products
September 10, 2018, 08:01:51 PM
How odd.

How about


GenPlace.TryPlaceThing(expr_86, base.Position, base.Map, ThingPlaceMode.Near);

?
#1057
Help / Re: Plants producing two products
September 03, 2018, 10:09:57 PM
What was the exactly line you used the last time that VS kicked out?

If all else fails, try


    Thing thing2;
    GenPlace.TryPlaceThing(expr_86, base.Position, base.Map, ThingPlaceMode.Near, out thing2, null, null);


HTH, --LWM
#1058
Help / Re: Help / Changing mood values?
September 03, 2018, 10:02:23 PM
Pick a phrase in a part of the system you're interested in doing.  Search thru all the XML in <game dir>/Mods/Core/... for that phrase.  That should give you a starting point to figuring out how things are done by the base system (and can be done by mods)

--LWM
#1059
No, I was thinking of a "roll your own" comp_fuelable_two (or whatever) that links to your own code.

--LWM
#1060
Those messages in the upper left?  I know in B18 the syntax in the code was something like
    Messages.Message(s, MessageTypeDefOf.NeutralEvent);
"s" here is a string....but that's not easy to translate.  So you'd do something like this:
Messages.Message("RecipeCannotHaveTargetCount".Translate(), MessageTypeDefOf.RejectInput, false);

And you'd have XML in the Languages/English directory that has the actual text.  A good general idea for figuring out how such things work?  Search.  Search for the string in the entire code base.  Search for the string in all the xml files in RimWorld/Mods/Core/ (maybe only .../Core/Defs and .../Core/Languages/English or whatever).  Every platform has some way to do it; I only know Linux ^.^

Hope that helps, good luck with the smoothed XML!

--LWM
#1061
Well, I would suggest adding another comp class to your building, and might have had a reasonable tutorial to point to, but then steam finally updated me to B19 >_<   I haven't dealt with that yet.  There may be others out there that would help.

But then if you basically copy everything from the fueled comp class (and related classes), there's a fair chance it would work.  It's not exactly elegant, but if it works, it works.

--LWM
#1062
Help / Re: New to modding, have a couple of questions
September 03, 2018, 02:59:23 AM
Yeah, okay, very true.  Probably better to use harmony  ;D

As far as your question OP, ah......well, I can figure out what a lot of them mean now because I have a fair understanding of how the code base is set up (yay doing mods that require altering base functionality?).  If I run into one I don't understand, I can also look up the code where it occurred and try to piece together what's actually happening.

But that's a lot of investment just to read a log file ;)  So...there's no easy way to read them that I know.
#1063
Bugs / [1.1.2579] Pawn tried to path while downed
September 03, 2018, 02:54:09 AM
Today I ran into a situation where an animal "tried to path while downed."  "This should never happen."

This WILL happen in the following situation:

# The animal's master is drafted
## the animal responds to drafting
# the animal is in combat
# (maybe not important) While the animal is in combat, the zone for the animal is changed to one that means it must move
# The animal is wounded
# the animal makes an attack? (and is busy?)
# The animal is undrafted (master is still drafted?)
# The animal is downed by combat before it can begin moving.

Guy tried to path while downed. This should never happen. curJob=LayDown (Job_1989186) A=Thing_AnimalSleepingSpot592075
Verse.Log:Error(String, Boolean)
Verse.AI.Pawn_PathFollower:StartPath(LocalTargetInfo, PathEndMode)
RimWorld.<GotoBed>c__AnonStorey0:<>m__0()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:DriverTick()
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick()
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay() etc

It's not a huge bug, and not important, but maybe once a pawn goes down, its current job should be set to "being unconscious" or something?

Thanks,

--LWM
#1064
CodeAcademy had some fun start-programming things, as I recall.  If you can't start in C#, javascript is a reasonable alternative.

Another question is how comfortable you are doing arcane things you don't understand.  Like that "setting up a solution" tutorial out there - if you can follow that, that's good!
#1065
Oh, hmm.  thingDef2 is the old thing and thingDef is the new thing (ish):
So if (the old thing is a Wall or IsSmoothed (that new mechanic for smoothing stone walls?)) and you canPlaceOverWall, then allow it.  But your thing isn't a Wall...

                    if (thingDef2 != null && (thingDef2 == ThingDefOf.Wall || thingDef2.IsSmoothed) && thingDef.building != null && thingDef.building.canPlaceOverWall)
                    {
                        return true;
                    }


Can you make your fence "IsSmoothed"?  That might be possible in XML?  And might not even affect too much!

Otherwise, patching with Harmony looks easy ^.^  (Says the person who's done a lot of Harmon patching the last few weeks :p )

--LWM