边缘世界 RimWorld

边缘世界 RimWorld

Higher Psylink
Boudoo 2022 年 2 月 27 日 上午 10:39
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
< >
正在显示第 1 - 9 条,共 9 条留言
Imperator 2022 年 5 月 16 日 下午 11:48 
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  [开发者] 2022 年 5 月 17 日 上午 8:42 
the problem is that you cant really make a
Give heddiff with severity type command
Boudoo 2022 年 5 月 17 日 下午 12:23 
My thought was that the base game is doing it somehow, therefore shouldn't a mod be able to call the functionality?
Seti  [开发者] 2022 年 5 月 17 日 下午 12:51 
@Boudoo there isnt, i havent found a single example of the game giving some specific severity through an ability
Imperator 2022 年 5 月 17 日 下午 9:55 
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 2022 年 5 月 17 日 下午 11:06 
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 2022 年 5 月 17 日 下午 11:36 
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 2022 年 7 月 25 日 下午 11:59 
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 2022 年 7 月 26 日 下午 2:12 
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
< >
正在显示第 1 - 9 条,共 9 条留言
每页显示数: 1530 50