RimWorld

RimWorld

More Psycasts
 Denne tråd er blevet fastgjort, så den er sikkert vigtig
Noodles  [udvikler] 18. apr. 2021 kl. 14:35
Bugs
I case you find any bugs, feel free to report them in this thread. I'll take a look and try to fix them.
< >
Viser 1-15 af 31 kommentarer
Hydrotoast 12. maj 2021 kl. 11:07 
For the infinite cast sound by Fertility Skip, the debug log is spamming a single stack trace. Perhaps this may help debug the issue?

Exception ticking Hotaru (at (22, 0, 23)). Suppressing further errors. Exception: System.InvalidOperationException: Sequence contains no elements at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00010] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 at MorePsycasts.CompAbilityEffect_FertilitySkip.Apply (Verse.LocalTargetInfo target, Verse.LocalTargetInfo dest) [0x00208] in <94c561f1cff64965bb8c5dcf2ee0668a>:0 at RimWorld.Psycast.ApplyEffects (System.Collections.Generic.IEnumerable`1[T] effects, Verse.LocalTargetInfo target, Verse.LocalTargetInfo dest) [0x00018] in <c36f9493c9844ddaa7fb5c788416098f>:0 at RimWorld.Ability.ApplyEffects (System.Collections.Generic.IEnumerable`1[T] effects, System.Collections.Generic.IEnumerable`1[T] targets, Verse.LocalTargetInfo dest) [0x00010] in <c36f9493c9844ddaa7fb5c788416098f>:0 at RimWorld.Ability.Activate (Verse.LocalTargetInfo target, Verse.LocalTargetInfo dest) [0x0001d] in <c36f9493c9844ddaa7fb5c788416098f>:0 at RimWorld.Psycast.Activate (Verse.LocalTargetInfo target, Verse.LocalTargetInfo dest) [0x00175] in <c36f9493c9844ddaa7fb5c788416098f>:0 at RimWorld.Verb_CastAbility.TryCastShot () [0x00000] in <c36f9493c9844ddaa7fb5c788416098f>:0 at Verse.Verb.TryCastNextBurstShot () [0x00012] in <c36f9493c9844ddaa7fb5c788416098f>:0 at Verse.Verb.VerbTick () [0x00034] in <c36f9493c9844ddaa7fb5c788416098f>:0 at Verse.VerbTracker.VerbsTick () [0x00019] in <c36f9493c9844ddaa7fb5c788416098f>:0 at RimWorld.Ability.AbilityTick () [0x00006] in <c36f9493c9844ddaa7fb5c788416098f>:0 at RimWorld.Psycast.AbilityTick () [0x00000] in <c36f9493c9844ddaa7fb5c788416098f>:0 at RimWorld.Pawn_AbilityTracker.AbilitiesTick () [0x00010] in <c36f9493c9844ddaa7fb5c788416098f>:0 at (wrapper dynamic-method) Verse.Pawn.Verse.Pawn.Tick_Patch2(Verse.Pawn) at Verse.TickList.Tick () [0x0015c] in <c36f9493c9844ddaa7fb5c788416098f>:0 Verse.Log:Error(String, Boolean) Verse.Log:ErrorOnce(String, Int32, Boolean) Verse.TickList:Tick() Verse.TickManager:DoSingleTick() Verse.<>c:<LoadGame>b__59_1() Verse.LongEventHandler:ExecuteToExecuteWhenFinished() Verse.LongEventHandler:UpdateCurrentAsynchronousEvent() Verse.LongEventHandler:LongEventsUpdate(Boolean&) Verse.Root:Verse.Root.Update_Patch1(Root) Verse.Root_Play:Verse.Root_Play.Update_Patch1(Root_Play)

Thanks for working on this mod!
Hydrotoast 12. maj 2021 kl. 11:48 
I was able to stop the persistent cast (and the constant casting sound) for my local game by editing the save file.

Before, the save file shows that the ability is in a 'Bursting' state. Since applying the psycast fails with an error and a stack trace as shown above, I believe the game engine is constantly retrying the cast, which results in more failures and an annoying infinite sound cast loop.

<li Class="Verb_CastPsycast"> <loadID>Ability_fertility skipKurin_Race708_0</loadID> <state>Bursting</state> <currentTarget>(111, 0, 49)</currentTarget> <burstShotsLeft>1</burstShotsLeft> <ticksToNextBurstShot>-228411</ticksToNextBurstShot> <ability>Kurin_Race708_Ability_MorePsycasts_FertilitySkip</ability> </li>

After, I removed the data related to the 'Bursting' state and reset the 'currentTaget'.

<li Class="Verb_CastPsycast"> <loadID>Ability_fertility skipKurin_Race708_0</loadID> <currentTarget>(0, 0, 0)</currentTarget> <ability>Kurin_Race708_Ability_MorePsycasts_FertilitySkip</ability> </li>

Note that this is a temporary fix and you should avoid casting Fertility Skip until the exception is fixed!
Noodles  [udvikler] 12. maj 2021 kl. 12:26 
Hmm, I am wondering where that xml is coming from. That does not appear to be anything written by me. What is the Kurin_Race708??? Did someone do some kind of incorporation with my mod?
Hydrotoast 12. maj 2021 kl. 13:39 
I believe it's a standard rename patch for all abilities attached to a pawn in Humanoid Alien Races (HAR), which should not affect any logic.

For the stack trace, I took a peek at the source code provided, and it seems that the offending lines are as shown below.

IOrderedEnumerable<TerrainDef> sorted = terrains.FindAll(e => e.fertility > terrain.fertility && e.fertility <= 1).OrderBy(e => e.fertility); TerrainDef newTerrain = sorted.First();

Observe that 'sorted' may be empty if the terrain already has 'fertility >= 1', i.e. fertility skip was applied to 'Soil' or 'Rich Soil'. Perhaps the ability should do nothing on these cases?
Sidst redigeret af Hydrotoast; 12. maj 2021 kl. 13:39
borde 7. juli 2021 kl. 3:29 
Cant use Reviving Touch, crashes my game.
Diakon 12. juli 2021 kl. 5:16 
Healing touch doesn't actually boost immunit gain speed. Bot with and without it, my colonist developed immunity at the same rate. Did some digging, and... "ImmunityGainSpeedFactor" is a quality of buildings... not a colonist stat, so it doesn't get applied to them... Maybe a flat +1 to "ImmunityGainSpeed" would work as a fix?
Noodles  [udvikler] 12. juli 2021 kl. 6:00 
@Diakon I can neither confirm nor deny your claim. But the immunity gain speed is randomized each time they get a disease and depends on a lot of factors, like age, blood filtration, and probably more. So two colonists gaining at the same speed even though one of them is sped up doesnt necessarily reflect wether healing touch is working or not. If you could provide me with proof that ImmunityGainSpeedFactor does not apply to immunity gain speed that would help.
Noodles  [udvikler] 12. juli 2021 kl. 7:14 
Ok, I also did some digging and you are basically right. Interestingly one can use ImmunityGainSpeed as a Factor though, which just makes this whole thing complicated.
Kaedys 12. juli 2021 kl. 9:59 
The settings are a bit aggressive about simplifying numbers while they are being typed. For example, if I'm trying to type in "0.05" for the psyfocus cost, when I type "0.0" the mod replaces that with "0". In order to type it in, I have to type "0.5" and then insert the additional 0 after the decimal. Could probably be fixed by delaying the "simplification" logic to only occur once the user de-focuses that typing field, instead of after every character entry.


Oprindeligt skrevet af Noodles:
Ok, I also did some digging and you are basically right. Interestingly one can use ImmunityGainSpeed as a Factor though, which just makes this whole thing complicated.

Checked some of the hediffs used by another of the mods I use that affects immunity gain, and the ImmunityGainSpeed stat, at least for hediffs, is simply an additive stat that then generates a multiplier to the actual speed the pawn gains immunity. The sum of this stat can even be viewed on the pawn's stats page in-game. For example, one of the hediffs uses:

<stages> <li> <minSeverity>0.01</minSeverity> <statOffsets> <ImmunityGainSpeed>0.25</ImmunityGainSpeed> </statOffsets> </li> </stages>

This adds a 25% bonus to the immunity gain speed, which in-game just translates to a 1.25x multiplier to the rate at which they gain immunity. All sources of this, like most statOffsets, appear to be additive with each other before being used as a multiplier to the immunity rate. If this mod also applies the immunity bonus as a hediff, you can just use a statOffset for it similar to the above.

Edit: for example, this is a pawn with the above hediff applied, along with the Super Immune trait, for a net +55% to immunity gain speed.

https://i.imgur.com/YV4LMvd.png
Sidst redigeret af Kaedys; 12. juli 2021 kl. 10:34
NGin 12. juli 2021 kl. 10:07 
Based on the answer to Krazyfan1's question about reviving and heads and your mention of custom races, I think this qualifies: https://youtu.be/vdTxYCASQyo?t=600 long deceased custom race colonist that was missing a head did not revive, twice. I'm guessing that was the basis of Krazyfan1's question anyway.

The race I believe is "Forsaken" going from https://youtu.be/vdTxYCASQyo , which would make it part of https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1728999127 . Hope it helps!
Zahnloli 12. juli 2021 kl. 12:52 
Regarding custom races and failed revives, I've had it happen in this situation:
Caster was a thrumbogirl from "Monstergirl races", corpses were fresh in all cases.
Event happened on a Skaven, an Anty, a Ratkin (respective mods are those names) and a vanilla human. Injuries ranged but I remember the human not having any lethal wounds, it was a raider who fell to the knockdown death chance.
Result was always extreme damage to the revived pawn resulting in instant death (the "dead since" reset), blowing off arms, legs, the head and the internal organs. With the Anty, who have indestructible exoskeletons, those took around 80 damage.
I did not test with a human caster.
Zahnloli 12. juli 2021 kl. 13:29 
No, I tried human casters too. Same result.
Noodles  [udvikler] 13. juli 2021 kl. 12:19 
I have trouble reproducing this issue. As such I believe this is some other mod changing base code in some way that breaks the vanilla check for wether the pawn will die if the damage is dealt.

In every one of my trials I successfully revived the pawn. I specifically increased the damage I deal by 1000, which should kill any pawn if my checks fail. I tried it on mutliple normal human pawns (fresh and rotting) and tried it on a forsaken. In each case I almost killed them, but did not fully. Only in rare cases was a body part destroyed, because typically the lethal damage treshold cannot be overstepped without killing the pawn, which happens without any body parts being destroyed necessarily.

As of now I have no idea how to resolve this.
Zahnloli 13. juli 2021 kl. 13:13 
BINGO. It's not a race mod at all, it's "Pawns Just Don't Die"
Tested with an almost empty modlist. Here's the red line from the log:

The pawn has died while being resurrected.
Verse.Log:Error(String, Boolean)
MorePsycasts.CompAbilityEffect_MorePsycasts_RevivingTouch:Apply(LocalTargetInfo, LocalTargetInfo)
RimWorld.Psycast:ApplyEffects(IEnumerable`1, LocalTargetInfo, LocalTargetInfo)
RimWorld.Ability:ApplyEffects(IEnumerable`1, IEnumerable`1, LocalTargetInfo)
RimWorld.Ability:Activate(LocalTargetInfo, LocalTargetInfo)
RimWorld.Psycast:Activate(LocalTargetInfo, LocalTargetInfo)
RimWorld.Verb_CastAbility:TryCastShot()
Verse.Verb:TryCastNextBurstShot()
Verse.Verb:WarmupComplete()
Verse.Stance_Warmup:Expire()
Verse.Stance_Busy:StanceTick()
Verse.Stance_Warmup:StanceTick()
Verse.Pawn_StanceTracker:StanceTrackerTick()
Verse.Pawn:Tick()
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()
Zahnloli 13. juli 2021 kl. 13:15 
Come think of it, this fits "some other mod changing base code in some way that breaks the vanilla check for wether the pawn will die if the damage is dealt" quite perfectly.
< >
Viser 1-15 af 31 kommentarer
Per side: 1530 50