RimWorld

RimWorld

Math! [Old]
CrunchyDuck  [developer] 22 Oct, 2022 @ 4:09pm
Bug reports
Think you found an issue? Lemme know here. To maximize helpfulness, the following would be most useful if you can give it:

1. Description of the issue
2. Steps to repeat if possible
3. What do you think should have happened?
4. Are you on 1.4 or 1.3?
5. Mod list
6. Error log, if applicable.

Known bugs:
If statements don't check if both branches of code are valid, only the currently active one. If you make a typo or something in the inactive branch, it will not show till it activates. This behaviour is built into ncalc.
Some recipes will break temporarily, especially after an update. Remaking the recipe fixes this.
Workbenches from past updates sometimes don't have all their functionality. Not sure why, but for example + and - buttons on tables from before I supported them, don't work. Rebuilding the workbench will fix this.
Last edited by CrunchyDuck; 10 Nov, 2022 @ 1:04am
< >
Showing 1-15 of 86 comments
After my first baby was born, the rendering of the bill menu was completely broken. I can't see anything except the -10/-1/+1/+10 buttons.

When checking the debug log, I found this (repeated a lot)
Exception filling window for RimWorld.Dialog_BillConfig: System.NullReferenceException: Object reference not set to an instance of an object at Verse.RaceProperties.NutritionEatenPerDay (Verse.Pawn p) [0x00000] in <2ac9ff1464ea49a284d37555c9c1f6ec>:0 at CrunchyDuck.Math.CachedMapData.CountIntake (System.Collections.Generic.List`1[T] pawns) [0x0001b] in <5f7461cc62d7470f8475040c9778f322>:0 at CrunchyDuck.Math.CachedMapData..ctor (Verse.Map map) [0x00217] in <5f7461cc62d7470f8475040c9778f322>:0 at CrunchyDuck.Math.Math.AddParameters (NCalc.Expression e, CrunchyDuck.Math.BillComponent bc, System.Collections.Generic.List`1[T] parameter_list) [0x00020] in <5f7461cc62d7470f8475040c9778f322>:0 at CrunchyDuck.Math.Math.DoMath (System.String str, System.Int32& val, CrunchyDuck.Math.BillComponent bc) [0x00086] in <5f7461cc62d7470f8475040c9778f322>:0 at CrunchyDuck.Math.PatchTextFieldNumeric.PrefixExtended (UnityEngine.Rect rect, System.Int32& val, System.String& buffer, CrunchyDuck.Math.BillComponent bc, System.String& field, System.Boolean is_unpause) [0x00056] in <5f7461cc62d7470f8475040c9778f322>:0 at CrunchyDuck.Math.PatchTextFieldNumeric.Prefix (UnityEngine.Rect rect, System.Int32& val, System.String& buffer, System.Single min, System.Single max) [0x00099] in <5f7461cc62d7470f8475040c9778f322>:0 at (wrapper dynamic-method) Verse.Widgets.Verse.Widgets.TextFieldNumeric_Patch2(UnityEngine.Rect,int&,string&,single,single) at Verse.Widgets.IntEntry (UnityEngine.Rect rect, System.Int32& value, System.String& editBuffer, System.Int32 multiplier) [0x001c1] in <2ac9ff1464ea49a284d37555c9c1f6ec>:0 at Verse.Listing_Standard.IntEntry (System.Int32& val, System.String& editBuffer, System.Int32 multiplier) [0x00038] in <2ac9ff1464ea49a284d37555c9c1f6ec>:0 at (wrapper dynamic-method) RimWorld.Dialog_BillConfig.RimWorld.Dialog_BillConfig.DoWindowContents_Patch3(RimWorld.Dialog_BillConfig,UnityEngine.Rect) at Verse.Window.InnerWindowOnGUI (System.Int32 x) [0x001d3] in <2ac9ff1464ea49a284d37555c9c1f6ec>:0 UnityEngine.StackTraceUtility:ExtractStackTrace () Verse.Log:Error (string) Verse.Window:InnerWindowOnGUI (int) UnityEngine.GUI:CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,int,UnityEngine.GUISkin,int,single,single,UnityEngine.GUIStyle)

My mod list:
[Mod list length: 75]
  1. Harmony
  2. Core
  3. Royalty
  4. Ideology
  5. Biotech
  6. Achtung!
  7. Animals Logic
  8. RPG Style Inventory Revamped
  9. Awesome Inventory Forked
  10. Vanilla Expanded Framework
  11. Barely Better Spots
  12. Better Vanilla Masking
  13. Geological Landforms
  14. Biome Transitions
  15. Blueprints
  16. Build From Inventory
  17. CM Color Coded Mood Bar [1.1+]
  18. Camera+
  19. Clean Pathfinding
  20. Clean Textures
  21. Command Palette
  22. Common Sense
  23. Compact Hediffs
  24. Desire Paths
  25. DontBlockDoor
  26. Erin's Body Retexture
  27. Fixable Mood Debuffs Alert
  28. Follow Me
  29. Interaction Bubbles
  30. Just Put It Over There
  31. Map Preview
  32. Meals On Wheels
  33. Medical Tab
  34. Mining Priority
  35. Mod Manager
  36. Moonlight
  37. Permeable Terrain
  38. Perspective: Doors
  39. Perspective: Trees
  40. Pick Up And Haul
  41. Planning Extended
  42. RIMMSqol
  43. Relations Tab
  44. Research Reinvented
  45. Replace Stuff
  46. Research Reinvented: Stepping Stones
  47. ResearchPowl
  48. RimHUD
  49. Room Food
  50. Simple FX: Smoke
  51. Scattered Flames
  52. Scattered Stones
  53. Share The Load
  54. Simple Utilities: Wall
  55. Smart Farming
  56. Smart Medicine
  57. Smart Speed
  58. Snap Out!
  59. TD Enhancement Pack
  60. Toggleable Overlays
  61. Toggleable Readouts
  62. Underground Power Conduits
  63. Use Bedrolls
  64. Vanilla Hair Expanded
  65. Bradson's Main Button Icons for Vanilla Textures Expanded
  66. Vanilla Textures Expanded
  67. [NL] Facial Animation - WIP
  68. Vanilla Textures Expanded - [NL] Facial Animation
  69. Vanilla Traits Expanded
  70. What Is My Purpose
  71. Where is my weapon?
  72. Windows
  73. Yayo's Animation (Continued)
  74. [XND] Visible Pants
  75. Math!
Last edited by ich bin kein berliner; 23 Oct, 2022 @ 1:51am
very_average_guy 23 Oct, 2022 @ 1:54am 
Definitive bug causing malformed bills containing no content. Evidence points to Math being the issue. I'm on v1.4
Log: https://justpaste.it/1x89c
Last edited by very_average_guy; 23 Oct, 2022 @ 1:55am
CrunchyDuck  [developer] 23 Oct, 2022 @ 3:12am 
Originally posted by Check this out:
After my first baby was born, the rendering of the bill menu was completely broken. I can't see anything except the -10/-1/+1/+10 buttons.

When checking the debug log, I found this (repeated a lot)
(...)
I wasn't able to replicate this bug on my end, but I put some code in place so that it handles the error elegantly. Thanks for the report.
CrunchyDuck  [developer] 23 Oct, 2022 @ 3:13am 
Originally posted by kent_lang:
Definitive bug causing malformed bills containing no content. Evidence points to Math being the issue. I'm on v1.4
Log: https://justpaste.it/1x89c
Looks like this error was linked to the one above. Should be no problem now.
Golden Bones 23 Oct, 2022 @ 4:46am 
in terms of the resetting bill, ive found it resets if you set the until X amount in the default workbench window, but keeps the number if you set it in the details window

I assume this is caused by the mod treating the number in the details menu as a math command and resetting the altered number to what it thinks it should be
DeadLeaves 24 Oct, 2022 @ 8:44am 
I've done a little more testing. But ill probably give up for now. I know there are alternatives, but this is like one of the coolest mods for rimworld I've seen in a long time. Does that make me a nerd that I find a mod called "math!" cool? probably.

Anyway.
I downloaded the github version, and that unfortunately didn't help. (verified that I used a local mod)
I tried disabling all the DLCs, but that didn't help either.
I tried a bunch of different formulas at the same time and tracked when they broke.
"pwn * 100" worked throughout the whole test. Even killing one pawn.
"steel * 2" worked for a long time, even as steel supplies changed. But eventually broke when I used steel. Seemed to last forever as long as no steel was used.
"steel * 2 - steel" broke almost immediately when steel supplies changed.

In general the more I used a resource that was in a formula the more likely it was to break. If I didn't use any resources in a formula they lasted forever

I hope I can enjoy this mod in the future some day. I hope you have great fun with the new DLC.
CrunchyDuck  [developer] 24 Oct, 2022 @ 8:55am 
Oh my goodness I might have just figured out what the issue is.
No promises, but I'll update more when I'm done/in a couple hours.
CrunchyDuck  [developer] 24 Oct, 2022 @ 9:15am 
Originally posted by DeadLeaves:
I've done a little more testing. But ill probably give up for now. I know there are alternatives, but this is like one of the coolest mods for rimworld I've seen in a long time. Does that make me a nerd that I find a mod called "math!" cool? probably.

Anyway.
I downloaded the github version, and that unfortunately didn't help. (verified that I used a local mod)
I tried disabling all the DLCs, but that didn't help either.
I tried a bunch of different formulas at the same time and tracked when they broke.
"pwn * 100" worked throughout the whole test. Even killing one pawn.
"steel * 2" worked for a long time, even as steel supplies changed. But eventually broke when I used steel. Seemed to last forever as long as no steel was used.
"steel * 2 - steel" broke almost immediately when steel supplies changed.

In general the more I used a resource that was in a formula the more likely it was to break. If I didn't use any resources in a formula they lasted forever

I hope I can enjoy this mod in the future some day. I hope you have great fun with the new DLC.

Good news! I fixed it (I hope this time!)
Bad news: I had to break the code that supports the +- 1/10 on bills.
A worthy trade for now I think. I know how I can get them working again with some transpiler magic, but it will take a bit longer.
I hope you can enjoy the mod now without my bad code biting you :)
Rhekis 25 Oct, 2022 @ 11:34am 
Originally posted by Sir Rai:
in terms of the resetting bill, ive found it resets if you set the until X amount in the default workbench window, but keeps the number if you set it in the details window

I assume this is caused by the mod treating the number in the details menu as a math command and resetting the altered number to what it thinks it should be

I've seen this issue too, where the big + - buttons either produce negative counts, or get reset after 5-10 seconds back to 10, unless you make the change from the details menu.

I see this from a game that was started with a bunch of mods but only Math! is running now with core and bio and hugslib and harmony.
InertFurry 25 Oct, 2022 @ 1:13pm 
Getting nullrefs when I start up my game referring to math.
System.NullReferenceException: Object reference not set to an instance of an object at RimWorld.Bill.get_Map () [0x00000] in <a7463a06f2454dfcb1840bc06cbe4fd3>:0 at CrunchyDuck.Math.BillComponent.get_Cache () [0x00001] in <d38e5d9e25264cfaab3561b35d5f70d9>:0 at CrunchyDuck.Math.Math.AddParameters (NCalc.Expression e, CrunchyDuck.Math.BillComponent bc, System.Collections.Generic.List`1[T] parameter_list) [0x00001] in <d38e5d9e25264cfaab3561b35d5f70d9>:0 at CrunchyDuck.Math.Math.DoMath (System.String str, System.Int32& val, CrunchyDuck.Math.BillComponent bc) [0x00086] in <d38e5d9e25264cfaab3561b35d5f70d9>:0 at CrunchyDuck.Math.BillManager.GameComponentTick () [0x00041] in <d38e5d9e25264cfaab3561b35d5f70d9>:0 at Verse.GameComponentUtility.GameComponentTick () [0x00017] in <a7463a06f2454dfcb1840bc06cbe4fd3>:0 UnityEngine.StackTraceUtility:ExtractStackTrace () Verse.Log:Error (string) Verse.GameComponentUtility:GameComponentTick () (wrapper dynamic-method) Verse.TickManager:Verse.TickManager.DoSingleTick_Patch2 (Verse.TickManager) Verse.TickManager:TickManagerUpdate () Verse.Game:UpdatePlay () Verse.Root_Play:Update ()

Actually it's periodic. None of the machines that have bills on them that use this mod keep their designations; just blank fields where the if statements used to be.
CrunchyDuck  [developer] 25 Oct, 2022 @ 1:22pm 
I think i have a good idea on what's causing that, i'll try to get it fixed soon
InertFurry 25 Oct, 2022 @ 2:50pm 
Woohoo! I love this mod; lets me offload most of my decision making to a formula XD
CrunchyDuck  [developer] 25 Oct, 2022 @ 2:56pm 
I've spent a good hour trying to track down the problem you mentioned, but I can't seem to replicate it.
The error is basically saying that when the bill tries to get the map that it's on, an error happens. The error would happen whether it were my mod trying to get the map, or the base game trying to get the map.
I don't quite know what situation has happened where calling Bill_Production.Map causes an error. At no point does my mod modify anything related to a bill's map data.
I did fix what I believe to be an unrelated null map issue, but I don't think that will help here.

If you can find a way to replicate this reliably, and can give me instructions on how to do so, I could fix it. But without being able to trigger the error myself, I don't have many options.
InertFurry 25 Oct, 2022 @ 7:26pm 
https://gist.github.com/70bc5af09f8e3bc2fcda122622bf74d8
Here's my full log, maybe that can clear it up. Otherwise I'll start disabling mods to see when the issue arises. I'm looking leerily at Set Up Camp.
Draco18s 25 Oct, 2022 @ 7:26pm 
Running into an issue where (for butchering) the "task do X times" with a value of "c_animal_corpses" (so, you know, "butcher all the corpses I have") looking in a radius of ... about 20 (it covers the animal corpse stockpile I use as the input pile) just...sorta...never updates correctly.

I have to go in and fiddle with it after I do some hunting (or it stays stuck at x0 to do) and when I do it'll pop up to approximately {#of corpses I actually have} * 2. As I have no corpses at the moment, the task reads as 2 still to do. It might be querying animals that died naturally (and thus forbidden and also out of range) so I'm not sure what's up.

(Edit: found the 2 extra corpses. A cougar and a goose got into a fight and killed each other just outside my home area)
https://cdn.discordapp.com/attachments/870341956734169158/1034655108866256896/Screenshot_from_2022-10-25_21-29-07.png
(Goose and cougar just above the "build copy" button)

It's very weird.

Can't think of what mods I have installed that would conflict (I've got about 50, mostly QOL), but I also haven't taken a moment to try mod-less.
Last edited by Draco18s; 25 Oct, 2022 @ 7:30pm
< >
Showing 1-15 of 86 comments
Per page: 1530 50