Open Ukendio opened 8 months ago
Mentioned this is Discord
Making a query language which searches entities for matching components and component data is really complex. I think it would be easier to just search for matching components, then use luau pattern matching to narrow down your search. The patterns could be matched against a serialized string of the component data, and any entities who don't have matches for every pattern are removed from the search.
This is way less difficult to do, and still a very powerful search tool. It also uses peoples prior knowledge of luau pattern matching.
Adding onto #97, it is currently very difficult to find a very specific entity in your game. Sorts mediate this, however fundamentally there needs to be better capabilities to search for them.
I have already laid out the ground work for the search filter's functionality. Not the best implementation yet but it works reasonably well without being intrusive for anyone to call. The function
searchFilter
can be found in the branch "search-filter". You pass in a world and a query string. E.g.searchFilter(world, "Test, Friend, !Hello, !Goodbye")
which will query for entities withTest
andFriend
while skipping any entities that contain either ofHello
orGoodbye
The idea for the implementation would be to grab the input of a textbox and feed that to the searchFilter's params. And then taking the returned entities and display them on the widget.