@davy I have the feeling that we are not understanding each other. So I will try to explain differently. Take note that in the title “Make in same extension elements/objects visible to each other in functions” I imply “functions defined in the SAME extension” and not “functions created through the scene event sheet”
Yes, I agree with this view. In my view, extensions should be module which are independant, portable. And they should not need to be triggered from the outside, except for passing parameters.
As said, the Y sort is a good example: I attach it to my object, and it do stuff, that I do not care about.
I am not asking to have the scene components visible inside the extension. I am asking to have the components defined in a same extension visible to other components: Custom objects defined in the extension and their properties & functions, Behaviors defined in the extension and their properties & functions, global functions defined in the extension, visible to each other as long as they are in the same extension.
A concrete example, inspired from this thread:
I want to make an extension which allow me to check if isometric object are behind or in front of each other, not all of them have square shape. For this I need at each frame:
- cycle through all the object with behavior and assign them a unique Z value, and reset behind list of each objects.
- cycle trhough all the object with behavior, calculate the (isometric projected) leftest and rightest point based on the origin
- cycle through all other object with this behavior, compare the origin with the 1st object leftest and rightest point.
- If the condition are met, and the Z value is lower, then exchange the Z value.
- Also store the unique ID of the object, to compare, so that the exchange does not happens twice
- cycle through all other object with this behavior, compare the origin with the 1st object leftest and rightest point.
As you said this is the complicated stuff that I could make with code, and that the user don’t want to know about, it just sorts the objects according to the rules and works. In theory, it shall have not necessitate as single call in the event sheet to work.
But it is currently not possible to implement this way. I can possibly trick a simple foreach object through the functions called each frame, however I cannot compare object with the same behavior in the extension. I also cannot do a for each objects with the behavior in the global function, because the global function in the function is not even aware that the behavior exists.
And that is the feature I request: Everything defined in the extension should be accessible inside this same extension.
And if this not possible, I could be satisfied with this alternate reduced feature:
- Inside an extension behavior, there shall be a way to make a foreach on all object (and pickall, Condition/action, …) with this behavior, and allows interaction beetween themselves.
For my short GD experience, for each and in beetween object interaction is the most missing part.
=> Could also be very helpful, but this is in my view another feature request.
=> This is not related to my initial request.
I hope this give more clarity to the request.