边缘世界 RimWorld

边缘世界 RimWorld

144 个评价
TD Find Lib - Continued
   
奖励
收藏
已收藏
取消收藏
Mod, 1.4, 1.5, 1.6
文件大小
发表于
更新日期
2.238 MB
7 月 19 日 上午 5:56
9 月 19 日 上午 2:52
11 项改动说明 ( 查看 )

订阅以下载
TD Find Lib - Continued

在 Meme Goddess 的 1 个合集中
Uuugggg's Continued Mods
13 件物品
描述
Sadly Uuugggg has passed away, I'm going to continue this mod (and some/all of his others) in order to preserve his legacy and impact on RimWorld.

Original Mod
Github[github.com]

Original Description
Library mod
This is a Library mod which does nothing by itself! It does have some UI to hold the library of searches, which you can set up, peek at and save. But other mods are needed for real use:

Get yourself Ctrl-F and Custom Alerts to use it! Also, Everybody Gets One makes use of it. Also YOUR MOD should use this! It's a library mod! USE IT IN YOUR MOD!

Share your Custom Filters
The possibilities are endless! New ideas come up all the time! So share your custom search with everyone in this thread:
https://psteamcommunity.yuanyoumao.com/workshop/filedetails/discussion/2895299310/4342103279871646531/

Features
A very deep filtering framework. A long list of details to filter things on.

A library of saved searches. (Accessible through settings, but also mods that use TDFindLib should have an easier button to open the library) Whatever mod uses TD Find Lib has access to the library so it's easy to share across games.

An editor window to create and edit searches, openable from the library. Ctrl-C, Ctrl-V copy/paste. Ctrl-drag a filter to copy it (with the caveat it can't be placed next it itself because underlying code didn't handle that)

A viewer window to perform a search on a map, openable from the editor. (Rudimentary use here, use other mods for better UI) Click/drags items in the list to select them. Double-click to select all of the same type. Ctrl-click to add or remove from selection. Right-click them to go to them.

Easily import and export searches from mod to mod, or to the library, or even the clipboard!

For use in other mods
This mod is made for other modders to use. If your mod can make use of user-customizable searches, this mod makes it easy.

So what could you use it for? Well, I very quickly updated my mod Everybody Gets One to use it! That mod lets work bills set a limit based on the number of colonists instead of a set number. But ever since 1.1->1.4 added slaves, children, etc, you don't just want the number of colonists to set the limit - there's room for customization! But that's too many options and combinations for that mod to think about. But with the power of TDFindLib, it was easy! So instead of making "One Hat for each colonist", it can be "One Hat per prisoner/colonist" or "tribalwear for slaves and prisoners" or "pants for children only" or any of those, EXCEPT for people with the nudist trait! Whatever you can imagine, the user can set their own filters using TDFindLib. For example when making it, I remembered, hey, I can make swords for only people with melee skill! THANK YOU TDFINDLIB!

Search Details
A search has a few components:

Listing. What basic type of thing to list. Ctrl-click the listing to set multiple types.

Match any/all. Simply whether or not to match any or all filters.

Map. By default, searches are performed on the current map. But it can be set to use all maps, or specific maps in your game.

Filters. The bulk of this mod is a huge list of filters for nearly anything about an item. If you want a new one, ask - they're not hard to code up. (If you're making a mod yourself - it's also easy to add new ThingQuery subclasses in C#)

Each filter can be set to Include or Exclude items that match the filter. A filter can be temporarily turned off. The filters can be locked, I guess, to show a cleaner presentation... I dunno, it felt like a good idea.

When selecting a filter setting, it will often narrow down the options to things that are available on the map. Shift-click the setting to get a list of all possible things (which can be a very long list!)

Advanced filters: if you dare, the C# fields of Thing are accessible with the Advanced Filter. Type in a field name and get a dropdown list for C# fields, among a few other options like is null. This is not technically running that C#, but is painstakingly handled so it is not slow either. There's some safety measures so you don't, for example, thing.Kill() every item on the map. But still, you should know what you're doing in C# to use this. If you *really* know what you're doing, you can enable godmode to access private fields (enable godmode before creating the filter)

Performance
When a mod performs a lot of of searches, you might worry about performance.

Well, don't set up a search that goes through 10,000 things and searches them by name! The 'all' filter literally searches all bushes, grass, dirt, etc.

First, if your search only concerns one type, be sure to set the Listing appropriately so the search is faster, like Listing: Items. Ctrl-click listing to select multiple types.

Second, order your filters to narrow down things quickly. The lower filters are only checked if the item passes the previous filters. For example, in the the Wild Plants filter: Don't put the "Not in a zone" filter first, since most things are not in a zone. First, narrow down quickly by filtering for the few plants that are "Harvestable Now".

Some filters are slower than others. Some are simply one-item checks whereas others like the name filter have a lot more work to do. Consider that.

Tedious detailed Notes
Corpses/"Minified Buildings" are weird. They are technically two items: containers, and the the Person/Building in the container. Since you probably want to match on the "contents", TDFindLib applies the filter to the "contents". But the location is from the "container", so filters pass if either the "container" or the "contents" pass. So that poses few conundrums. Some filters like 'Health %' are weird since a 0% Colonist is stored in a 100% corpse. So don't expect corpse searching to work perfect.

If you just want any minified thing : Specific thing => Shift-click (Other) => Minified thing. You can also add to that search Specific Thing => Furniture => Bedroll and it will find minified bedrolls.

Each corpse has a separate listing under Specific Thing => ___ Corpses.

Selected items highlight what filters they match - but this doesn't work for Inventory items, since you're not selecting the things in the inventory.

Filters like area/zone are filtered by a single position, not accounting size of the thing.

Compatibility?
* RimThemes; all you have to do is enable dialog stacking in RimThemes dialog options.

---

This is an evolution of my old mod List Everything. This mod takes the searching functionality and makes it simple for other mods to use: So List Everything is now Ctrl-F and Custom Alerts, and hopefully more to come.

---

This mod has pushed vanilla UI to the limits, and a few bugfixes are needed for full UI functionality. The fixes are generally useful, so they went in another mod : TDS Bug Fixes, which will include other fixes at some point. Of course the game should auto-download that for you.

---

Original Source (Not current): https://github.com/alextd/RimWorld-TDFindLib
54 条留言
electrococaine 9 月 25 日 上午 9:08 
@Meme Goddess im not sure if "descrioption" is the proper term, maybe something like "status" describes it better.
I think it would be pretty useful to be able to search if it contains string
im talking about this text so we are 100% on the same page https://imgur.com/a/5zoir4x
Meme Goddess  [作者] 9 月 25 日 上午 4:15 
@electrococaine ~ Hmmm, like description contains X?
electrococaine 9 月 24 日 上午 11:21 
@Meme Goddess do you think it would be possible to add searching the building's description, eg.: Power needed: 200 W
Grid excess: 5155 W (1200 Wd stored)
Fuel: 4.1 / 5

i think that would solve the issue i had with the shields and add more flexibility
electrococaine 9 月 21 日 上午 7:55 
@Meme Goddess i dont think that minified shields have the recharge or active state. I wouldve thought that something like "thing as building.getcomp<compshield>().ShieldState = active would work but apparently not :(
Meme Goddess  [作者] 9 月 21 日 上午 7:53 
Not sure, I haven't got into the really advanced stuff. But feel free to suggest new filters if you can't find exactly what you need
electrococaine 9 月 21 日 上午 7:51 
also, while we're here, whats the best way to look for a non-faction affiliated predator hunting your pets? i only managed to half-achieve it with "all(action=hunting + nearby(colony animal))"
Meme Goddess  [作者] 9 月 21 日 上午 7:50 
@electrococaine ~ Hmmm, perhaps it's trying to look for the item and not the deployed version? Not sure though
electrococaine 9 月 21 日 上午 7:49 
@Meme Goddess no :( can you give me some pointers?
Meme Goddess  [作者] 9 月 21 日 上午 7:48 
@Alvargon ~ If you know of other mods that need someone to pick them up, let me know ^.^

@electrococaine ~ Did you end up working this out?
Alvargon 9 月 20 日 下午 5:34 
It’s curious how many RimWorld modders have abandoned their mods because they’ve passed away 😬