Jump to content

[1.3.0] Filter Extensions 3.0.4 (Jul 11)


Crzyrndm

Recommended Posts

v1.5 released

  • Mod Categories now support groups of mods. Specify folders with comma's between them (eg. value = Mod1, Mod2, Mod3, ...)
  • Subcategories now support adding to multiple categories. Specify categories with comma's between them (eg. category = cat1, cat2, cat3, ...)
  • Icon loader is working again. All images/textures inside GameData with dimensions less than 40x40 are accessible by autoloader or cfg
  • Fixed github issue #1 with category colour that made any value less than 0xFF read as 0x00
  • Fixed edit and delete cfg handling

And now, I *think* everything should be working as intended again. ​*Waits for barrage of bugs*

Loading now to go a bug hunting :D Thanks for your work on this.. its made my part inventory much more manageable.

Link to comment
Share on other sites

Wonderful!

I have one suggestion. Could it be possible to reload the filter without having to restart the game? That could be great for me. I'm creating icons for all the mods and resources I have (mostly reconversion for older icons so they are adapted to this format) and that could make my testing process faster :P

Thank anyway for this.

Link to comment
Share on other sites

It's using Squad's Game Database for just about everything, which means that everything gets loaded on launch (game database has the major advantage of being rock solid at doing it's job). I could probably reshuffle things so you could use the debug menu to reload configs (with associated bugs and rubbish) but I can't do anything for the icons.

Edited by Crzyrndm
Link to comment
Share on other sites

Ok, no problem. It's no big deal anyway. While the game is restarting I use that time creating the next icon, so not big issue in the end. Do not risk breaking anything else for something is only using while modding and not gaming :P

However _I found a bug in teh autotag. It seems it doesnt accept parts with the same filename and it only keep record of the latest one. Lots of mod use the same filename for their parts (usualy, but not always: "part.cfg"). A small mod to test it could be deadly reentry, but it happens with more (EL, KW, KSPX). Usually they have different folder for the parts, so maybe you could use folder+part filename as unique id.

Keep the good work, it'0s really useful for those guys like me with lots of mods.

Link to comment
Share on other sites

Don't be so hard on your self.

By the way I just found another wonderful feature of your mod, which I'm not sure you have take credit enough. With your mod I can create custom icons for resources and they autoloaded in the resource section. Haven't tried yet, but I guess it will happen the same in the module section. This is really useful and you at least mention it. Not only autotags mods, but also autoassign icons to resources in the editor. Makes the editor much more friendly

EDIT: Ok, this feature has one minor drawback. It replaces the science icon if there is another icon named icon (acyually it does with any other icon). Problem is that Alternate Resources mod has an icon with that name. I could override this effect by using another custom icon on a folder that load before alternate resources (which is also something I'm going to need for the resources icon). I just need to find the original icon somewhere so I can use it instead of a custom one. I guess my custom folder is going to be top list.

Edited by KaiserSoze
Link to comment
Share on other sites

Had a question - I'd like to create a landing gear subcategory when filtering parts by function. I (sort of) understand that your filtering system goes by in-game module name, but what about modules that don't necessarily show up via right-click on the parts list, and what about the name of the MODULE in the part config? I just want to capture all parts that have either ModuleLandingGear or BDAdjustableLandingGear or FSwheel/FSwheelAlignment. Is it possible just to use the part config name of the module (as I just listed)? In other words, will this work:

SUBCATEGORY

{

category = Filter by Function

title = Landing Gear

icon = R&D_node_icon_landing

FILTER

{

CHECK

{

type = moduleTitle

value = ModuleLandingGear

pass = true

}

}

FILTER

{

CHECK

{

type = moduleTitle

value = BDAdjustableLandingGear

pass = true

}

}

FILTER

{

CHECK

{

type = moduleTitle

value = FSwheel

pass = true

}

}

}

... and if it won't work, I would suggest that for a future feature =)

Link to comment
Share on other sites

Wonderful!

I have one suggestion. Could it be possible to reload the filter without having to restart the game? That could be great for me. I'm creating icons for all the mods and resources I have (mostly reconversion for older icons so they are adapted to this format) and that could make my testing process faster :P

Thank anyway for this.

I was doing the same thing with the icons :P Sounds like your ahead of me . Any chance you can share what you've converted so far? (or maybe Cyrzndm could even integrate them into the download, would be awesomeness!)

Link to comment
Share on other sites

By the way I just found another wonderful feature of your mod, which I'm not sure you have take credit enough. With your mod I can create custom icons for resources and they autoloaded in the resource section. Haven't tried yet, but I guess it will happen the same in the module section. This is really useful and you at least mention it. Not only autotags mods, but also autoassign icons to resources in the editor. Makes the editor much more friendly

EDIT: Ok, this feature has one minor drawback. It replaces the science icon if there is another icon named icon (acyually it does with any other icon). Problem is that Alternate Resources mod has an icon with that name. I could override this effect by using another custom icon on a folder that load before alternate resources (which is also something I'm going to need for the resources icon). I just need to find the original icon somewhere so I can use it instead of a custom one. I guess my custom folder is going to be top list.

The auto-loader pass is (or should be) before everything defined in cfg's. If something is being loaded by accident, you just need to explicitly over-ride that. It is applied to every category and every subcategory that is generated prior to it running (basically all the ones generated automatically. Resource/Module/Tech/Manufacturer|Mod/*Mod Folder X* and the basic functions should all be auto-loading)


SUBCATEGORY
{
category = Filter by Resource
oldTitle = Electric Charge
title = Electric Charge
icon = */insert icon name here/*
}

Just rename the icon to something that isn't going to get snapped up by the auto-loader and direct it to replace the one that got accidentally picked up.

... and if it won't work, I would suggest that for a future feature =)

I didn't know you could hide modules ;.;. I'll add the option to use their cfg name for the next version (Here I was thinking the ingame name was easier since you could just say: I want these parts, oh look they have these modules. Done.)

It'll use the key "moduleName" (NOTE: name = backend, title = frontend)

or maybe Cyrzndm could even integrate them into the download, would be awesomeness!

I'm thinking that a way to share cfg's/icons is definitely in order. Instead of just lumping them all in the download (which is going to get messy quick), how about an archive on github that has groups of cfg's to grab. That way you don't end up with dozens of empty subcategories

EDIT

I probably need to update the documentation at some point too. <==== Reminder to self

EDIT2

When reporting issues, can I ask that you include a config that showcases the issue. It just makes things easier to understand

EDIT3

;.;

I broke the duplicate filter with 1.5. This is not a good thing

;.;

Edited by Crzyrndm
Link to comment
Share on other sites

It seems I did not explain my self about the icon replace issue. The problem arises if you have installed Alternate Resources, not sure if you know that mod. This mod has a lot of icons of its own in order to represent the resources in a better way. Since your mod loads all the icons while loading those icons are loaded also. And since the name of most of them is the same as categories they replace the icon by default (i.e. squad icon). They do not look great however, since the icon are 32x16 and the game makes them square.

It's not a great problem and I have made a simple solution. My custom icon folder is named "001 Icons" and that way they are parsed before the ones from AlternateReosurces. Tested and works fine. Know I just have to create the icons in a much better way.

Regarding sharing the icons I've made so far I have no problem. I will issue a pull with a few icons in github. Feel free to reject it if you prefer to have the icons somewhere else.

Edited by KaiserSoze
Link to comment
Share on other sites

It seems I did not explain my self about the icon replace issue. The problem arises if you have installed Alternate Resources, not sure if know that mod. This mod has a lot of icons of its own in order to represent the resources in a better way. Since you load all the icons while loading those icons are loaded also. And since the name of most of them is the same as categories they replace the icon by default (i.e. squad icon). They do not look great however, since the icon are 32x16 and the game makes them square.

Hmm, I could add a minimum dimension check to the icon loader as well. Squad uses 32x32, so maybe >25 and <40?

RE: your issue with the autoloader

Alternate Resources includes an icon named: Fuel1 => Autoloader matches this to resource: Fuel1 => Fuel1 icon now uses the icon from Alternate resources

You include an icon named: Fuel1_replacement, and a cfg that matches to the resource: Fuel1 => The config pass overwrites the icon: Fuel1, with the icon: Fuel1_replacement

I specifically set it up this way so that you shouldn't need to worry about load order.

Edited by Crzyrndm
Link to comment
Share on other sites

v1.6 released

  • Subcategory collision detection is semi-functional. I need to fully revise this at some point due to the changes introduced by 1.5 (multiple categories per subcategory)
  • Bug in the logic handling part=>mod assignment resolved (#2 on github)
  • Added "moduleName" filter type. This should correspond to the module name specified in cfg's (contrast to "moduleTitle" which goes off the ingame name of a module)
  • Stopped parts with category == ("none" | "-1" | "") showing up in part lists

PS

I'm going to set up a folder on github for sharing icons and/or configs. Just sen them my way if you want to share :)

Link to comment
Share on other sites

@Kaiser

Can you send me a text file that links the icons to the mods. Most of them are fairly obvious, but I'm not familiar with a few of them and I'd like to keep it organised.

Thanks! Ill send a pack once i got a reasonable number done =D slowing getting rid of the question marks :P

Just merged a pull request from Kaiser that had a number of icons in it. You can find them all here.

And same thing as Kaiser, have a text file for autoloading icons and comments in the cfg's (using "//") so I and anyone else can match them up properly ;)

Can't download as fast as you are putting out new versions, argh.

I do try and keep it to <= 1 per day :D (barring showstoppers ofcourse. Those are all on the ASAP wagon)

Edited by Crzyrndm
Link to comment
Share on other sites

A heads up for anyone using subcategory cfg's, as of v1.7 I will be changing the syntax slightly regarding the "pass" key in CHECK nodes.

"pass" will be replaced with "invert", which means that "pass = true" will be replaced with "invert = false".

This is being done to make the syntax consistent with that of FILTER nodes, and easier to understand at a glance. Another upshot of this is that the invert key will become an optional requirement, with the default being false if invert is not specified (and means that you only *need* to change any cfg's where pass was set false :)).

No need to rush, you've still got ~18 hours before 1.7. I just thought everyone would appreciate the warning

Link to comment
Share on other sites

Hey thanks for changing it so I can use modules' names from configs - maybe I'm the only one that likes it, but it makes my life easier! :) If your interest is to make writing configs easier for the widest possible audience, and not just for people who can intuit programmerese, drop the whole "pass = " and "invert =" and do (something like) this instead:

This:

FILTER

{

CHECK

{

type = moduleName

value = ModuleLandingLeg

pass = true

}

CHECK

{

type = moduleName

value = ModuleName2

pass = false

}

}

Becomes this:

FILTER

{

MUSTHAVE

{

moduleName = ModuleName1 AND ModuleName2 AND ModuleName3

partName = SomePartName (so it has to have all 3 above modules AND this part name)

etc., using the variables you've already cooked up

// alternatively, moduleName = ModuleName1 OR ModuleName2 OR ModuleName 3

}

MUSTNOTHAVE

{

moduleName (or partName or whatever class of identifier) = ModuleName1 OR ... etc.

}

}

Obviously, the particular words and the manner in which your configs work might not look just like that - but if you want configs to be really easy to write, don't write your config interpreter from the point of view and using the vocabulary of a programmer. No one intuitively knows what "invert" means in the context of a specific mod, but things like "MUSTHAVE" with "moduleName" are pretty clear.

Edited by AccidentalDisassembly
Link to comment
Share on other sites

Obviously, the particular words and the manner in which your configs work might not look just like that - but if you want configs to be really easy to write, don't write your config interpreter from the point of view and using the vocabulary of a programmer. No one intuitively knows what "invert" means in the context of a specific mod, but things like "MUSTHAVE" with "moduleName" are pretty clear.

The problem with that becomes that it is not obvious what happens when you have multiple types (eg. moduleName and partName) together, and people will probably have trouble with precedence of operators (AND's are resolved before OR's, but that's not explicit and errors can be difficult to debug). By splitting them up as I have done, you have one rule for each node type. All CHECK's are AND'd together, All FILTER's are OR'd together. It removes all ambiguity (while still allowing a lot of control if you have a good understanding of boolean operations). A psuedo-human expression may be easier to read, but human readable language is prone to ambiguity.

Atleast, that's how I see it.

Ofcourse, I may revise the syntax at some point, I'm just not sure such an approach would be beneficial.

Edited by Crzyrndm
Link to comment
Share on other sites

The problem with that becomes that it is not obvious what happens when you have multiple types (eg. moduleName and partName) together, and people will probably have trouble with precedence of operators (AND's are resolved before OR's, but that's not explicit and errors can be difficult to debug). By splitting them up as I have done, you have one rule for each node type. All CHECK's are AND'd together, All FILTER's are OR'd together. It removes all ambiguity (while still allowing a lot of control if you have a good understanding of boolean operations). A psuedo-human expression may be easier to read, but human readable language is prone to ambiguity.

Atleast, that's how I see it.

Ofcourse, I may revise the syntax at some point, I'm just not sure such an approach would be beneficial.

Yeah, that's true. I'm sure there's a much better way than what I came up with - programmer language is also prone to ambiguity, though. "Invert", for example. Invert what? And of course there's nothing inherent in the word "FILTER" that implies OR logic. The word "FILTER" could easily imply exclusion too (since that's what filters do), but FILTER can do both, here. :) So it's all ambiguous. I guess my only real point was that, even if still somewhat ambiguous, things like "NEEDSANYOF {}" or "NEEDSALLOF {}" (or something) might be more immediately intelligible, and I am sure someone more thoughtful than me could come up with a way that makes the AND and OR stuff clearer. Then again, maybe a little reading is not too unreasonable and, after it, a person might also be good to go with programmerese. Just throwing around ideas I guess.

Link to comment
Share on other sites

I think what I was trying to say is that while the names may be ambiguous, the rules aren't, and there's only one to remember for each node type.

..."NEEDSANYOF {}" or "NEEDSALLOF {}" ...

I think this is definitely something I should look into.

I came up with the names Filter and Check because it can be expressed as a very simple human readable sentence: A part must pass ALL check's in ANY of the filter's to be accepted into THE subcategory (I should've writen that down somewhere :D). Maybe not the best reasoning, but it worked at the time.

Link to comment
Share on other sites

Hmm, I could add a minimum dimension check to the icon loader as well. Squad uses 32x32, so maybe >25 and <40?

RE: your issue with the autoloader

Alternate Resources includes an icon named: Fuel1 => Autoloader matches this to resource: Fuel1 => Fuel1 icon now uses the icon from Alternate resources

You include an icon named: Fuel1_replacement, and a cfg that matches to the resource: Fuel1 => The config pass overwrites the icon: Fuel1, with the icon: Fuel1_replacement

I specifically set it up this way so that you shouldn't need to worry about load order.

The beauty of your autoloader is that is doesn't require any extra config file. Since it auto creates categories for any folder it only requires icons to have the same name as mod folder and voila! now you have icons for mods without any config file. That also what causes the issue with alternate resources. You solution to check the size and avoid 32x16 icons could be a good one so those icons are skipped. But in the end we will still need to keep our icon folder up un the list just in case any other mod uses an icon with the same name.

I would probably need those config files to sort bigger mods (USI mods), but since I'm starting alphabetically, that something for later on.

I will also include link to the mods as requested

Edited by KaiserSoze
Link to comment
Share on other sites

I think what I was trying to say is that while the names may be ambiguous, the rules aren't, and there's only one to remember for each node type.

I think this is definitely something I should look into.

I came up with the names Filter and Check because it can be expressed as a very simple human readable sentence: A part must pass ALL check's in ANY of the filter's to be accepted into THE subcategory (I should've writen that down somewhere :D). Maybe not the best reasoning, but it worked at the time.

Aha, yes, that sentence does actually work, haha - I probably never would have commented had I thought of it that way.

Another handy thing might be something like ONLYHAS { type = resource }, or something (HASONLY?), if you want to filter by a part that has only one resource - like for my Batteries filter (below), I can already limit the filter to things that only have EC, but (I think) only if I check for every other resource and make pass = false for them. Or maybe I didn't really understand the CHECK logic yet, very possible. As is, I assume it will capture EVERYTHING that doesn't have ModuleEngines or ModuleEnginesFX or ModuleCommand but does have EC, including lots of random parts people have added EC to. But maybe that's OK, too.

Anyhoo, here (https://dl.dropboxusercontent.com/u/59567837/EditorCategories.cfg) is a link to a few very simple category options I've made for myself. I gather the syntax will change in the next version, but for now, it makes categories for:

1. Solar panels (anything with ModuleDeployableSolarPanel)

2. Landing gear & legs together

3. Decouplers (anything with ModuleDecouple)

4. Batteries ("Power Storage", hopefully won't include engines and such)

5. Docking ports (anything with ModuleDockingNode (?))

6. Wheels & tracks (tracks from lo-fi's Kerbal Foundries wheels/tracks set, that is)

Probably could use a lot of work, but I think they're handy!

Edited by AccidentalDisassembly
Link to comment
Share on other sites

As is, I assume it will capture EVERYTHING that doesn't have ModuleEngines or ModuleEnginesFX or ModuleCommand but does have EC, including lots of random parts people have added EC to. But maybe that's OK, too.

That's the way I always did batteries. Having a few extra's that aren't "explicitly" batteries, but have a battery integrated (like the stock rover body thing) isn't exactly a bad thing. After all, you are only looking for electricity storage and sometimes it's easier to include a multi-purpose part.

Thanks for the configs. I'll probably add NF Electrical's capacitors to the Power Storage cfg ("Stored Charge" resource from memory), but it won't make a difference unless you use parts that use that resource ;)

EDIT

Put that sentence in the OP, because I should have put it there right from the start. In saying that, I need to re-write large portions of the OP, there has been a few changes since 1.0 :D

Edited by Crzyrndm
Link to comment
Share on other sites

I do try and keep it to <= 1 per day :D (barring showstoppers ofcourse. Those are all on the ASAP wagon)

No no it is ok, It is just a drawback of living in the countryside. Can almost not wait for the minsize update :)

Could you make an additional zip for the download of the new icons and ready made filters? Having to fork the whole project for the icons to avoid the questionmarkspam in the filters looks a bit much.

Without the automatic replacement of the scienceicon from ARP, it Looks really well, but I miss PartCatalog.

Link to comment
Share on other sites

Could you make an additional zip for the download of the new icons and ready made filters? Having to fork the whole project for the icons to avoid the questionmarkspam in the filters looks a bit much.

More than likely it will end up that way. I'm just getting everything sorted out atm

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...