RimWorld

RimWorld

Math! (Forked)
399 Comments
Joebroni 29 Jul @ 7:43am 
This is on Mlie's list for updating at some point! Possibly my favorite mod ever, so can't wait to have it back!
Nick Molliger 12 Jul @ 2:57am 
There actually is a nice alternative: "Everybody Gets One".
Despite the naming, you can manage the value of items per every search iteration.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1687566130

In my opinion, it has its pros and cons, unlike "Math!". The downside is that "Everybody Gets One" has a different number selection structure. It works as a search engine, for which you can set up filters, it is much simpler than full-fledged formulas that you can build in "Math!", but the upside is that the filters can be anything. You can set up a search by basic parameters like age, gender, faction, type, etc., but in addition to this, you can count pawns that, say, have a missing leg. Or using simple logic and/or select only those pawns that have no leg and at the same time have a prosthesis when you place an order for prostheses. You can even delve into ThingDef and get any number from the game, like we did in the good old ArtMoney in the 2000s, but in a read-only format.
Lunertic 12 Jul @ 1:19am 
Well. Looks like it's finally time for me to get into rimworld modding. I appreciate all the work on the mod to keep it up to date and fixing bugs. Now it's time to see what I can do. In the meantime, take care. o7
BlazingImp77151 10 Jul @ 3:57pm 
if Math! isnt going to be maintained into the future, does anyone know a good alternative? This is a very useful mod, and its going to be very sad not having it around come the update.
Imagine12 24 May @ 8:09am 
For the c.meals bug, I think it's caused by pawns having meals in their inventory at any given time. Some mod (probably Common Sense) is having pawns keep one meal in inventory for easy meals on the go. This breaks math somehow so there's that
Nick Molliger 22 May @ 11:53pm 
F3iT same
F3iT 22 May @ 5:33pm 
Now my bills are disapering and i can't click the "add bill" button anymore....
F3iT 22 May @ 10:36am 
Also i noted that I usualy have some "Stockpiles" and "Groups" sublist in stockpile selection menu, they are not there anymore.
F3iT 22 May @ 10:34am 
Hello. I got a bug similar to 룰루랄라's but only hen i set a fixed target for outputs (ie. a stockpile). Then the UI get all empty and unusable, and I have to delete the bill. Couldn't get the initial error but then it's spamming

Exception filling window for CrunchyDuck.Math.Dialog_MathBillConfig: System.NullReferenceException: Object reference not set to an instance of an object

I know this might be a mod incompatibility but i can't seem to find any mod altering bills ui...
Any ideas ?
晓山alreShan 11 May @ 2:02pm 
@EgotisticalElf
I guess you have Ancient urban ruins or something similar?
EgotisticalElf 11 May @ 12:58pm 
I'm getting an error, but i'm not 100% sure what is going on. The call to InteractionCell ends up causing a search in Walkable for a null map. Does this mean I have an item that exists, but isn't spawned? or is the cache somehow invalid?

Object reference not set to an instance of an object
at Verse.GenGrid.Walkable (Verse.IntVec3 c, Verse.Map map)
at Verse.ThingUtility.InteractionCellWhenAt (Verse.ThingDef def, Verse.IntVec3 center, Verse.Rot4 rot, Verse.Map map)
at Verse.Thing.get_InteractionCell ()
- PREFIX Mlie.MoveInteractionCell: Void MoveInteractionCell.Thing_InteractionCell:Prefix(Thing __instance)
MonoMod.Utils.DynamicMethodDefinition.Glue:AbiFixup<Verse.IntVec3 Verse.Thing:get_InteractionCell(),Verse.IntVec3 Verse.Thing.get_InteractionCell_Patch1(Verse.Thing)>(Verse.Thing,Verse.IntVec3&)
at CrunchyDuck.Math.CachedMapData.GetThings (System.String thing_name, CrunchyDuck.Math.BillComponent bc)
룰루랄라 5 Mar @ 4:14am 
Exception filling window for CrunchyDuck.Math.Dialog_MathBillConfig: System.NullReferenceException: Object reference not set to an instance of an object
[Ref A11A05C3] Duplicate stacktrace, see ref for original
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch5 (string)
Verse.Window:InnerWindowOnGUI (int)
UnityEngine.GUI:CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,int,UnityEngine.GUISkin,int,single,single,UnityEngine.GUIStyle)
룰루랄라 5 Mar @ 4:14am 
The first error is long, so I'll look at the second one first, and if I need it, I'll cut it out
룰루랄라 5 Mar @ 4:12am 
I'm playing well and then suddenly the math settings screen flickers and I get these two errors (it may not be natural to use a translator)
Lunertic 9 Feb @ 3:14am 
Compatibility with Ctrl-F to allow better custom item searches would be great. I'm trying to create a bill to make clothing only for royals but honor and royal titles aren't stat defs so i can't filter by them but Ctrl-F can easily filter for that. If we could just simple specify the name of a Ctrl-F filter for a custom variable it would be lovely <3

Ctrl-F for reference https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2895300634
Malminas 8 Jan @ 11:33am 
@darkmessiah There wont be compatibility for it since the two mods do the same thing. Just type in the bar " "col"+y" " or " "pwn"+y" "
Darkmessiah 3 Jan @ 2:11am 
While it was likely, this seems to sadly be incompatible with *Everybody Gets One* (EGO) which I adore for the simple "Make X per Colonist + Y" feature.

Whenever I select the options from EGO I can't change the value of the bill. When I open the bill in the large window, the window flickers and I again can't select any values.

This isn't to say "oh noes pls fix" as you warn of compatibility issues. Just leaving this here for others and maybe to offer feedback for future features. Anyway, I hope you have a good start to the new year.
YeOl'Choppa 2 Jan @ 5:39pm 
forcing the pawns to drop any held meals makes the errors cease and for the ui to stop flickering. if they pick it back up it starts throwing exceptions again (whenever you leave the details tab open, ofc)
YeOl'Choppa 2 Jan @ 5:37pm 
coming in to report some findings on @Lunertic's ui bug, i seem to be able to reproduce it with meal bills set to produce until x.

i get the same issue with the bill details tab flickering while causing two exceptions every time it flickers. i managed to get consistent errors by:

- going into quick dev test
- building an electric stove
- setting up two bills for simple meals (one is for a single unit, and the other is for bulk production (x4))
- spawning in 5 (or more) simple meals on top of a stockpile zone (or let pawns take them to a shelf)
- check bill details tab --> no errors so far
- wait for one of the pawns to take a meal into their inventory
- check bill details tab --> exceptions thrown
ChroChro 28 Dec, 2024 @ 6:19pm 
looks like im not the only one that's had issues with Math! and meals bills ^^' another VFE tribals player, I can only assume it's a similar issue to the others- I use the stone campfire and I started getting issues (at some point) after my colony used up the corpses for a roast animal bill, could probably have fixed it by de/reconstructing the campfire since the logs mentioned a UI sort of error (the bills all disappeared) but I've just settled on removing the mod for now since it's just simple meals and the like for now, still thank you for keeping up this life saver of a mod!
KRT™Alexander 20 Dec, 2024 @ 3:02pm 
Any chance to get the copy all bills feature? Its quite tedious to copy over every single bill across multiple workstations
Malminas 17 Dec, 2024 @ 12:05am 
@kd8lvt Same for me on the number of mods, however strangely my issue has gone away with the progression of time in my colony. I now have storage structures from adaptive storage holding pretty much all my stuff, the lack of their "visibility" on the map could be allowing whatever detection error was occurring to stop. My best (completely untrained) guess based on when the error was happening was some crossed wires on counting available items or potentially even category organization (which items fit into which categories (since most of my errors were occurring with my custom variables that used "c.XXXX")). Again take most of my guess with a grain of salt as I have maybe 15 minutes of C++ coding under my belt several years ago.
-=GoW=-Dennis 11 Dec, 2024 @ 8:36am 
If it helps any, I play with VFE tribals and always start with their naked start, so I assume at some point through tech progression there is something on the map that causes it? I barely check the meal making after having set up what I need, so I never really get when it started exactly.
-=GoW=-Dennis 11 Dec, 2024 @ 8:34am 
My mod list contains just under 500 mods, though, so there is plenty of potential causes.
-=GoW=-Dennis 11 Dec, 2024 @ 8:34am 
No need to apologize! I unfortunately couldn't figure out the actual cause - I can say that I can "reproduce" getting the issue later in savegames with the same modlist. E.g. it's never there at the start, but pops up at some point when playing the save, despite no changes in mod list. Not sure how that is possible, but that's what it is.

I have for now unfortunately removed maths and went back to Better Workbench Management, given I didn't make a lot of use of maths outside of what is broken.
kd8lvt  [author] 11 Dec, 2024 @ 12:44am 
@-=Gow=-Dennis
Apologies for the extremely late reply, did you ever figure out a root cause for that? (aside from Math being the culprit, that is lol) Knowing where to start looking will give me a heck of a jumpstart on fixing it. I can't reproduce the bug in a lightly modded test environment, so its likely a conflict with a mod I don't test with.

@Bapador
Again, apologies for my tardiness - nope, I'm not the original author, CrunchyDuck is. I don't feel comfortable profiting off someone else's code - not at least until my line count outweighs theirs by a good margin ;P

@CrunchyDuck
Thanks Duck, and no problem :)
No worries about the code, its far better than I'd come up with myself lol
That said, I do need to do some spring cleaning - between me picking up Math and now, I've learned a lot more C# and it's painfully obvious when I look through it ;>.>
CrunchyDuck 11 Dec, 2024 @ 12:23am 
Popping in to say that it's really amazing this mod has maintained such a presence since I dropped support!
It really means a lot to me that kd8lvt spent the time to pick up where I left off.
I'm sorry for the code I left you!
Bapador 29 Nov, 2024 @ 6:50pm 
Any place I can donate some money to the cause?
-=GoW=-Dennis 23 Nov, 2024 @ 12:21am 
I have the same issue with the meals, it appeared just recently in a savegame that when I started didn't have the issue, but I'm not sure what triggers it.
Malminas 2 Nov, 2024 @ 2:22pm 
👀
Malminas 29 Oct, 2024 @ 10:23am 
haha, I appreciate your time, This is by far one of the most important mods in my list.
kd8lvt  [author] 29 Oct, 2024 @ 12:55am 
Annoyingly even to me, no :/
Haven't opened RW since my previous comment, due to my least favorite combination of "other projects being more interesting in the moment" followed by "oh sh- its 4am i need to be awake in 2 hours"
Speaking of, its nearly 4am - at least I dont have to be up in 2 hours today :zote:
I'll dedicate some time tomorrow to Math and see if I can't break something in the process ;P
Malminas 29 Oct, 2024 @ 12:40am 
Hey @kd8lvt, any news about fixing the c.meals issue?
kd8lvt  [author] 6 Oct, 2024 @ 3:28am 
@Bromos
Yep, that appears to be the same issue. I think I know what's causing it, I just haven't had time to look into it and test. Hopefully I'll have time to look at it sometime this week, but my schedule is pretty packed so it may take longer.

Sorry about the issues folks, I've gotten a few similar but very slightly different bug reports as well through other channels, which all seem to stem from the same root cause. Luckily, if I'm right it should be a fairly easy fix, I just have to find time to implement it.
Bromos 5 Oct, 2024 @ 6:53am 
I'm on w11 and i have a similar issue with flickering and disappearing ui. Using recipes with the "custom item count" option and/or variables that refer to a categorie of items (exampe: "v.foodstuff"="c.meals"+"pemmican") seems to be triggering it for me.

Is that a mod conflict or a bug of this mod?

This is what the log says:

Exception filling window for CrunchyDuck.Math.Dialog_MathBillConfig: System.NullReferenceException: Object reference not set to an instance of an object
[Ref 1B3C68F4]
kd8lvt  [author] 4 Oct, 2024 @ 3:40pm 
> The more I try to reproduce the harder it is to trigger
We love issues like that :zote:
> I'm running linux
Ah, I'll test on my Deck then. Good to know.
Lunertic 4 Oct, 2024 @ 3:38pm 
This probably shouldn't be a factor but I am running on linux.
Lunertic 4 Oct, 2024 @ 3:36pm 
The more i try to reproduce the issue the less I'm sure what the conditions are and the harder it becomes to reproduce it.
kd8lvt  [author] 4 Oct, 2024 @ 3:28pm 
Ah ok, so something is handling the error, just not the first time it's thrown. That's super helpful thank you
kd8lvt  [author] 4 Oct, 2024 @ 3:27pm 
Huh, it being inconsistent is odd, what you described was most likely a nullref, which I can believe happening, but not it being inconsistent o.O
I'm still planning on looking into it, if only because it's an inconsistent nullref and starting on those early is a good idea because they take f o r e v e r to figure out sometimes lol
Lunertic 4 Oct, 2024 @ 3:26pm 
I can get the UI to break for about a second then it fixes itself.
Lunertic 4 Oct, 2024 @ 3:24pm 
Nevermind my previous report. trying again i can't reliably reproduce it which is even more puzzling.
kd8lvt  [author] 4 Oct, 2024 @ 3:05pm 
I had to fix that in particular to get Math to function on 1.5. Ludeon completely refactored stockpiles, and technically all storage is multi-stack-per-tile now. For stockpiles "multi" just happens to mean "one"

I use shelves to store meals anyways, so if it wasn't counting shelves I'd figure it out pretty quickly.
Lunertic 4 Oct, 2024 @ 3:00pm 
I'm guessing its a deeper issue with how math caches items, the stacktrace indicates nothing is found in the item cache. Its probably legacy code from before shelves could store multiple stacks and back then multi item stacking per tile and items in shelves were just handled like regular stockpiles. Now that 1.5 introduces special multi tile storage it doesn't look in those storages and therefore never finds the item.
kd8lvt  [author] 4 Oct, 2024 @ 2:58pm 
We love when I forget to null-check something. I can fix that pretty quick. Should just try/catch .DoMath() lol
Lunertic 4 Oct, 2024 @ 2:56pm 
FYI the bill UI breaks completely if an item does not exist on the map or is only stored in shelves / other storage buildings. A quick test with no mods other than math and harmony on a dev map confirmed this. Deleting all steel and trying to use "steel" in a field caused the UI to stop rendering properly. Same if I make a shelf and spawn a stack of steel in there after removing all other steel.
kd8lvt  [author] 20 Sep, 2024 @ 1:49pm 
No problem :) Like I said, if you run into issues let me know, but everything should be working fine.
Pos 4/5 20 Sep, 2024 @ 1:05am 
Thanks for the update!
kd8lvt  [author] 19 Sep, 2024 @ 2:57pm 
@Ruby
You'll be happy to hear that I finally managed to scrounge up enough time to look into that. The latest release fixes it (at least, in a mostly-Math-only context. The only other mod I test with is Dub's Menus)
It also fixes "Look-in-stockpile" for those who were missing it.

As always, let me know if anything is horribly broken; though I did test it of course. If your game doesn't have the fixes, try restarting Steam.
-K
Ruby 3 Sep, 2024 @ 11:41am 
Understandable! I am perfectly willing to wait for a FREE mod. The work in continuing has been awesome and I thank you on behalf of the entire community. Feel free to just keep playing; I've been battling depression since middle so I know how life goes. You are first and foremost important, so take care of yourself!