[A12d] Wastelander's Minor mods: Mending updated by skyarkhangel

Started by Wastelander, February 25, 2015, 08:58:11 PM

Previous topic - Next topic

Ratys

I've taken a stab at updating it, not much luck. It compiles and loads without def errors now, but there's a weird issue I can't figure out that prevents it from actually working instead of throwing OutOfRange exceptions all over. Somebody more proficient than me with AI coding should take a look at this... Here's what I came up with so far.

[attachment deleted due to age]

Tynan

Ratys, looks like work priorities are being queried with a null work type. That's my guess at least. Is it possible you're feeding in a null work type somewhere?
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Ratys

Quote from: Tynan on June 23, 2015, 03:02:24 AM
Ratys, looks like work priorities are being queried with a null work type. That's my guess at least. Is it possible you're feeding in a null work type somewhere?

I'm not sure where would that happen in mod's code; had Log.Message dump WorkTypes with their WorkGivers, game seems to load them correctly.

Tested with a hastily cobbled together A11 port of an older mod of mine that has a custom WorkType. It worked in A10 without the issue in question, and porting only required to transition to some refactors that happened between versions. Compiles, no def errors on startup, once it loads in a game it starts throwing exact same error that I posted.

Moreover, butchered Mending leaving only a single file, the WorkType def - same thing happens. I can't for the life of me figure why wouldn't it work, it's written exactly like the core WorkTypes, and priority is unique.

<?xml version="1.0" encoding="utf-8" ?>
<WorkTypeDefs>

<WorkTypeDef>
<defName>WorkType_Mending</defName>
<labelShort>Mend</labelShort>
<pawnLabel>Mending</pawnLabel>
<gerundLabel>Mending</gerundLabel>
<description>Menders repair damaged items.</description>
<verb>Mend</verb>
<naturalPriority>405</naturalPriority>
<workTags>
<li>ManualSkilled</li>
</workTags>
</WorkTypeDef>

</WorkTypeDefs>


EDIT:

I guess I should mention what the "thing" is: simply opening overview dialog cases the error in the first pic to happen, second pic is when pawns wake up (they're asleep at the time of the save I'm testing with) and start to seek stuff to do.

nmid

..do they basically get 'stuck' / remain standing while that error keeps popping up in the debug log?

I like how this game can result in quotes that would be quite unnerving when said in public, out of context. StorymasterQ

Ratys

Quote from: nmid on June 23, 2015, 02:16:02 PM
..do they basically get 'stuck' / remain standing while that error keeps popping up in the debug log?

Pretty much.

Match

I also took a stab at updating this, and failed.

Got the XML to work no errors, with out touching the assemblies. I've yet to attempt anything with a dll and felt really lost.

nmid

Not sure if this information will help you... but I had the same problem when I added MD2 Base + MD2 droids into an already running game with a lot of other mods added.
On loading of a save file, the colonists finished their last action and then got stuck.


Prof threw exception while determining job: System.ArgumentOutOfRangeException: Argument is out of range.

Parameter name: index

  at System.Collections.Generic.List`1[System.Int32].get_Item (Int32 index) [0x00000] in <filename unknown>:0

  at Verse.DefMap`2[Verse.WorkTypeDef,System.Int32].get_Item (Verse.WorkTypeDef def) [0x00000] in <filename unknown>:0

  at RimWorld.Pawn_WorkSettings.GetPriority (Verse.WorkTypeDef w) [0x00000] in <filename unknown>:0

  at RimWorld.Pawn_WorkSettings.CacheWorkGiversInOrder () [0x00000] in <filename unknown>:0

  at RimWorld.Pawn_WorkSettings.get_WorkGiversInOrderEmergency () [0x00000] in <filename unknown>:0

  at RimWorld.JobGiver_Work.TryGiveTerminalJob (Verse.Pawn pawn) [0x00000] in <filename unknown>:0

  at Verse.AI.ThinkNode_JobGiver.TryIssueJobPackage (Verse.Pawn pawn) [0x00000] in <filename unknown>:0

  at Verse.AI.ThinkNode_Priority.TryIssueJobPackage (Verse.Pawn pawn) [0x00000] in <filename unknown>:0

  at RimWorld.ThinkNode_Conditional.TryIssueJobPackage (Verse.Pawn pawn) [0x00000] in <filename unknown>:0

  at Verse.AI.ThinkNode_Priority.TryIssueJobPackage (Verse.Pawn pawn) [0x00000] in <filename unknown>:0

  at Verse.AI.Pawn_JobTracker.DetermineNextJob () [0x00000] in <filename unknown>:0  lastJobGiver=RimWorld.JobGiver_Work

I have to check if the game works fine with only the MD2 Base+MD2 droids, but as no one else has commented on the mod thread that it doesn't, I expect it does.


  <activeMods>
    <li>Core</li>
    <li>BackstoriesCore</li>
    <li>EdBPrepareCarefully</li>
    <li>Darkness (SBO)</li>
    <li>SCA11Core</li>
    <li>AutoHuntBeacon</li>
    <li>Apparello</li>
    <li>EdBModOrder</li>
    <li>ED-Core</li>
    <li>Miscellaneous_HiRes</li>
    <li>ExpandedProsthetics&amp;OrganEngineering</li>
    <li>ED-LaserDrill</li>
    <li>ED-ReverseCycleCooler</li>
    <li>ED-Vent</li>
    <li>ED-Shields</li>
    <li>ED-Embrasures</li>
    <li>ED-PersonalNanoShields</li>
    <li>ED-OmniGel</li>
    <li>VeinMiner</li>
    <li>RoofSupport</li>
    <li>OmniStorage</li>
    <li>Canned Food</li>
    <li>Pawn State Icons</li>
    <li>Anti Tank Weapons</li>
    <li>Bulk_Meals</li>
    <li>Celing Lights</li>
    <li>RimHalo</li>
    <li>[A11 Faction] JaffaKree! Reborn</li>
    <li>Stonecutting Tweak</li>
    <li>LogWall-Stuffed</li>
    <li>EdBInterface</li>
    <li>Mad Skills</li>
    <li>T-ConditionRed</li>
    <li>T-CoreCropTweaks</li>
    <li>T-ExpandedCloth</li>
    <li>T-ExpandedCrops</li>
    <li>T-MiscStuff</li>
    <li>T-MoreBedsVanilla</li>
    <li>RT Fusebox</li>
    <li>RT Storage</li>
    <li>T-MoreFloorsFF</li>
    <li>MAI</li>
    <li>RTFTJ</li>
    <li>Industrialisation v0.99</li>
    <li>ED-Plants24H</li>
    <li>Hospitality</li>
    <!--<li>Battle Rattle</li>-->
    <li>LT_RedistHeat</li>
    <li>MD2Base-master</li>
    <li>MD2Droids-12</li>
  </activeMods>
I like how this game can result in quotes that would be quite unnerving when said in public, out of context. StorymasterQ

Ratys

Quote from: nmid on June 24, 2015, 05:14:51 AM
... into an already running game ...

That part made it click: one thing that I haven't tried is starting a NEW colony, rather than loading a save. And what do you know, indeed the issue is gone. So, thank you for mentioning it, it indeed was helpful! Guess that's what I get for making it a point for all my mods to work out of the box in existing games - I tend to forget that sometimes a new game is required; nevermind it working (?) before, for some reason introducing a WorkType into an ongoing game breaks it.

I went ahead and 'fixed' things that cropped up after this was out of the way - I had to throw away the code that explicitly makes colonists automagically haul mended items back to storage, now they'll only do that if they feel like it, leaving it to someone else if they don't.

Bottom line, what I've attached to this post works in Alpha 11, and requires a new colony. Source included.

[attachment deleted due to age]

LanMc

Hi, my name is Lan and I am a Rimworld addict...

nmid

Quote from: Ratys on June 24, 2015, 08:01:41 AM
Quote from: nmid on June 24, 2015, 05:14:51 AM
... into an already running game ...

That part made it click: one thing that I haven't tried is starting a NEW colony, rather than loading a save. And what do you know, indeed the issue is gone. So, thank you for mentioning it, it indeed was helpful!
...
for some reason introducing a WorkType into an ongoing game breaks it.
....
I went ahead and 'fixed' things that cropped up after this was out of the way - I had to throw away the code that explicitly makes colonists automagically haul mended items back to storage, now they'll only do that if they feel like it, leaving it to someone else if they don't.

Glad it helped, Ratys :)
I'll wait to start my new colony to add mending.
I like how this game can result in quotes that would be quite unnerving when said in public, out of context. StorymasterQ

Kaballah

Thanks for updating the mending bench, I always liked this.

Kaballah

Found a bug, if colonist(s) with the mending labor enabled are assigned to a restriction area and the target item to be mended is outside the area, exceptions are generated.  I didn't think to catch a screenshot when this happened but I'm pretty sure it won't be hard to reproduce at all.

omatkoicorko


Shtuka