Turning off experience gains from building items?

Started by ilikerimworld, March 01, 2019, 04:55:48 AM

Previous topic - Next topic

ilikerimworld

I want to turn off the experience toward the construction skill a pawn gains from building all traps. (in another mod, I increased the work to build value x20, but the experience for the construction skill is per tick and not per task, so it's bonkers)

How do I go about it?

Can it be done with xml alone? I don't know how to C#.


ilikerimworld

I kinda need more information lol.

I had a look at some mods that mess with the experience gains, like skilled stonecutting and mad skills using either notepad++ or dnspy, but neither seems to be relevant to what I'm trying to do.

Is there not an easy way to mod all def security buildings = 0 experience I could try to mod on my own?

LWM

Did the other mods, by any chance, help you figure out where in the code experience is actually given to pawns?

ilikerimworld

#4
No. The skilledstonecutting mod adds a def stats that links the work stone cutting to the construction skill, and the mad skills mod seems to add a bunch of modifiers  (multipliers) using Harmony. ([HarmonyPatch(typeof(SkillRecord))]. So something to do with SkillRecord I suppose.

LWM

That 2nd one sounds promising.  Not fun, but promising.  You might read thru the decoded code there and see if you can figure out what's going on.

--LWM

Mehni

JobDriver_ConstructFinishFrame.

The culprit is inside an anonymous delegate inside an IEnumerable. That's not an easy transpiler to write. The alternative (copy-paste the whole shebang) will lead to a bunch of conflicts and unwanted side-effects.

ilikerimworld

protected override IEnumerable<Toil> MakeNewToils()

This?

Is that possible to add some lines to exclude some specific buildings, or how does that work? Ideally, we still want to use the construction skill to build x, but no experience is gained doing so.

What else would you suggest that is easier to implement? I just want to nerf traps with no side effect lol.

Mehni

QuoteWhat else would you suggest that is easier to implement? I just want to nerf traps with no side effect lol.

Since you "don't know how to C#" and didn't show an interest in learning it, I'd recommend sticking to XML and thinking up some creative drawbacks. Research. Costs. Placeworkers. Stuff like that.

If you want to learn C#, I still don't recommend changing the xp gained from the job. It'll take you hours/days/weeks and that's time that could be spent on more creative ways to balance and add to your mod. With C# you can change how the trap itself works, and balance around that.

Canute

An idea from a non-modder. :-)
If you don't want that traps give construction XP, remove them from construction and create a recipe for the crafting spot to create minified traps.

LWM

If you want to work with C# (especially if you already know another programming language), I can help with the Transpiler part - it would be a similar change to several I've very recently done, actually (which is the only reason I'd be able to do it in a reasonable amount of time ;p )

I would need a test function that returns a bool and tests a Frame frame.  And probably caffeine.

But both Mehni and Canute's suggestions are good approaches, and a lot simpler in some ways ^.^

--LWM

ilikerimworld

> LWM > Mehni

Don't worry about it.

I'll make some made up rules and enjoy the game as is.

Something like: maximum number of traps on the map = number of pawns - number of pawns with melee/shooting skill > 6. Should provide a more balanced combat experience where both melee/shooting and traps are useful.

I simply find baffling how nobody has modded it yet given how broken traps/turrets are.

> Canute

I suppose that could work. It should be possible following a guide + slapping together some of the smoke leaf joint code and trap code + visual assets together, or do I need something else?