RimWorld

RimWorld

Higher Psylink
Boudoo 27 Feb, 2022 @ 10:39am
Apotheosis not granting psylink beyond level 1, collaborative troubleshooting?
I only have some basic webdev experience but I've looked through and changed xml files from rimworld mods before so I thought I'd take a look. At first I thought that the code might say something like "Set psylink to True" instead of something like "Increase psylink by 1".
So I've been looking through the XML files of this mod and the main Rimworld folder and this is sadly all I could find:

In the mod's file BetterAbilities.xml the apotheosis ability (at the bottom) says "<hediffDef>PsychicAmplifier</hediffDef>". Now I don't know how this exactly would relate to the actual item/effect of a psychic amplifier so I went looking into the Rimworld folder and in Data/Royalty/Defs/HediffDefs I found the <HediffDef> with defName>PsychicAmplifier</defName>, I think this is the effect that is being "called" in the mod but I'm not sure. This HediffDef only mentions some states of psylink level and their effects as far as I can tell and not an actual increasing psylink level effect. It does state <initialSeverity>1</initialSeverity> <!-- Severity is bound to level of implant --> which I think explains the character just being granted this level 1 psylink since there is no increasing value.
This is all I could find and I'm currently not sure where else to look for this increasing value mechanic, I think that's somewhere in the actual dynamic codebase and can't actually be within xml.

Any thoughts? :D
< >
Showing 1-9 of 9 comments
Imperator 16 May, 2022 @ 11:48pm 
You are exactly right-- adding the psylink hediff only sets it to severity level 1. I will look up the correct code to call in order to increase severity instead.
Seti  [developer] 17 May, 2022 @ 8:42am 
the problem is that you cant really make a
Give heddiff with severity type command
Boudoo 17 May, 2022 @ 12:23pm 
My thought was that the base game is doing it somehow, therefore shouldn't a mod be able to call the functionality?
Seti  [developer] 17 May, 2022 @ 12:51pm 
@Boudoo there isnt, i havent found a single example of the game giving some specific severity through an ability
Imperator 17 May, 2022 @ 9:55pm 
I decompiled your code and looked around. I see what you mean, it's just the basics. I think we can create a snippet or custom hediff that does this, but I would rather work with the more human looking source than continue with the decompiled .dll. If you have a github link, please PM it to me. For reference, I am thinking about implementing a custom psycast that applies a hediff and then modifies the hediff severity, or something like that.
Imperator 17 May, 2022 @ 11:06pm 
I think we can get what we want by adding a new component properties def and component abilities def. Let's plan to call them something like
`PSY_CompProperties_AbilityGiveHediff : CompProperties_AbilityGiveHediff`
`PSY_CompAbilityEffect_GiveHediff : CompAbilityEffect_GiveHediff`

I believe we can call the base classes and then add a line to the properties def, the ability effect def, and the xml def for the psycast where comps are listed all handling the severity increment.

It may be as simple as calling += 1 on the severity, but it is possible we'll have to add just a little more code to get the existing value so we can increase it to the correct value. Let me know if you'd me to help you implement this further.
Imperator 17 May, 2022 @ 11:36pm 
There is a function in PawnUtility called
`public static void ChangePsylinkLevel(this Pawn pawn, int levelOffset, bool sendLetter = true)`

That can be inserted into the method connected to the property `Props.replaceExisting` which, if followed by a short circuit, would handle the psylink incrementation seamlessly
Boudoo 25 Jul, 2022 @ 11:59pm 
As I'm probably going to do another playthrough soon I'd love to see this working out. @Seti you wouldn't want to share your source code for this mod?
Get Donked On 26 Jul, 2022 @ 2:12pm 
i mean only input i have for this is that the royalty ritual done by the bestower seems to increase psyilink in a pretty odd way maybe that;s a good place to look
< >
Showing 1-9 of 9 comments
Per page: 1530 50