I’ve recently bought node Canvas for a project I am working on, and have stumbled upon a stone that won’t lemme progress. Here’s the thing:
I’m scanning a scene with the “findAllWithTag” action, and am storing that information on a list. When I have that list, I wanna go thru it with an “Iterate” node and generate a depurated list that contains ONLY the objects that comply with a boolean flag that’s contained within them (isAvailable). The thing is, that I’ve tried multiple ways and cannot access that property from the objects on the list created previously.
Can you please guide me on how to achieve that? Any help will be greatly appreciated.
To access a property, field or function of a component you need to use the actions/conditions under the “Script Control” category. In your case where you want to check a property, you would want to use the “Check Property” condition.
Once you have added the Check Property condition task, the first thing you would want to do, is to set the target of the task to be your current iterated variable “currentTable”.
Finally, you will of course also need to select the boolean property you want to check, by clicking the “Select Property” button.
You will notice though, that the list will not contain the component type that you are after, because NodeCanvas does not yet know of that type.
So, to make the popup list contain your type, all you need to do, is to open up “Tools/ParadoxNotion/NodeCanvas/Preferred Types Editor”, and in the window that will open up, search your type in the search field and hit the “+” button to add it in the list. So from now on, your added type will show in all NodeCanvas menus and as such you will be able to access properties, fields and functions of it when using any “Script Control” categorized tasks.
Please let me know if that helps, or if you need further explanation.
Thanks.