RimWorld

RimWorld

Custom Alerts
CrazyBlot Jul 23, 2024 @ 11:56pm
Check Stored Resource
Need to make checkers that check some of critical resources stored. The numbers can be more than 1000. Example logic: If [Hay_Stored < 2000] then AlertMe.
Can anybody show me the way to do this? I hace checked almost any of available presets and cant find something suitable.
< >
Showing 1-5 of 5 comments
Uuugggg  [developer] Jul 25, 2024 @ 1:04am 
Custom Alerts only looks at individual things on the map, it won't check the resource bar count

<TD_Find_Lib.QuerySearch> <saveable Class="TD_Find_Lib.QuerySearch"> <name>HAY</name> <active>True</active> <listType>Items</listType> <mapType>AllMaps</mapType> <searchMaps /> <queries> <li Class="TD_Find_Lib.ThingQueryThingDef"> <def>Query_Def</def> <refName>Hay</refName> <stackRange>1~200</stackRange> </li> <li Class="TD_Find_Lib.ThingQueryZone"> <def>Query_Zone</def> <ex>1</ex> </li> </queries> <matchAllQueries>True</matchAllQueries> </saveable> </TD_Find_Lib.QuerySearch>

That being said this filter finds hay in stockpiles (not shelves)
Uuugggg  [developer] Jul 25, 2024 @ 1:13am 
ALTERNATIVELY

<TD_Find_Lib.QuerySearch> <saveable Class="TD_Find_Lib.QuerySearch"> <name>HAY</name> <active>True</active> <listType>Items</listType> <mapType>AllMaps</mapType> <searchMaps /> <queries> <li Class="TD_Find_Lib.ThingQueryThingDef"> <def>Query_Def</def> <refName>Hay</refName> <stackRange>1~200</stackRange> </li> <li Class="TD_Find_Lib.ThingQueryCustom"> <def>Query_Custom</def> <memberChain>GetSlotGroup().is not null</memberChain> </li> </queries> <matchAllQueries>True</matchAllQueries> </saveable> </TD_Find_Lib.QuerySearch>

Should find hay in storage of any type... (Called SlotGroups in code)
CrazyBlot Jul 25, 2024 @ 3:09am 
Thank for advice!

But unfortunately we r limited to small numbers (slider 0-200). Perhaps is any way to make condition like "2000<=[count of ITEM returned by search]" via advanced condition?
Uuugggg  [developer] Jul 25, 2024 @ 11:53am 
CrazyBlot Jul 25, 2024 @ 1:24pm 
**!!!** O_o i missed that function outside search setup ) Cool. Will try it but at first glance its work well. Thank you!
I began to understand logic and possibility of this cool mod closer.
Last edited by CrazyBlot; Jul 25, 2024 @ 1:25pm
< >
Showing 1-5 of 5 comments
Per page: 1530 50