Skip to content

Releases: EiTaNBaRiBoA/SearchObjectByType

SearchObjectByType 2.0.0

18 Oct 05:41

Choose a tag to compare

SearchObjectByType 2.0.0

This is a major improvement for the SearchObjectByType utility, introducing a powerful generic filtering system, critical bug fixes, and a cleaner, more flexible API. This version is more powerful, stable, and efficient.

✨ New Features: Advanced Search with Filters

The core of this update is a new, generic filter-based search system. You can now find nodes based on any criteria you define in a function (Callable).

  • find_node_by_filter(filter: Callable, ...): Finds the first node that matches your custom filter. It's highly efficient as it stops searching immediately after finding a match.
  • find_nodes_by_filter(filter: Callable, ...): Finds all nodes that match your custom filter.

Example: Find all visible enemies in the "zombies" group with less than 50 health.

var filter_func := func(node: Node):
    return (
        node is Enemy and
        node.is_in_group("zombies") and
        node.health < 50
    )

var weak_zombies: Array[Node] = Search.find_nodes_by_filter(filter_func)

🛠️ Fixes & Optimizations

  • Critical Stability Fix: Removed the underlying static array used for storing results. This prevents race conditions and incorrect results in complex scenes. All searches are now stateless and safe.
  • Critical Crash Fix: The visibility check (visible_only) no longer causes a crash when it encounters non-visual nodes (like Timer or Resource).
  • Efficiency: find_node_by_type() is now much faster, as it stops searching the moment the first match is found.
  • Robustness: The internal logic for validating types is more reliable and provides clearer error messages.
  • Modernization: The entire script is now fully typed with GDScript 2.0 static typing for better editor support and reliability.

Full Changelog

  • Added find_node_by_filter() and find_nodes_by_filter() for powerful custom searches.
  • Refactored find_node_by_type() and find_nodes_by_type() to use the new, more efficient filter system.
  • Optimized find_node_by_type() to stop searching after the first match is found.
  • Removed findInnerNodeInNode() and findInnerNodesInNode() in favor of the root_node parameter.
  • Fixed a critical bug where a static variable could cause incorrect search results.
  • Fixed a critical crash related to visibility checks on non-visual nodes.
  • Improved internal type validation to be more robust.

Full Changelog: 1.0.1...2.0.0

SearchByNode 1.0.1

22 Jun 15:02

Choose a tag to compare

Fixed Subviewport main scene

SearchByNode

22 Jun 11:13

Choose a tag to compare

First release of SearchByNode