PDA

View Full Version : DB.findNode() that searches module path?



celestian
December 19th, 2021, 18:15
Is there a way to do a DB.findNode() that also searches loaded module paths for the same? I've been trying to figure it out but no joy. I know getChildrenGlobal will load all the nodes in a node for all loaded modules but I need to search for a specific id-XXXXXX but I don't care if it's in a module or not.

For example I have a record id-e10993 located in root node "audio" . So what I am looking for is audio.id-e10993 or audio.id-e10993@SomeModule. However unless I append the @SomeModule name findNode won't find it. I'd rather search across all of loaded modules (and local node entries).

The source of my problem is that I store audio URLS and then build triggers from them. When you do this the records in the triggers are not @Module as the records placed into the trigger are not from a module but a record. So what I have been doing is if the "trigger" has a @module I would pre-pend that to the audio record lookup. However this causes problems when they start "customizing" my sample triggers.

A work around would probably be to make the modules separate. The exported audio URLS as one and the triggers and collections in another. When creating the sound entries in triggers use the exported module.

celestian
December 19th, 2021, 18:41
Harpo in discord suggested adding "@*" to the node name (DB.findNode(id-e10993 .. "@*")) and... it works for me. Thanks!