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 - Prince Kasta

#1
Help / Error when loading a saved dictionary
August 08, 2019, 02:01:30 PM
Keys count does not match the values count while loading a dictionary (maybe keys and values were resolved during different passes?). Some elements will be skipped. keys=5, values=0, label=resourcePool

That is how it is in the save file

                                                <keys>
<li>Faction_4</li>
<li>Faction_5</li>
<li>Faction_6</li>
<li>Faction_7</li>
<li>Faction_8</li>
</keys>
<values>
<li>5800</li>
<li>6300</li>
<li>4100</li>
<li>4000</li>
<li>6900</li>
</values>


The code in the World Comp's exposedata:

            List<Faction> factions= new List<Faction>();
            List<int> ints = new List<int>();
           
            Scribe_Collections.Look(ref resourcePool, "resourcePool", LookMode.Reference, LookMode.Value, ref factions, ref ints);


The problem is in the LoadSaveMode.ResolvingCrossRefs pass, the Key list's count isn't the same as the values's list.
#2
I'm using FindPath to find a path between two world objects, the error appears the third time the method is run and won't repeat again until a full restart of the game.




How to fix this/Is there a better way to find a path?




WorldPathPool leak: more paths than caravans. Force-recovering.
Verse.Log:Error(String, Boolean)
Verse.Log:ErrorOnce(String, Int32, Boolean)
RimWorld.Planet.WorldPathPool:GetEmptyWorldPath()
RimWorld.Planet.WorldPathFinder:FinalizedPath(Int32)
RimWorld.Planet.WorldPathFinder:FindPath(Int32, Int32, Caravan, Func`2)


I'm dumb, an earlier use of a WorldPath object was the culprit as I didn't dispose of it properly.

#3

Exception ticking Klein (at (85, 0, 115)): System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[RimWorld.Faction,Verse.PawnDestinationReservationManager+PawnDestinationSet].get_Item (RimWorld.Faction key) [0x00000] in <filename unknown>:0
  at Verse.PawnDestinationReservationManager.ReleaseClaimedBy (Verse.Pawn p, Verse.AI.Job job) [0x00000] in <filename unknown>:0
  at Verse.Pawn.ClearReservationsForJob (Verse.AI.Job job) [0x00000] in <filename unknown>:0
  at Verse.AI.Pawn_JobTracker.CleanupCurrentJob (JobCondition condition, Boolean releaseReservations, Boolean cancelBusyStancesSoft) [0x00000] in <filename unknown>:0
  at Verse.AI.Pawn_JobTracker.EndCurrentJob (JobCondition condition, Boolean startNewJob) [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.EndJobWith (JobCondition condition) [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.ReadyForNextToil () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.ReadyForNextToil () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.Notify_PatherArrived () [0x00000] in <filename unknown>:0
  at Verse.AI.Pawn_PathFollower.PatherArrived () [0x00000] in <filename unknown>:0
  at Verse.AI.Pawn_PathFollower.TryEnterNextPathCell () [0x00000] in <filename unknown>:0
  at Verse.AI.Pawn_PathFollower.PatherTick () [0x00000] in <filename unknown>:0
  at Verse.Pawn.Tick () [0x00000] in <filename unknown>:0
  at Verse.TickList.Tick () [0x00000] in <filename unknown>:0
Verse.Log:Error(String, Boolean)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

This I think leads to the next error of

Klein with job GotoWander (Job_465) A=(85, 0, 115) tried to get CurToil with curToilIndex=2 but only has 2 toils.
Verse.Log:Error(String, Boolean)
Verse.AI.JobDriver:get_CurToil()
Verse.AI.JobDriver:DriverTick()
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick()
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()


I'm trying to spawn the pawns as defenders in an outpost.

It looks like the pawns aren't added to some dictionary but I can't figure out how to fix it, I tried map.pawnDestinationReservationManager.RegisterFaction() on the sites' map but then it says it's already registered.

Edit: doing map.mapPawns.UpdateRegistryForPawn(p) for each pawn appeared to have solved the issue
#4
Help / Re: Modifying Trade Price dynamically
June 26, 2019, 06:17:15 PM
That is what I get for not copy-pasting the correctly written method and doing in from memory for no reason, so much time waste on a uppercase/lowercase typo.

I know about InitPriceDataIfNeeded  That how I got to these methods.

Thank you so much for the help, I was about to give up on this part and it would seriously mess up what I wanted from my mod and just because a typo.
.
#5
First time trying to mod, I want to modify prices when dealing with specific conditions but I can't find a way to change anything including where I think the price calculation is done (TradeUtility.GetPricePlayerBuy/Sell, right?)
I tried to create a Harmony pre/post fix for those methods but it doesn't seem to trigger when I test trades
with this code.


       [HarmonyPatch(typeof(TradeUtility), "GetPricePlayerSell", null)]
        public static class TradeUtility_GetPricePlayerSell_PrePostfix_Patch
        {
            public static void PreFix(float __result)
            {
                Log.Warning("PreFix");
            }
            public static void PostFix(float __result)
            {
                Log.Warning("PostFix");
            }
        }
        [HarmonyPatch(typeof(TradeUtility), "GetPricePlayerBuy", null)]
        public static class TradeUtility_GetPricePlayerBuy_PrePostfix_Patch
        {
            public static void PreFix(float __result)
            {
                Log.Warning("PreFix2");
            }
            public static void PostFix(float __result)
            {
                Log.Warning("PostFix2");
            }
        }

My other harmony patch for something else works correctly and these patches show up when I log all harmony patches in the debug console. Are they not the correct methods to do this?
Related things that I could find seem to be readonly.
Is what I'm trying to do possible, if so how?
#6
Help / Help making a new Gizmo/Button
October 20, 2018, 07:27:10 AM
I want to add a button to the caravan world map that will create an event.
I tried going through Allow Tool and Tmagic's source codes but I couldn't figure where they create them.

Is there a good example or a tutorial of creating one?
#7
My caravan was ambushed by one pirate, which was laughable.
I stopped laughing when I realized that my guys spawned on top of an insect hive, this really needs to not happen.
#8
I don't think that is a bug, it is there to prevent you from killing your pawns by forgetting to undraft them.
#9
Releases / Re: [B18] A RimWorld of Magic
April 08, 2018, 12:46:47 PM
Quote from: Torann on April 06, 2018, 09:05:52 PM
Quote from: Prince Kasta on April 06, 2018, 04:49:36 PM
For the backstory you could just make it like:
A creature created from a human body by the practice of the dark arts, whoever the creature was before is no more.

I like it.

I added a prison labor compatibility patch a couple weeks ago, so that is probably what's interfering - what's the impact if you play the game with the error?

I played some and didn't notice anything but I also don't have PrisonLabor, the error could only be a problem if the three mods are active together.
#10
Releases / Re: [B18] A RimWorld of Magic
April 06, 2018, 04:49:36 PM
Quote from: Torann on April 06, 2018, 11:06:20 AM
What happens if you change the order of psychology and tmagic?  Just flip-flop the two.  The two traits have 0 commonality because they should never be given to a random pawn during pawn generation.  I understand why the error would be there, but in this case it's completely intentional and won't cause any problems.

As for the backstory, anybody have an idea what the backstory for an undead would say?

The order doesn't change anything.

For the backstory you could just make it like:
A creature created from a human body by the practice of the dark arts, whoever the creature was before is no more.
#11
Quote from: Lanilor on March 21, 2018, 07:27:06 PM
That's a translation error. I got these errors/warnings too, when I was looking for another bug. I think they are normally ignored and only get displayed when other errors are thrown. Do you get other errors too? Maybe a conflict with another mod? If so, you can try to find out which mods are causing the conflict by only activation a few of them and then adding more until you get the errors again.

Those warnings pop up for me even if Rimsenal and the security pack are the only active mods.

It's the Security Pack itself that does that.
#12
Releases / Re: [B18] A RimWorld of Magic
April 06, 2018, 09:30:05 AM
There is an error appearing when launching the game with psychology and Tmagic, the error seems to refer to PrisonLabor even though I never installed it, I guess the mod's Harmony patches for that mod conflict.

The error doesn't occur with A Rimworld of Magic 1.9.6.8.

[tt][HugsLib][ERR] Failed to apply Harmony patches for HugsLib.Psychology. Exception was: System.TypeLoadException: Could not load type 'PrisonLabor.JobDriver_Mine_Tweak' from assembly 'PrisonLabor, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null'.
  at (wrapper managed-to-native) System.Reflection.MonoMethodInfo:get_method_info (intptr,System.Reflection.MonoMethodInfo&)
  at System.Reflection.MonoMethodInfo.GetMethodInfo (IntPtr handle) [0x00000] in <filename unknown>:0
  at System.Reflection.MonoMethodInfo.GetReturnType (IntPtr handle) [0x00000] in <filename unknown>:0
  at System.Reflection.MonoMethod.get_ReturnType () [0x00000] in <filename unknown>:0
  at System.Reflection.MonoMethod.ToString () [0x00000] in <filename unknown>:0
  at System.Reflection.MemberInfoSerializationHolder.GetRealObject (StreamingContext context) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.ObjectRecord.LoadData (System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector selector, StreamingContext context) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject (System.IO.BinaryReader reader) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (BinaryElement elem, System.IO.BinaryReader reader, Boolean readHeaders, System.Object& result, System.Runtime.Remoting.Messaging.Header[]& headers) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream) [0x00000] in <filename unknown>:0
  at Harmony.PatchInfoSerialization.Deserialize (System.Byte[] bytes) [0x00000] in <filename unknown>:0
  at Harmony.HarmonySharedState.GetPatchInfo (System.Reflection.MethodBase method) [0x00000] in <filename unknown>:0
  at Harmony.PatchProcessor.Patch () [0x00000] in <filename unknown>:0
  at Harmony.HarmonyInstance.<PatchAll>b__6_0 (System.Type type) [0x00000] in <filename unknown>:0
  at Harmony.CollectionExtensions.Do[Type] (IEnumerable`1 sequence, System.Action`1 action) [0x00000] in <filename unknown>:0
  at Harmony.HarmonyInstance.PatchAll (System.Reflection.Assembly assembly) [0x00000] in <filename unknown>:0
  at HugsLib.ModBase.ApplyHarmonyPatches () [0x00000] in <filename unknown>:0
Verse.Log:Error(String)
HugsLib.Utils.ModLogger:Error(String, Object[])
HugsLib.ModBase:ApplyHarmonyPatches()
HugsLib.HugsLibController:EnumerateChildMods()
HugsLib.HugsLibController:LoadReloadInitialize()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.LongEventHandler:<UpdateCurrentAsynchronousEvent>m__1()[/tt]


Also, if I'm already talking about psychology compatibility, three warnings appear:
Config error in Lich: TraitDef Lich has 0 commonality.
Config error in Undead: TraitDef Undead has 0 commonality.
Config error in TM_Undead: Humanlike needs backstoryCategory. - Can you give an undead, "undead" backstory?

All those warnings and error appear even if only hugslib, jectools and the two mods are active.
#13
Releases / Re: [B18] A RimWorld of Magic
April 01, 2018, 03:05:40 PM
Quote from: Torann on April 01, 2018, 12:05:50 PM
I've updated the mod to v1.9.7:


  • New Class: Bard (magic) - the bard utilizes a variety of social interaction and abilities to improve the morale and efficiency of other colonists. The bard is naturally skilled at social activities to include diplomacy, trade, and negotiations.
    Abilities:
    *Entertain - uses charm, wit, and humor to improve the mood of other colonists. This is a new social interaction (like chit chat or deep talk) that is always active (once learned) and is unique to the bard class. In addition, the bard may activate the 'entertain' ability to identify other colonists that are reaching their breaking points and attempt to improve their mood.
    *Inspire - another ability of the bard that works in the background (once learned) and will attempt to inspire nearby colonists.
    *Lullaby - the bard plays an enchanting lullaby that washes away consciousness of any pawns in the affected area.
    *Battle Hymn (master) - plays an exhilarating battle song that increases the fighting spirit of any nearby pawns. The effects of Battle Hymn build over time.

  • Three new stand-alone spells:
    *Cauterize Wounds (fire mage) - instantly cleans and tends any wounds on the target, but has a chance to cause burn scars.
    *Spell Mending (any mage) - Combines arcane power of the mage and physical energy of the target to repair the equipment worn by the target.
    *Fertile Lands (druid) - blesses a large area of land with the power of the druids that increases the growth rate of any plants within the area by 200%. This spell is maintained by the druid, and reduces mana regeneration by 40%.

  • As part of the Bard update, 6 new inspirations have been added: Learning (introspection), Social (outgoing), Farming, Mining, and two special inspirations unique to mage and fighter classes.

  • Mages that share a positive social standing can now exchange arcane knowledge as part of a Mentor/Student interaction. This allows less experienced mages to learn from those more experienced in the magical arts.
*Inspire - another ability of the bard that works in the background (once learned) and will attempt to inspire nearby colonists.

Is there a way to disable certain Inspire event warnings?
Because I really want to disable those for "go" or "work" inspires who are just passive unlike say the trader one.

*Lullaby - the bard plays an enchanting lullaby that washes away consciousness of any pawns in the affected area.

That sounds interesting, depending on how fast this is you can neutralize pyros or mental break easily.

For Cauterize Wounds, why take that rather than the Heal spell?
Because unless it is way stronger risking another wound seems unnecessary.

Small request/question, can you make Enchantments put a tag on their clothes like deadman's [D]?
It just that I can't figure out a way how to see which clothes are enchanted by looking at the gear tab, you have to strip and look at each piece.
In a 40 pawns colony you forget who wears what fast.
#14
Releases / Re: [B18] A RimWorld of Magic
March 26, 2018, 08:40:15 AM
Quote from: Torann on March 25, 2018, 08:31:12 PM
Quote from: Prince Kasta on March 25, 2018, 05:29:47 PM
Quote from: Torann on March 25, 2018, 04:46:03 PM
Quote from: Prince Kasta on March 25, 2018, 02:49:48 PM
X fully healed
X fully healed
X fully healed

Whenever lighting wound ticks the game wrongly tell you that pawn healed.

Which ability is this?  Heal, Advanced Heal, Inner healing, and Regenerate are the only healing spells.  Do you get a log message or a standard message that's telling you the pawn is healed?

As I said, a lightning wound.
You will probably get it from the lightning storm spell or lightning bolt.
Whenever the wound heal by anything (be it 0.4 hp or 8 hp from a spell) it will say the pawn is fully healed.

I get the standard message but I checked now and I do get a lot of warnings on load.
Config error in TM_LightningCloud: has HediffComp_TendDuration but tendable = false
Config error in TM_Lightning: has HediffComp_TendDuration but tendable = false

It actually does that for a lot of spells, is this something on my end?

Config error in TM_Holy: has HediffComp_TendDuration but tendable = false
Config error in TM_Poison_HD: has HediffComp_TendDuration but tendable = false
Config error in TM_Firebolt: has HediffComp_TendDuration but tendable = false

and more.

Yes, you have another mod conflicting the behavior of this mod by changing the default "InjuryBase" hediff, which is tendable.  This is a setting defined in vanilla rimworld, so it will affect any and all behavior from any mod that uses this and is not otherwise specifying their hediff to be tendable.
Thanks, putting Tmagic higher in the load order helped.
#15
Releases / Re: [B18] A RimWorld of Magic
March 25, 2018, 05:29:47 PM
Quote from: Torann on March 25, 2018, 04:46:03 PM
Quote from: Prince Kasta on March 25, 2018, 02:49:48 PM
X fully healed
X fully healed
X fully healed

Whenever lighting wound ticks the game wrongly tell you that pawn healed.

Which ability is this?  Heal, Advanced Heal, Inner healing, and Regenerate are the only healing spells.  Do you get a log message or a standard message that's telling you the pawn is healed?

As I said, a lightning wound.
You will probably get it from the lightning storm spell or lightning bolt.
Whenever the wound heal by anything (be it 0.4 hp or 8 hp from a spell) it will say the pawn is fully healed.

I get the standard message but I checked now and I do get a lot of warnings on load.
Config error in TM_LightningCloud: has HediffComp_TendDuration but tendable = false
Config error in TM_Lightning: has HediffComp_TendDuration but tendable = false

It actually does that for a lot of spells, is this something on my end?

Config error in TM_Holy: has HediffComp_TendDuration but tendable = false
Config error in TM_Poison_HD: has HediffComp_TendDuration but tendable = false
Config error in TM_Firebolt: has HediffComp_TendDuration but tendable = false

and more.